Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prism::Translation::RubyParser - Interpolation in adjacent strings #2836

Closed
presidentbeef opened this issue May 24, 2024 · 0 comments · Fixed by #2843
Closed

Prism::Translation::RubyParser - Interpolation in adjacent strings #2836

presidentbeef opened this issue May 24, 2024 · 0 comments · Fixed by #2843

Comments

@presidentbeef
Copy link
Contributor

RubyParser combines adjacent strings into a single :dstr. (RubyParser pretty much avoids nested :dstrs as much as possible.)

> RubyParser.new.parse('"#{1}" " "')
 => s(:dstr, "", s(:evstr, s(:lit, 1)), s(:str, " ")) 
> Prism::Translation::RubyParser.parse('"#{1}" " "')
 => s(:dstr, "", s(:dstr, "", s(:evstr, s(:lit, 1))), s(:str, " ")) 

(Prism 0.29)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant