diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-02 23:21:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-02 23:21:34 +0000 |
commit | a43f2cbaa11c792cf417c6400d76710df77cd125 (patch) | |
tree | a13ae4d521d15be815066672005149307920407c /test/ripper | |
parent | 922d359e65a8d67626490e09af367ba633a7704b (diff) |
Fix Ripper.lex error in dedenting squiggly heredoc
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
Ripper.lex error in dedenting squiggly heredoc. heredoc tree is
also an array of Elem in the outer tree. [Fix GH-1234]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r-- | test/ripper/test_scanner_events.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index ab52392eb1..1b7b56ebfe 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -103,6 +103,12 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase [[5, 0], :on_imaginary, "5.6ri"], ], Ripper.lex("1r\n2i\n3ri\n4.2r\n5.6ri") + assert_equal [[[1, 0], :on_heredoc_beg, "<<~EOS"], + [[1, 6], :on_nl, "\n"], + [[2, 2], :on_tstring_content, "heredoc\n"], + [[3, 0], :on_heredoc_end, "EOS"] + ], + Ripper.lex("<<~EOS\n heredoc\nEOS") end def test_location |