summaryrefslogtreecommitdiff
path: root/ext/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-02 17:48:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-02 17:48:10 +0000
commitd24c4683f713df695dd17da870a03c4cabca5440 (patch)
treeafb8bb9190c704f5b4634eca516bd24b7273de17 /ext/ripper
parent3692fd69ca10fb921db5cc74a6da5eaa66808f38 (diff)
downloadruby-d24c4683f713df695dd17da870a03c4cabca5440.tar.gz
ripper/lexer.rb: nested indented heredoc
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): fix for nested indedented here documents, where `Elem`s are nested too. [ruby-core:80977] [Bug #13536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/ripper')
-rw-r--r--ext/ripper/lib/ripper/lexer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb
index 669314ad92..350b513c25 100644
--- a/ext/ripper/lib/ripper/lexer.rb
+++ b/ext/ripper/lib/ripper/lexer.rb
@@ -67,7 +67,7 @@ class Ripper
def on_heredoc_dedent(v, w)
@buf.last.each do |e|
- if e.event == :on_tstring_content
+ if Elem === e and e.event == :on_tstring_content
if (n = dedent_string(e.tok, w)) > 0
e.pos[1] += n
end