-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs, and better support v7.4.0 features, in PHP lexer (#1397)
This commit adds a number of fixes to the PHP lexer to both fix outstanding issues and to add support for features introduced in versions of PHP up to 7.4.0. In particular, this commit: - makes the following terms match case-insensitively: `<?php`, `as`, `use`, the strings in `@keywords` and the strings in `@builtins`; - fixes an issue with heredoc syntax where `"` around the starting label would lex incorrectly; - adds support for: - binary numbers; - use of `_` as a separator in numbers; - `yield from` keyword; - Unicode codepoint escape syntax; and - partial type hinting; - adds the following words to `@keywords`: `__CLASS__`, `__DIR__`, `__FUNCTION__`, `__halt_compiler`, `__METHOD__`, `__NAMESPACE__`, `__TRAIT__`, `callable`, `class`, `fn`, `goto`, `instanceof`, `insteadof`, `self`, `trait`; - removes the following words from `@keywords`: `__sleep`, `__wakeup`, `empty`, `php_user_filter`, `stdClass`, `this`, `virtual`; and - simplifies rules for `E_*` and `PHP_*` constants.
- Loading branch information
Showing
3 changed files
with
69 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters