Closed presidentbeef closed 2 months ago
..when there is interpolation:
> RubyParser.new.parse("<<~HERE\n\ \#{1}\n b\n c\nHERE") => s(:dstr, "", s(:evstr, s(:lit, 1)), s(:str, "\nb\nc\n")) > Prism::Translation::RubyParser.parse("<<~HERE\n\ \#{1}\n b\n c\nHERE") => s(:dstr, "", s(:evstr, s(:lit, 1)), s(:str, "\n"), s(:str, "b\n"), s(:str, "c\n"))
Note without interpolation:
> Prism::Translation::RubyParser.parse("<<~HERE\n\ a\n b\n c\nHERE") => s(:str, "a\nb\nc\n")
And compare to regular heredoc:
> Prism::Translation::RubyParser.parse("<<-HERE\n\ \#{1}\n b\n c\nHERE") => s(:dstr, " ", s(:evstr, s(:lit, 1)), s(:str, "\n b\n c\n"))
..when there is interpolation:
Note without interpolation:
And compare to regular heredoc: