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

Heredocs spanning other content #1017

Open
kddnewton opened this issue Jun 4, 2024 · 0 comments
Open

Heredocs spanning other content #1017

kddnewton opened this issue Jun 4, 2024 · 0 comments
Labels

Comments

@kddnewton
Copy link

First of all, let me say I'm sorry for reporting this at all. This is some ridiculous syntax.

<<-A; %Q[h\
g
A
h]

This should be two expressions: "g" and "hh". In an AST, it would look like:

s(:begin,
  s(:str, "g\n"),
  s(:dstr,
    s(:str, "h"),
    s(:str, "h")))

But this gem is duplicating part of the string, resulting in:

s(:begin,
  s(:str, "g\n"),
  s(:dstr,
    s(:str, "hg\n"),
    s(:str, "h")))

I assume because it's not skipping past the heredoc contents.

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

No branches or pull requests

2 participants