diff options
author | Kevin Newton <kddnewton@gmail.com> | 2024-05-21 11:02:59 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-05-21 18:45:16 +0000 |
commit | b20adf90e3c195098b8a6c36cd4a048592f56366 (patch) | |
tree | a1c582df4dd7641dff86ad9603eb2a1a203f0301 /lib/prism/translation | |
parent | 12386d36f072527cbd623aabd4df9948cf46c616 (diff) |
[ruby/prism] Fix up ruby_parser interpolation concatenation
https://github.com/ruby/prism/commit/79cec4be22
Diffstat (limited to 'lib/prism/translation')
-rw-r--r-- | lib/prism/translation/ruby_parser.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 43aac23be7..6e745a9041 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -905,8 +905,13 @@ module Prism results << result state = :interpolated_content end - else - results << result + when :interpolated_content + if result.is_a?(Array) && result[0] == :str && results[-1][0] == :str && (results[-1].line_max == result.line) + results[-1][1] << result[1] + results[-1].line_max = result.line_max + else + results << result + end end end end |