You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SyntaxError occurs when a value omitted hash key ends with ! or ?:
$ ruby -vce '{foo!:}'ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]-e:1: identifier foo! is not valid to get-e: compile error (SyntaxError)
$ ruby -vce '{foo?:}'ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-darwin22]-e:1: identifier foo? is not valid to get-e: compile error (SyntaxError)
Actual
It is parsed as valid syntax when using Prism:
$ ruby --parser=prism -vce '{foo!:}'ruby: warning: The compiler based on the Prism parser is currently experimental and compatibility with the compiler based on parse.y is not yet complete. Please report any issues you find on the `ruby/prism` issue tracker.ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +PRISM [x86_64-darwin22]Syntax OK
$ ruby --parser=prism -vce '{foo?:}'ruby: warning: The compiler based on the Prism parser is currently experimental and compatibility with the compiler based on parse.y is not yet complete. Please report any issues you find on the `ruby/prism` issue tracker.ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +PRISM [x86_64-darwin22]Syntax OK
Excepted
SyntaxError
occurs when a value omitted hash key ends with!
or?
:Actual
It is parsed as valid syntax when using Prism:
Refer: ruby/spec#1148
The text was updated successfully, but these errors were encountered: