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

Escaped newlines in single-quoted heredocs #950

Open
kddnewton opened this issue Oct 17, 2023 · 0 comments
Open

Escaped newlines in single-quoted heredocs #950

kddnewton opened this issue Oct 17, 2023 · 0 comments
Labels

Comments

@kddnewton
Copy link

In the following snippet:

<<~'FOO'
  baz\\
  qux
FOO

For Ruby you will get:

$ ruby --dump=insns test/tmp/test.rb
== disasm: #<ISeq:<main>@test/tmp/test.rb:1 (1,0)-(1,8)> (catch: false)
0000 putstring                              "baz\\\\\nqux\n"          (   1)[Li]
0002 leave

but for parser you get:

$ bin/ruby-parse test/tmp/test.rb
(dstr
  (str "baz\\\n")
  (str "qux\n"))
@iliabylich iliabylich added the bug label Oct 17, 2023
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