Skip to content
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

Switch from returning null to throwing IncompleteExpressionException #15

Open
TysonAndre opened this issue Sep 21, 2017 · 1 comment
Open

Comments

@TysonAndre
Copy link
Owner

If PHP code is syntactically invalid, this currently returns null.
Parent nodes may or may not be able to handle that, leading to uncaught Error/Exception or callers getting invalid parse trees

Ideally the returned results would be identical to the parse tree for some other syntactically valid code.
Catch this exception at the level of statements in statement lists, or possibly earlier (e.g. convert $a + to $a, [$a, to [$a]

Same as TysonAndre/tolerant-php-parser-to-php-ast#3

@TysonAndre
Copy link
Owner Author

Implemented, chose the name of IncompleteNodeExpression instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant