Incorrect print precedence
nikic opened this issue · 4 comments
print should be between and and yield, currently it's spec'd as taking an arbitrary expression. https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#grammar-print-intrinsic
yield from also has incorrect precedence.
Also the yield precedence is not correctly specified, in particular regarding the interaction with arrays, that is [yield "foo" => "bar"], which is [(yield "foo" => "bar")] rather than [(yield "foo") => "bar"].
Precedence fixed for by-ref assign (1058a50), yield from (b0dadd5) and print (63d72a6).
The issue with the yield vs array literal precedence remains, and I'm not sure if there's any reasonable way to specify that in grammar. I didn't manage to get this to work without precedence annotations in the parser.