-
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
[bug] incorrect start location in many nodes #208
Comments
Hi, Any PR is welcome, actually I have a ton of work and I finish late, also a personal project at home, so it's hard to find time to work. A lot of issues can be fixed with simple changes and should not take much time but even 1 hour it's hard to find for me. Here my email : [email protected], email me and we can continue to chat with skype or whatever. For your bug it's simple, here the parsing of the node : https://github.com/glayzzle/php-parser/blob/master/src/parser/loops.js#L17 The Take a look at : php-parser/src/parser/statement.js Line 213 in fd8d0dc
To fix this bug you have to remove the next call from statement.js, and to consume it into the function read_while juste after the php-parser/src/parser/loops.js Line 22 in cf6dcf8
Note the next returns this, so you can write something as : If you pay attention into statement.js, you will see that other keywords may have the bug : case this.tok.T_FOR:
return this.next().read_for();
case this.tok.T_FOREACH:
return this.next().read_foreach();
case this.tok.T_WHILE:
return this.next().read_while();
case this.tok.T_DO:
return this.next().read_do(); We can keep this thread for any question around the code |
My English is very bad 😄 It's better for me to type than talk, sorry. |
I'll try to explain how you can fix bugs when it's simple. Your help is much appreciated ! |
this bug was fixed & released |
@ichiriac let's left it open because not all nodes was fixed |
/cc @ichiriac find problem with
The |
any updates ?, 4 years and still no fix 😢 |
Input:
Currently
while
node starts withtest
node location, but should be start withwhile
keyword. Same for other control structures. It would be great if you show how to fix such things (send a PR with fix) and i will start fix it self and send new PRs. This would speed up problem solving.The text was updated successfully, but these errors were encountered: