branch: externals/phps-mode commit 585bc28fa5df30f6402fd3017eedb2edcd1266b2 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Added T_ENUM and T_READONLY --- phps-mode-lexer.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el index 8daae5d1b8..679ef90256 100644 --- a/phps-mode-lexer.el +++ b/phps-mode-lexer.el @@ -705,6 +705,12 @@ (looking-at "trait") (phps-mode-lexer--return-token-with-indent 'T_TRAIT)) + (phps-mode-lexer--match-macro + ST_IN_SCRIPTING + (looking-at (concat "enum" phps-mode-lexer--whitespace "[a-zA-Z_\x80-\xff]")) + (phps-mode-lexer--yyless 4) + (phps-mode-lexer--return-token-with-indent 'T_ENUM)) + (phps-mode-lexer--match-macro ST_IN_SCRIPTING (looking-at "extends") @@ -971,6 +977,19 @@ (looking-at "public") (phps-mode-lexer--return-token-with-indent 'T_PUBLIC)) + (phps-mode-lexer--match-macro + ST_IN_SCRIPTING + (looking-at "readonly") + (phps-mode-lexer--return-token-with-indent 'T_READONLY)) + + ;; Don't treat "readonly(" as a keyword, to allow using it as a function name. + (phps-mode-lexer--match-macro + ST_IN_SCRIPTING + (looking-at (concat "readonly" "[ \n\r\t]*(")) + (phps-mode-lexer--yyless (length "readonly")) + (phps-mode-lexer--return-token-with-indent 'T_READONLY)) + ;; TODO Was here + (phps-mode-lexer--match-macro ST_IN_SCRIPTING (looking-at "unset")