Project

General

Profile

Actions

Bug #18963

closed

Ripper.tokenize(code).join != code when heredoc and multiline string is on the same line

Added by tompng (tomoya ishida) almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]
[ruby-core:109476]

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.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #20521: Memory leak in Ripper parsingClosedActions
Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 2 years ago

  • Status changed from Open to Closed

Applied in changeset git|ace2eee544378eb03ea95b95c89434508325e8c8.


[Bug #18963] Separate string contents by here document terminator

Actions #2

Updated by nobu (Nobuyoshi Nakada) 25 days ago

  • Related to Bug #20521: Memory leak in Ripper parsing added
Actions

Also available in: Atom PDF

Like0
Like0Like0