Project

General

Profile

Actions

Bug #20784

open

`?\` followed by EOF is parsed wrong

Added by tompng (tomoya ishida) 2 days ago. Updated 2 days ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby -v: ruby 3.4.0dev (2024-10-05T02:36:21Z master e939f28cc9) +YJIT +MN +PRISM [arm64-darwin22]
[ruby-core:119460]

Description

?\ at EOF should be syntax error

% printf "p ?\\" | ruby --parser=parse.y
[nothing shown]

% printf "1 in a ?\\" | ruby --parser=parse.y -c
Syntax OK

With --parser=prism, ?\ at EOF is parsed as empty string, reported in https://github.com/ruby/prism/issues/3144

Actions

Also available in: Atom PDF

Like0
Like0