Project

General

Profile

Actions

Bug #21186

closed

Inconsistent parsing of ?あand 0

Added by qnighy (Masaki Hara) 16 days ago. Updated 3 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.5.0dev (2025-03-16T03:09:18Z master 06919949a6) +PRISM [x86_64-linux]
[ruby-core:121376]

Description

?あand 0 has inconsistent behavior between Prism and parse.y.

% ./miniruby --parser=parse.y -e "?aand 0"
-e:1: syntax error, unexpected '?'
?aand 0
./miniruby: compile error (SyntaxError)

% ./miniruby --parser=parse.y -e "?あand 0"

% ./miniruby --parser=prism -e "?aand 0"
-e: -e:1: syntax error found (SyntaxError)
> 1 | ?aand 0
    | ^ unexpected '?', ignoring it


% ./miniruby --parser=prism -e "?あand 0"
-e: -e:1: syntax error found (SyntaxError)
> 1 | ?あand 0
    | ^ unexpected '?', ignoring it

% ./miniruby --parser=parse.y -e "?\caand 0"

% ./miniruby --parser=prism -e "?\caand 0"

parse.y Prism
?aand 0 x x
?あand 0 x
?\caand 0

Updated by qnighy (Masaki Hara) 16 days ago

  • Description updated (diff)

Added comparison with escaped chars

Actions #2

Updated by nobu (Nobuyoshi Nakada) 14 days ago

  • Status changed from Open to Closed

Applied in changeset git|1acfb29015dbc38fd345d8786aa78aad59f7dcd1.


[Bug #21186] multibyte char literal should be a single letter word

Actions #3

Updated by nobu (Nobuyoshi Nakada) 14 days ago

  • Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED

Updated by alanwu (Alan Wu) 4 days ago

  • Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED to 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED, 3.4: DONE

Updated by nagachika (Tomoyuki Chikanaga) 3 days ago

  • Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED, 3.4: DONE to 3.1: REQUIRED, 3.2: REQUIRED, 3.3: DONE, 3.4: DONE
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0