[ruby-core:121376] [Ruby Bug#21186] Inconsistent parsing of ?あand 0

Issue #21186 has been reported by qnighy (Masaki Hara). ---------------------------------------- Bug #21186: Inconsistent parsing of ?あand 0 https://bugs.ruby-lang.org/issues/21186 * Author: qnighy (Masaki Hara) * Status: Open * ruby -v: ruby 3.5.0dev (2025-03-16T03:09:18Z master 06919949a6) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- `?あand 0` has inconsistent behavior between Prism and parse.y. ```console % ./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
| |parse.y|Prism|
|----------|-------|-----|
|`?aand 0` | x | x |
|`?あand 0`| | x |
--
https://bugs.ruby-lang.org/

Issue #21186 has been updated by qnighy (Masaki Hara). Description updated Added comparison with escaped chars ---------------------------------------- Bug #21186: Inconsistent parsing of ?あand 0 https://bugs.ruby-lang.org/issues/21186#change-112350 * Author: qnighy (Masaki Hara) * Status: Open * ruby -v: ruby 3.5.0dev (2025-03-16T03:09:18Z master 06919949a6) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- `?あand 0` has inconsistent behavior between Prism and parse.y. ```console % ./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` | | | -- https://bugs.ruby-lang.org/

Issue #21186 has been updated by alanwu (Alan Wu). 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 3.4 backport is done. commit:8b491169c32621d4e74324eed08465448dfc54d5 ---------------------------------------- Bug #21186: Inconsistent parsing of ?あand 0 https://bugs.ruby-lang.org/issues/21186#change-112463 * Author: qnighy (Masaki Hara) * Status: Closed * ruby -v: ruby 3.5.0dev (2025-03-16T03:09:18Z master 06919949a6) +PRISM [x86_64-linux] * Backport: 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED, 3.4: DONE ---------------------------------------- `?あand 0` has inconsistent behavior between Prism and parse.y. ```console % ./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` | | | -- https://bugs.ruby-lang.org/

Issue #21186 has been updated by nagachika (Tomoyuki Chikanaga). 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 ruby_3_3 commit:770060f7662698ca74bc28428919a688b8fe06d2 merged revision(s) commit:1acfb29015dbc38fd345d8786aa78aad59f7dcd1. ---------------------------------------- Bug #21186: Inconsistent parsing of ?あand 0 https://bugs.ruby-lang.org/issues/21186#change-112478 * Author: qnighy (Masaki Hara) * Status: Closed * ruby -v: ruby 3.5.0dev (2025-03-16T03:09:18Z master 06919949a6) +PRISM [x86_64-linux] * Backport: 3.1: REQUIRED, 3.2: REQUIRED, 3.3: DONE, 3.4: DONE ---------------------------------------- `?あand 0` has inconsistent behavior between Prism and parse.y. ```console % ./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` | | | -- https://bugs.ruby-lang.org/
participants (3)
-
alanwu (Alan Wu)
-
nagachika (Tomoyuki Chikanaga)
-
qnighy (Masaki Hara)