Actions
Bug #18963
closedRipper.tokenize(code).join != code when heredoc and multiline string is on the same line
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]
Description
Expect Ripper.tokenize(code).join to match the original code but it doesn't.
code = %[
<<A + "hello
A
world"
]
eval code # => "ruby\nhello\nworld"
code == Ripper.tokenize(code).join # => false
eval Ripper.tokenize(code).join # => Syntax Error
Other codes that does not match.
"<<A;/a\nA\nb/"
"<<A;:'a\nA\nb'"
"<<A;%[a\nA\nb]"
IRB fails coloring those codes.
Actions
Like0
Like0Like0