Actions
Bug #18080
openSyntax error on one-line pattern matching
Description
One line pattern matching with a method return value with parameters which are not surrounded by parenthesis raises syntax error.
I think it is not intentional, but nobu said it's hard to support because of parse.y limitation.
p do
end => a
p a #=> nil
p(1) do
end => a
p a #=> 1
p 1 do
end => a
#=>
# syntax error, unexpected =>, expecting end-of-input
# end => a
# ^~
p 1 do
end in a
#=>
# syntax error, unexpected `in', expecting end-of-input
# end in a
# ^~
Actions
Like0
Like0