Project

General

Profile

Actions

Bug #19291

closed

Ripper's on_parse_error token has wrong content

Added by tompng (tomoya ishida) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin20]
[ruby-core:111556]

Description

Ruby 3.1

Ripper::Lexer.new("{a:,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nhelloworld").scan.map(&:tok)
# =>
["{", "a:", ",", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "", "\n", "helloworld"]

Ruby 3.2.0

Ripper::Lexer.new("{a:,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\nhelloworld").scan.map(&:tok)
# => 
["{",
 "a:",
 ",",
 "oworld\u0000\u0000\u0000\u0000\u0000\u0000z`\u0001\u0000\u0000\u0000\u0000\u0000\xC0\xF0$\u0010\u0001\u0000\u0000\u0000\x80A\xB8\u0019\xB5\u007F\u0000\u0000\x91\x94",
 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
 "\n",
 "helloworld"]
Actions

Also available in: Atom PDF

Like0
Like0Like0