Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect print precedence #208

Closed
nikic opened this issue Sep 19, 2017 · 4 comments
Closed

Incorrect print precedence #208

nikic opened this issue Sep 19, 2017 · 4 comments

Comments

@nikic
Copy link
Member

nikic commented Sep 19, 2017

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

@nikic
Copy link
Member Author

nikic commented Sep 19, 2017

yield from also has incorrect precedence.

@nikic
Copy link
Member Author

nikic commented Sep 19, 2017

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"].

@nikic
Copy link
Member Author

nikic commented Mar 15, 2019

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.

@nikic
Copy link
Member Author

nikic commented Mar 15, 2019

Opened #235 for the yield issue, closing this one.

@nikic nikic closed this as completed Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant