-
Notifications
You must be signed in to change notification settings - Fork 0
Fixes to enable this fork to work with Phactor #15
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
| return $this->parseNumericLiteralExpression($parentNode); | ||
|
|
||
| case TokenKind::StringLiteralToken: | ||
| case TokenKind::EncapsedAndWhitespace: |
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.
will parse StringLiteral if the offset is on an unterminated string quote (otherwise it resolves SourceFileNode)
|
I am ok bumping the minimum version to 8.1. Go ahead and do that. I had been meaning to clean up the test suite stuff, but didn't get around to it. |
|
I found and fixed the test failures! The issue was with the property hook check added in The fix is simple - just remove those 4 lines since property hooks are already properly handled in See my commit here: af0df06 With this fix, the test suite goes from 26 failures down to 0 (well, technically 1 failure but it passes when I run ParserGrammarTest directly - might be a flaky test). Feel free to incorporate this change into your PR! |
1b17487 to
04145b1
Compare
|
@rlerdorf thanks - that commit actually fixes this: (the open brace after the default value of the property hook). Without that commit the AST is corrupted. I guess we should add a test case for that here and ensure that both work. |
|
@dantleech How about this then? |
As with ArrowFunctionExpression and AnonymousFunctionCreationExpressino etc.
04145b1 to
876ec3b
Compare
|
@rlerdorf looks good, Phactor tests are green. |
Following conversations with @SerheyDolgushev we decided that it doesn't make sense to maintain independent forks of the Tolerant PHP Parser. I had updated my fork support most of the PHP features that people complained about as missing - all of those seem to be covered in this fork with the exception of property hook default values.
Minimal changes were required to get this fork to run in Phpactor.
PropertyHookimplement theFunctionLikeinterface (e.g. it inherits the class scope)$foo->bar(') - which is important f.e. in autocompletion.On Phactor's side all of the work was related to updating the code to use
PropertyElementon thePropertyDeclaration: phpactor/phpactor#2946In addition my fork:
So:
the tests are failing and I think the snapshots need to be updated - and perhaps I need to add test cases for the new changes (if I added them originally I didn't include them here).