Project

General

Profile

Actions

Bug #20784

closed

`?\` followed by EOF is parsed wrong

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

Status:
Closed
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
Like0Like0