diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-06 15:14:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-06 15:14:58 +0000 |
commit | 4671737b0f161263f5bd74eb4c76ab5b2cee7099 (patch) | |
tree | 55093faef49ac6550600489105156138042b73a5 /test/ripper/test_lexer.rb | |
parent | 8727dce2bf2e88b84ffaeda68e5520feb5c7eae3 (diff) | |
download | ruby-4671737b0f161263f5bd74eb4c76ab5b2cee7099.tar.gz |
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_lexer.rb')
-rw-r--r-- | test/ripper/test_lexer.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ripper/test_lexer.rb b/test/ripper/test_lexer.rb index 2ec66cd592..72b7f1b5fd 100644 --- a/test/ripper/test_lexer.rb +++ b/test/ripper/test_lexer.rb @@ -20,5 +20,16 @@ class TestRipper::Lexer < Test::Unit::TestCase D E assert_equal(str, Ripper.tokenize(str).join(""), bug) + + str = <<~'E' + <<~"D" + #{ + <<~"B" + this must be a valid ruby + B + } + D + E + assert_equal(str, Ripper.tokenize(str).join(""), bug) end end |