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

Quasi nested heredoc accepted by parser and rejected by ruby. #744

Open
mbj opened this issue Sep 24, 2020 · 0 comments
Open

Quasi nested heredoc accepted by parser and rejected by ruby. #744

mbj opened this issue Sep 24, 2020 · 0 comments
Labels

Comments

@mbj
Copy link
Collaborator

mbj commented Sep 24, 2020

On parser-2.7.1.5 the following is accepted:

<<~FOO
  #{<<~BAR}
FOO
BAR

This is accepted with AST:

(begin
  (dstr
    (str "")
    (begin
      (str "FOO\n"))
    (str "\n"))
  (const nil :BAR))

And IMO rightfully rejected by ruby-2.7.1:

y.rb:1: can't find string "FOO" anywhere before EOF

I think parser should subset what ruby accepts, but never accept a superset.

@mbj mbj added the bug label Sep 24, 2020
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

1 participant