ruby / prism

Prism Ruby parser
https://ruby.github.io/prism/
MIT License
845 stars 142 forks source link

`Prism::Translation::RubyParser` - Nested string interpolations again (compatibility regression) #3186

Closed presidentbeef closed 2 weeks ago

presidentbeef commented 1 month ago

RubyParser 3.20.3:

RubyParser.new.parse('"#{"#{B} C"} D"')
 => s(:dstr, "", s(:evstr, s(:const, :B)), s(:str, " C"), s(:str, " D"))

Prism 0.29.0 (matches RubyParser):

Prism::Translation::RubyParser.parse('"#{"#{B} C"} D"')
 => s(:dstr, "", s(:evstr, s(:const, :B)), s(:str, " C"), s(:str, " D"))

Prism 0.30.0+:

Prism::Translation::RubyParser.parse('"#{"#{B} C"} D"')
 => s(:dstr, "", s(:evstr, s(:const, :B)), s(:str, " C D"))