Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring some improvements to PHP lexer:
* translation of PHP's lexer into rouge * add lexer option short_open_tag to permit highlighting as if short_open_tag were off when disabled (enabled by default) * add some missing features: + binary numbers (introduced by PHP 5.4.0) + string interpolation in backquoted strings + Unicode codepoints escape syntax (\u{...}) (introduced by PHP 7.0.0) * stricter syntax: + <?php is case insensitive + a "blank" have to follow <?php (but not <?= nor <?) + for doc comments, /** is followed by at least one whitespace + keywords are case insensitive + function/method names are also case insensitive * add some missing keywords: + type declarations (PHP 7, including void planned for 7.1.0 - master) + 7.0.0: class (anonymous classes), yield from + 5.5.0: finally + 5.4.0: callable, insteadof, trait, __TRAIT__ + 5.3.0: goto, __NAMESPACE__, __DIR__ + function, const added to keywords (can't manage them with a rule anymore, it conflicts with use - eg: use constant \A\B\C; as introduced by PHP 5.6.0) + others: casts, instanceof, __CLASS__, __FUNCTION__, __METHOD__, __halt_compiler + self even if it's not really a reserved word * cleanup in keywords, removal of: + predefined constants (eg: E_ERROR or PHP_OS) - which, bsesides, are case sensitive + predefined classes (as stdclass)
- Loading branch information