diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-30 13:59:21 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-30 13:59:21 +0000 |
commit | c884cbd810d4a8b331e17aede4760a2368261177 (patch) | |
tree | 1c60bbace6f17de7944313b1a6f96b1646d90651 /test | |
parent | 410c048a3a44627aa152e721593526c970e9478b (diff) |
merge revision(s) 58080,58138: [Backport #13363]
keep line number after unterminated string literal
* parse.y (parser_parse_string): keep line number even after an
unterminated string literal. it does not matter in the parser,
ripper needs this value after this error.
parse.y: unterminated content token
* parse.y (parser_parse_string): defer the end token to next
reading, to yield tSTRING_CONTENT with the unterminated content.
[Bug #13363]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ripper/test_scanner_events.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index 1b7b56ebfe..8c950041a2 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -109,6 +109,9 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase [[3, 0], :on_heredoc_end, "EOS"] ], Ripper.lex("<<~EOS\n heredoc\nEOS") + assert_equal [[[1, 0], :on_tstring_beg, "'"], + [[1, 1], :on_tstring_content, "foo"]], + Ripper.lex("'foo") end def test_location @@ -131,6 +134,8 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase assert_location %Q["a\nb\r\nc"] assert_location "print(<<""EOS)\nheredoc\nEOS\n" assert_location "print(<<-\"EOS\")\nheredoc\n EOS\n" + assert_location "'foo'" + assert_location "'foo" end def assert_location(src) |