parser
parser copied to clipboard
Quasi nested heredoc accepted by parser and rejected by ruby.
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.