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

Interpolations should not be parsed in quoted heredocs #147

Closed
aibaars opened this issue Dec 16, 2020 · 3 comments
Closed

Interpolations should not be parsed in quoted heredocs #147

aibaars opened this issue Dec 16, 2020 · 3 comments

Comments

@aibaars
Copy link
Contributor

aibaars commented Dec 16, 2020

The following heredoc is wrongly parsed. It looks like the single quotes have no effect.

x = <<'NO_INTERPOLATION'
This should not be interpolated #{interpolation}
NO_INTERPOLATION
program [0, 0] - [4, 0])
  assignment [0, 0] - [0, 24])
    left: identifier [0, 0] - [0, 1])
    right: heredoc_beginning [0, 4] - [0, 24])
  heredoc_body [0, 24] - [2, 16])
    interpolation [1, 32] - [1, 48])
      identifier [1, 34] - [1, 47])
    heredoc_end [2, 0] - [2, 16])

I think it should be

program [0, 0] - [4, 0])
  assignment [0, 0] - [0, 24])
    left: identifier [0, 0] - [0, 1])
    right: heredoc_beginning [0, 4] - [0, 24])
  heredoc_body [0, 24] - [2, 16])
    heredoc_end [2, 0] - [2, 16])
@aibaars
Copy link
Contributor Author

aibaars commented Dec 16, 2020

@maxbrunsfeld

@patrickt
Copy link
Contributor

How on earth is Ruby so dang complicated? 😭🥴

@aibaars
Copy link
Contributor Author

aibaars commented Dec 16, 2020

@patrickt You think this is complicated, what about this other one ;-) #148

@amaanq amaanq closed this as completed May 5, 2024
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

No branches or pull requests

3 participants