summaryrefslogtreecommitdiff
path: root/ext/ripper/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-19 04:25:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-19 04:25:30 +0000
commit0e7936f89647a8ba2cd664dfde47e6a2e2c94e69 (patch)
treebb0e75b3433a93ff4da05e3be5c8c238008d4478 /ext/ripper/lib
parentcda27e1a6d62e5e41be75bd90bfb777569165304 (diff)
lexer.rb: no dedent strings in middle
* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): dedent only strings at the beginning, not strings in middle. [ruby-core:83343] [Bug #14027] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/ripper/lib')
-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 bb5908025d1..22f18ff4294 100644
--- a/ext/ripper/lib/ripper/lexer.rb
+++ b/ext/ripper/lib/ripper/lexer.rb
@@ -98,7 +98,7 @@ class Ripper
ignored_sp = []
heredoc = @buf.last
heredoc.each_with_index do |e, i|
- if Elem === e and e.event == :on_tstring_content
+ if Elem === e and e.event == :on_tstring_content and e.pos[1].zero?
tok = e.tok.dup if w > 0 and /\A\s/ =~ e.tok
if (n = dedent_string(e.tok, w)) > 0
if e.tok.empty?