Actions
Bug #21946
closed`and?` predicate confused for leading `and` keyword
Bug #21946:
`and?` predicate confused for leading `and` keyword
Description
Originally reported at https://github.com/ruby/prism/pull/3337#issuecomment-4004880188
$ 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
Actions