Project

General

Profile

Actions

Bug #19736

closed

Ripper.tokenize ignores token after heredoc_beg when embexpr inside heredoc is unclosed

Added by tompng (tomoya ishida) 11 months ago. Updated 11 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-06-19T09:28:10Z master 2a80bac9f0) [x86_64-linux]
[ruby-core:113938]

Description

I expect Ripper.tokenize(code) to tokenize +1+2+3\n part.

code = <<'RUBY'
<<A+1+2+3
#{4
RUBY
Ripper.tokenize code
# => ["<<A", "\#{", "4", "\n"]

It will be easy for IRB's internal code to handle indent and other things if Ripper.tokenize can tokenize all part of the code even if it is incomplete.

Actions

Also available in: Atom PDF

Like1
Like0