-
Notifications
You must be signed in to change notification settings - Fork 79
Support __halt_compiler
as a member of the top level statements
#381
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
Comments
TysonAndre
added a commit
to TysonAndre/tolerant-php-parser
that referenced
this issue
Aug 27, 2022
https://www.php.net/manual/en/function.halt-compiler.php can be used to embed data in php scripts from the outermost scope. In inner scope, it is parsed in php-src only for the sake of error messages about it needing to be in the outermost scope, so treat it as an unexpected token in other contexts. Closes microsoft#381
TysonAndre
added a commit
to TysonAndre/tolerant-php-parser
that referenced
this issue
Aug 27, 2022
https://www.php.net/manual/en/function.halt-compiler.php can be used to embed data in php scripts from the outermost scope. In inner scope, it is parsed in php-src only for the sake of error messages about it needing to be in the outermost scope, so treat it as an unexpected token in other contexts. (In an inner `{...}` scope, the call to `token_get_all()` will still stop after `__halt_compiler();`, returning T_INLINE_HTML, so the remaining statements can't be parsed, anyway) Additionally, `__halt_compiler` can't be used as a name, a member name (e.g. method name), etc, so calling it `TokenKind::Name` seems incorrect. (`__COMPILER_HALT_OFFSET__` is already properly a Name) Closes microsoft#381
TysonAndre
added a commit
to TysonAndre/tolerant-php-parser
that referenced
this issue
Sep 25, 2022
Make it easier to calculate `__COMPILER_HALT_OFFSET__`. Related to microsoft#381
TysonAndre
added a commit
to TysonAndre/tolerant-php-parser
that referenced
this issue
Sep 25, 2022
Make it easier to calculate `__COMPILER_HALT_OFFSET__`. Related to microsoft#381
TysonAndre
added a commit
to TysonAndre/tolerant-php-parser
that referenced
this issue
Sep 25, 2022
Make it easier to calculate `__COMPILER_HALT_OFFSET__`. Related to microsoft#381 Address other edge cases
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would allow validation test suites to pass again
data
if it was parsed in an inner statement.The text was updated successfully, but these errors were encountered: