-
Notifications
You must be signed in to change notification settings - Fork 21
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
PHP tags in comments should not be ignored #50
Comments
Laravel's Blade compiler splits source file into tokens using token-get-all, and only performing replacements to tokens that are not PHP code. If there is PHP code between Blade tags, that will invalidate the tags and we should not highlight them. This behavior requires some sort of lookahead, which TM grammars cannot do. We can however mark the code invalid inside comment tags, to warn the user. I am slightly starting to doubt why does Laravel need to use Zend's exponential-at-worst* parser to split a string at * Educated guess, not a guaranteed claim |
An update on this: |
This remains unfixable but there's an intermediary solution where we highlight PHP tags in comments with an |
Final decision, because of no way to backtrack (or lookahead with by covering all possible edge cases), we'll consume comments as usual and just highlight PHP code in it differently to warn the user. |
PHP tags take precedence over comments.
{{--<?php echo $this->anchor; ?>--}}
Gets highlighted in some themes, but probably not in an intended way.
The text was updated successfully, but these errors were encountered: