-
Notifications
You must be signed in to change notification settings - Fork 72
Handle the ::class static keyword as a special case in parser/variable.js #1138
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue comes from the way PHP understands identifier https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L325
From a certain version, identifiers are composed also by reserved and semi reserved keywords :
https://github.com/glayzzle/php-parser/blob/main/src/parser/variable.js#L161
Here an example on how it's handled from php 7.0 :
php-parser/src/parser/class.js
Line 584 in 80eb946
Handle T_Class as a special case when it comes after T_DOUBLE_COLON in recursive_variable_chain_scan
This solves #1135