emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/phps-mode 585bc28fa5 01/17: Added T_ENUM and T_READONLY


From: Christian Johansson
Subject: [elpa] externals/phps-mode 585bc28fa5 01/17: Added T_ENUM and T_READONLY
Date: Tue, 26 Jul 2022 08:44:18 -0400 (EDT)

branch: externals/phps-mode
commit 585bc28fa5df30f6402fd3017eedb2edcd1266b2
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]