summaryrefslogtreecommitdiff
path: root/test/ripper/test_scanner_events.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-06 15:14:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-06 15:14:58 +0000
commit4671737b0f161263f5bd74eb4c76ab5b2cee7099 (patch)
tree55093faef49ac6550600489105156138042b73a5 /test/ripper/test_scanner_events.rb
parent8727dce2bf2e88b84ffaeda68e5520feb5c7eae3 (diff)
ripper/lexer.rb: nested indented heredoc
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): insert stripped leading spaces as `on_ignored_sp` elements, so that the original source can be reconsructed. [ruby-core:80977] [Bug #13536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper/test_scanner_events.rb')
-rw-r--r--test/ripper/test_scanner_events.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb
index 027d56d1e6..ef49fc18ba 100644
--- a/test/ripper/test_scanner_events.rb
+++ b/test/ripper/test_scanner_events.rb
@@ -105,6 +105,7 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase
Ripper.lex("1r\n2i\n3ri\n4.2r\n5.6ri")
assert_equal [[[1, 0], :on_heredoc_beg, "<<~EOS"],
[[1, 6], :on_nl, "\n"],
+ [[2, 0], :on_ignored_sp, " "],
[[2, 2], :on_tstring_content, "heredoc\n"],
[[3, 0], :on_heredoc_end, "EOS"]
],