[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode a9d0e941df 066/212: Started on SDT for static
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode a9d0e941df 066/212: Started on SDT for static variables statement |
Date: |
Wed, 26 Jan 2022 01:50:48 -0500 (EST) |
branch: externals/phps-mode
commit a9d0e941dfda7431c66d5daa49f2bab1a0ed1fc3
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Started on SDT for static variables statement
---
phps-mode-ast-bookkeeping.el | 21 +++++++++++++++
phps-mode-parser-sdt.el | 61 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index f372160d7e..77f853866c 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -282,6 +282,27 @@
defined-p
bookkeeping)))
+ ((equal type 'static-variables-statement)
+ (when-let ((variables (reverse (plist-get item 'static-var-list))))
+ (dolist (variable variables)
+ (let ((ids
+
(phps-mode-ast-bookkeeping--generate-variable-scope-string
+ scope
+ (plist-get variable 'name)))
+ (object
+ (list
+ (plist-get variable 'start)
+ (plist-get variable 'end))))
+ (dolist (id ids)
+ (puthash
+ id
+ 1
+ bookkeeping))
+ (puthash
+ object
+ 1
+ bookkeeping)))))
+
((equal type 'function)
(let ((name (plist-get item 'name))
(sub-scope scope))
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index bb651cf501..1919616bb2 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -181,6 +181,17 @@
ast-object))
phps-mode-parser--table-translations)
+;; statement -> (T_STATIC static_var_list ";")
+(puthash
+ 151
+ (lambda(args _terminals)
+ `(
+ ast-type
+ static-variables-statement
+ static-var-list
+ ,(nth 1 args)))
+ phps-mode-parser--table-translations)
+
;; statement -> (T_ECHO echo_expr_list ";")
(puthash
152
@@ -489,6 +500,56 @@
(nth 1 args))
phps-mode-parser--table-translations)
+;; static_var_list -> (static_var_list "," static_var)
+(puthash
+ 272
+ (lambda(args _terminals)
+ (append (nth 0 args) (list (nth 2 args))))
+ phps-mode-parser--table-translations)
+
+;; static_var_list -> (static_var)
+(puthash
+ 273
+ (lambda(args _terminals)
+ (list args))
+ phps-mode-parser--table-translations)
+
+;; static_var -> (T_VARIABLE)
+(puthash
+ 274
+ (lambda(args terminals)
+ `(
+ ast-type
+ variable
+ name
+ ,(nth 0 args)
+ index
+ ,(car (cdr (nth 0 terminals)))
+ start
+ ,(car (cdr (nth 0 terminals)))
+ end
+ ,(cdr (cdr (nth 0 terminals)))))
+ phps-mode-parser--table-translations)
+
+;; static_var -> (T_VARIABLE "=" expr)
+(puthash
+ 275
+ (lambda(args terminals)
+ `(
+ ast-type
+ variable
+ name
+ ,(nth 0 args)
+ expr
+ ,(nth 2 args)
+ index
+ ,(car (cdr (nth 0 terminals)))
+ start
+ ,(car (cdr (nth 0 terminals)))
+ end
+ ,(cdr (cdr (nth 0 terminals)))))
+ phps-mode-parser--table-translations)
+
;; class_statement_list -> (class_statement_list class_statement)
(puthash
276
- [elpa] externals/phps-mode a629baba89 053/212: More work on bookkeeping via AST for arrow function variables, (continued)
- [elpa] externals/phps-mode a629baba89 053/212: More work on bookkeeping via AST for arrow function variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode df0b707a61 044/212: Added parser SDT for inline-function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 432382eddb 051/212: Added bookkeeping support for global variables in functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode bb381d8127 041/212: Bookkeeping of class properties via AST passed test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e95df1027b 042/212: Reverted old tests for imenu and bookkeeping for lex-analyzer, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a65c8af308 008/212: Extract ast code into separate file and test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 23c001c33f 037/212: Moved parser SDT to separate file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 261121f096 056/212: Fixed incorrect information in debug output in test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e8a47de694 052/212: Work on supported arrow functions for bookkeeping via AST, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5686703a6b 074/212: Passing bookkeeping via AST for $this inside arrow function body inside class method, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a9d0e941df 066/212: Started on SDT for static variables statement,
Christian Johansson <=
- [elpa] externals/phps-mode a8fecdfd68 055/212: Bookkeeping of variables inside arrow functions now working, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e42646dc3a 058/212: Added SDT for isset() and empty(), Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 9ad46d061e 057/212: Bookkeeping via AST passing two more tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 806bb902b3 122/212: Improved indentation for chaining objects, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode cc3bf03786 123/212: Improved indentation after ending assignment expression, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3162dca5c4 159/212: Added two more failing indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1e44021653 163/212: Added more failing indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e7aff3f69d 157/212: Passed more indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode db7121941c 156/212: Passing indention on line after not equals condition, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d072fe5315 136/212: Improved indentation around array elements, Christian Johansson, 2022/01/26