-
Notifications
You must be signed in to change notification settings - Fork 82
Issue 178 - Declare Statement Directive List #333
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
|
Hi - tolerant-php-parser is used by a lot of projects, and previous PRs have attempted to ensure that those versions would work even after an upgrade from 0.0.x to 0.0.(x+1). - https://github.com/microsoft/tolerant-php-parser/network/dependents?package_id=UGFja2FnZS01NDI3MTMyOTI%3D For example, if those projects expected $declareStatement->declareDirective to exist (e.g. to check for strict_types), they would encounter notices or misbehave on files that previously worked. In previous commits, e.g. to support union types, catch class lists, etc, the original datatype of the first list element was preserved, and a new property such as $otherDeclareDirectives was added to the properties (and class constant) that was the list of the remaining values. (and a TODO was added to unify them in the next major release) |
|
Thanks for the clarification! Makes total sense. I will have a look at these examples. |
|
Alright, I made a quick fix to address the backwards compatibility of the changes and updated the existing tests accordingly. Let me know what you think :) |
roblourens
left a comment
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.
Sorry for being slow to look at this. Looks good to me, thank you for the PR!
Summary
This PR adds support for declare directive lists (backwards compatible). Closes #178.
Adds a valid parse tree for:
Additional Questions
,:Unexpected ','. Expected ')'.