From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2026-03-16T19:24:53+00:00 Subject: [ruby-core:125023] [Ruby Bug#21946] `and?` predicate confused for leading `and` keyword Issue #21946 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: REQUIRED to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: DONE ruby_4_0 commit:83c261f30bd43dc3465c0026b96e79af585fdfab. ---------------------------------------- Bug #21946: `and?` predicate confused for leading `and` keyword https://bugs.ruby-lang.org/issues/21946#change-116720 * Author: Earlopain (Earlopain _) * Status: Closed * Assignee: prism * ruby -v: ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [x86_64-linux] * Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED, 4.0: DONE ---------------------------------------- Originally reported at https://github.com/ruby/prism/pull/3337#issuecomment-4004880188 ```sh $ ruby -ce $'foo\nand?' ruby: -e:2: syntax errors found (SyntaxError) 1 | foo > 2 | and? | ^ expected an expression after `?` in the ternary operator | ^ unexpected '?'; expected an expression after the operator | ^ unexpected end-of-input, assuming it is closing the parent ternary expression ``` Same for `and!` and `or` . parse.y is not impacted Fix in https://github.com/ruby/prism/pull/3966 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/