-
Notifications
You must be signed in to change notification settings - Fork 72
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
Invalid start location for class constants / properties #511
Comments
The same thing happens with class properties: <?php
class A
{
public $test = 1;
} AST:
|
Yes, it is old issues 😞 |
Maybe related to #208 ? |
Yes, i try to keep all in the one PR, but it's just my preference |
Doesn't matter as long as we get it fixed 😉 |
for const the fix is easy, but for properties / functions it's more complicated as the final / abstract / private / protected / public tokens may be eaten before creating the function or property node - one solution would be to use swapLocations on the generated and store on flags the parser position before eating modifiers tokens |
Hi @evilebottnawi, it would be great if you have some time that you keep working on branch #fix-issue-511 as the fix is not fully implemented. Remains to check interfaces, traits, use alias on traits, but the principle remains the same as in the last commit |
Input:
AST (excerpt):
I think the start column of the class constant is off, it should be around 4 instead of 10 in the example.
The text was updated successfully, but these errors were encountered: