
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/