[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 5b1f5b4774 079/212: Improved format of SDT
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 5b1f5b4774 079/212: Improved format of SDT |
Date: |
Wed, 26 Jan 2022 01:50:57 -0500 (EST) |
branch: externals/phps-mode
commit 5b1f5b477454d319a8f8e56939ad71eece033271
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Improved format of SDT
---
phps-mode-parser-sdt.el | 1025 ++++++++++++++++++++++-------------------------
1 file changed, 486 insertions(+), 539 deletions(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index f626b34e78..7a292bd198 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -55,67 +55,53 @@
(puthash
79
(lambda(args _terminals)
- ;; (message "top_statement_list: %S" args)
- (let ((ast-object))
- (if (car args)
- (setq ast-object (append (car args) (cdr args)))
- (setq ast-object (cdr args)))
- ;; (message "ast-object: %S" ast-object)
- ast-object))
+ (if (car args)
+ (append (car args) (cdr args))
+ (cdr args)))
phps-mode-parser--table-translations)
;; top_statement -> (T_NAMESPACE namespace_declaration_name ";")
(puthash
106
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'namespace
- 'name
- (nth 1 args)
- 'index
- (car (cdr (nth 1 terminals)))
- 'start
- (car (cdr (nth 2 terminals)))
- 'end
- 'max)))
- ;; (message "Namespace %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ast-object))
+ `(
+ ast-type
+ namespace
+ name
+ ,(nth 1 args)
+ index
+ ,(car (cdr (nth 1 terminals)))
+ start
+ ,(car (cdr (nth 2 terminals)))
+ end
+ max
+ ))
phps-mode-parser--table-translations)
;; top_statement -> (T_NAMESPACE namespace_declaration_name "{"
top_statement_list "}")
(puthash
107
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'namespace
- 'name
- (nth 1 args)
- 'index
- (car (cdr (nth 1 terminals)))
- 'start
- (car (cdr (nth 2 terminals)))
- 'end
- (car (cdr (nth 4 terminals)))
- 'children
- (nth 3 args))))
- ;; (message "Namespace %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ;; (message "ast-object: %S" ast-object)
- ast-object))
+ `(
+ ast-type
+ namespace
+ name
+ ,(nth 1 args)
+ index
+ ,(car (cdr (nth 1 terminals)))
+ start
+ ,(car (cdr (nth 2 terminals)))
+ end
+ ,(car (cdr (nth 4 terminals)))
+ children
+ ,(nth 3 args)
+ ))
phps-mode-parser--table-translations)
;; top_statement -> (T_NAMESPACE "{" top_statement_list "}")
(puthash
108
(lambda(args _terminals)
- ;; (message "T_NAMESPACE: %S" args)
(nth 2 args))
phps-mode-parser--table-translations)
@@ -123,13 +109,9 @@
(puthash
134
(lambda(args _terminals)
- ;; (message "inner_statement_list: %S" args)
- (let ((ast-object))
- (if (car args)
- (setq ast-object (append (car args) (cdr args)))
- (setq ast-object (cdr args)))
- ;; (message "ast-object: %S" ast-object)
- ast-object))
+ (if (car args)
+ (append (car args) (cdr args))
+ (cdr args)))
phps-mode-parser--table-translations)
;; statement -> ("{" inner_statement_list "}")
@@ -143,72 +125,70 @@
(puthash
143
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'while
- 'condition
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args)))))
- ast-object))
+ `(
+ ast-type
+ while
+ condition
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 4 args)))
+ )
phps-mode-parser--table-translations)
;; statement -> (T_DO statement T_WHILE "(" expr ")" ";")
(puthash
144
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'do-while
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 1 args))
- 'condition
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args)))))
- ast-object))
+ `(
+ ast-type
+ do-while
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))
+ condition
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ ))
phps-mode-parser--table-translations)
;; statement -> (T_FOR "(" for_exprs ";" for_exprs ";" for_exprs ")"
for_statement)
(puthash
145
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'for
- 'initial
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'test
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args))
- 'incremental
- (phps-mode-parser-sdt--get-list-of-object (nth 6 args))
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 8 args)))))
- ast-object))
+ `(
+ ast-type
+ for
+ initial
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ test
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ incremental
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 6 args))
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 8 args))
+ ))
phps-mode-parser--table-translations)
;; statement -> (T_RETURN optional_expr ";")
(puthash
149
(lambda(args _terminals)
- `(ast-type
+ `(
+ ast-type
return-statement
optional-expr
- ,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))))
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))
+ ))
phps-mode-parser--table-translations)
;; statement -> (T_GLOBAL global_var_list ";")
(puthash
150
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'global-statement
- 'global-var-list
- (phps-mode-parser-sdt--get-list-of-object (nth 1 args)))))
- ast-object))
+ `(
+ ast-type
+ global-statement
+ global-var-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))
+ ))
phps-mode-parser--table-translations)
;; statement -> (T_STATIC static_var_list ";")
@@ -219,20 +199,20 @@
ast-type
static-variables-statement
static-var-list
- ,(nth 1 args)))
+ ,(nth 1 args)
+ ))
phps-mode-parser--table-translations)
;; statement -> (T_ECHO echo_expr_list ";")
(puthash
152
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'echo-statement
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 1 args)))))
- ast-object))
+ `(
+ ast-type
+ echo-statement
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))
+ ))
phps-mode-parser--table-translations)
;; statement -> (expr ";")
@@ -246,158 +226,142 @@
(puthash
156
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'foreach
- 'expression
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'value
- (nth 4 args)
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 6 args)))))
- ast-object))
+ `(
+ ast-type
+ foreach
+ expression
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ value
+ ,(nth 4 args)
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 6 args))
+ ))
phps-mode-parser--table-translations)
;; 157: statement -> (T_FOREACH "(" expr T_AS foreach_variable T_DOUBLE_ARROW
foreach_variable ")" foreach_statement)
(puthash
157
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'foreach
- 'expression
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'key
- (nth 4 args)
- 'value
- (nth 6 args)
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 8 args)))))
- ast-object))
+ `(
+ ast-type
+ foreach
+ expression
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ key
+ ,(nth 4 args)
+ value
+ ,(nth 6 args)
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 8 args))
+ ))
phps-mode-parser--table-translations)
;; statement -> (T_TRY "{" inner_statement_list "}" catch_list
finally_statement)
(puthash
160
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'try
- 'inner-statement-list
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'catch-list
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args))
- 'finally-statement
- (nth 5 args))))
- ast-object))
+ `(
+ ast-type
+ try
+ inner-statement-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ catch-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ finally-statement
+ ,(nth 5 args)
+ ))
phps-mode-parser--table-translations)
;; catch_list -> (catch_list T_CATCH "(" catch_name_list optional_variable ")"
"{" inner_statement_list "}")
(puthash
164
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'catch
- 'catch-name-list
- (phps-mode-parser-sdt--get-list-of-object (nth 3 args))
- 'optional-variable
- (nth 4 args)
- 'optional-variable-start
- (car (cdr (nth 4 terminals)))
- 'optional-variable-end
- (cdr (cdr (nth 4 terminals)))
- 'children
- (nth 7 args))))
- ast-object))
+ `(
+ ast-type
+ catch
+ catch-name-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 3 args))
+ optional-variable
+ ,(nth 4 args)
+ optional-variable-start
+ ,(car (cdr (nth 4 terminals)))
+ optional-variable-end
+ ,(cdr (cdr (nth 4 terminals)))
+ children
+ ,(nth 7 args)
+ ))
phps-mode-parser--table-translations)
;; function_declaration_statement -> (function returns_ref T_STRING
backup_doc_comment "(" parameter_list ")" return_type backup_fn_flags "{"
inner_statement_list "}" backup_fn_flags)
(puthash
174
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'function
- 'name
- (nth 2 args)
- 'index
- (car (cdr (nth 2 terminals)))
- 'start
- (car (cdr (nth 9 terminals)))
- 'end
- (car (cdr (nth 11 terminals)))
- 'returns-reference-p
- (not (equal (nth 1 args) nil))
- 'parameter-list
- (nth 5 args)
- 'return-type
- (nth 7 args)
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 10 args)))))
- ;; (message "Function: %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ast-object))
+ `(
+ ast-type
+ function
+ name
+ ,(nth 2 args)
+ index
+ ,(car (cdr (nth 2 terminals)))
+ start
+ ,(car (cdr (nth 9 terminals)))
+ end
+ ,(car (cdr (nth 11 terminals)))
+ returns-reference-p
+ ,(not (equal (nth 1 args) nil))
+ parameter-list
+ ,(nth 5 args)
+ return-type
+ ,(nth 7 args)
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 10 args))
+ ))
phps-mode-parser--table-translations)
;; class_declaration_statement -> (T_CLASS T_STRING extends_from
implements_list backup_doc_comment "{" class_statement_list "}")
(puthash
180
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'class
- 'name
- (nth 1 args)
- 'extends
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'implements
- (phps-mode-parser-sdt--get-list-of-object (nth 3 args))
- 'index
- (car (cdr (nth 1 terminals)))
- 'start
- (car (cdr (nth 5 terminals)))
- 'end
- (car (cdr (nth 7 terminals)))
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 6 args)))))
- ;; (message "Class %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ast-object))
+ `(
+ ast-type
+ class
+ name
+ ,(nth 1 args)
+ extends
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ implements
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 3 args))
+ index
+ ,(car (cdr (nth 1 terminals)))
+ start
+ ,(car (cdr (nth 5 terminals)))
+ end
+ ,(car (cdr (nth 7 terminals)))
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 6 args))
+ ))
phps-mode-parser--table-translations)
;; interface_declaration_statement -> (T_INTERFACE T_STRING
interface_extends_list backup_doc_comment "{" class_statement_list "}")
(puthash
186
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'interface
- 'name
- (nth 1 args)
- 'extends
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'index
- (car (cdr (nth 1 terminals)))
- 'start
- (car (cdr (nth 4 terminals)))
- 'end
- (car (cdr (nth 6 terminals)))
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 5 args)))))
- ;; (message "Interface %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ast-object))
+ `(
+ ast-type
+ interface
+ name
+ ,(nth 1 args)
+ extends
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ index
+ ,(car (cdr (nth 1 terminals)))
+ start
+ ,(car (cdr (nth 4 terminals)))
+ end
+ ,(car (cdr (nth 6 terminals)))
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 5 args))
+ ))
phps-mode-parser--table-translations)
;; extends_from -> (%empty)
@@ -419,24 +383,26 @@
(puthash
194
(lambda(args _terminals)
- `(ast-type foreach-referenced-variable variable ,(nth 1 args))
- )
+ `(
+ ast-type
+ foreach-referenced-variable
+ variable
+ ,(nth 1 args)
+ ))
phps-mode-parser--table-translations)
;; if_stmt_without_else -> (T_IF "(" expr ")" statement)
(puthash
223
(lambda(args _terminals)
- ;; (message "if_stmt_without_else: %S" args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'if
- 'condition
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'children
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args)))))
- ast-object))
+ `(
+ ast-type
+ if
+ condition
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ children
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ ))
phps-mode-parser--table-translations)
;; 231: parameter_list -> (non_empty_parameter_list possible_comma)
@@ -464,56 +430,52 @@
(puthash
241
(lambda(args terminals)
- ;; (message "parameter: %S %S" args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'parameter
- 'visibility
- (nth 0 args)
- 'type
- (nth 1 args)
- 'is-reference
- (nth 2 args)
- 'is-variadic
- (nth 3 args)
- 'name
- (nth 4 args)
- 'start
- (car (cdr (nth 4 terminals)))
- 'end
- (cdr (cdr (nth 4 terminals))))))
- ast-object))
+ `(
+ ast-type
+ parameter
+ visibility
+ ,(nth 0 args)
+ type
+ ,(nth 1 args)
+ is-reference
+ ,(nth 2 args)
+ is-variadic
+ ,(nth 3 args)
+ name
+ ,(nth 4 args)
+ start
+ ,(car (cdr (nth 4 terminals)))
+ end
+ ,(cdr (cdr (nth 4 terminals)))
+ ))
phps-mode-parser--table-translations)
;; 242: parameter -> (optional_visibility_modifier
optional_type_without_static is_reference is_variadic T_VARIABLE
backup_doc_comment "=" expr)
(puthash
242
(lambda(args terminals)
- ;; (message "parameter: %S %S" args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'parameter-with-default-value
- 'visibility
- (nth 0 args)
- 'type
- (nth 1 args)
- 'is-reference
- (nth 2 args)
- 'is-variadic
- (nth 3 args)
- 'name
- (nth 4 args)
- 'start
- (car (cdr (nth 4 terminals)))
- 'end
- (cdr (cdr (nth 4 terminals)))
- 'backup-doc-comment
- (nth 5 args)
- 'default-value
- (phps-mode-parser-sdt--get-list-of-object (nth 7 args)))))
- ast-object))
+ `(
+ ast-type
+ parameter-with-default-value
+ visibility
+ ,(nth 0 args)
+ type
+ ,(nth 1 args)
+ is-reference
+ ,(nth 2 args)
+ is-variadic
+ ,(nth 3 args)
+ name
+ ,(nth 4 args)
+ start
+ ,(car (cdr (nth 4 terminals)))
+ end
+ ,(cdr (cdr (nth 4 terminals)))
+ backup-doc-comment
+ ,(nth 5 args)
+ default-value
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 7 args))
+ ))
phps-mode-parser--table-translations)
;; 262: argument_list -> ("(" ")")
@@ -558,7 +520,8 @@
start
,(car (cdr terminals))
end
- ,(cdr (cdr terminals))))
+ ,(cdr (cdr terminals))
+ ))
phps-mode-parser--table-translations)
;; static_var -> (T_VARIABLE "=" expr)
@@ -577,79 +540,71 @@
start
,(car (cdr (nth 0 terminals)))
end
- ,(cdr (cdr (nth 0 terminals)))))
+ ,(cdr (cdr (nth 0 terminals)))
+ ))
phps-mode-parser--table-translations)
;; class_statement_list -> (class_statement_list class_statement)
(puthash
276
(lambda(args _terminals)
- ;; (message "class_statement_list: %S" args)
- (let ((ast-object))
- (if (car args)
- (setq ast-object (append (car args) (cdr args)))
- (setq ast-object (cdr args)))
- ;; (message "ast-object: %S" ast-object)
- ast-object))
+ (if (car args)
+ (append (car args) (cdr args))
+ (cdr args)))
phps-mode-parser--table-translations)
;; attributed_class_statement -> (variable_modifiers
optional_type_without_static property_list ";")
(puthash
278
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'property
- 'modifiers
- (phps-mode-parser-sdt--get-list-of-object (nth 0 args))
- 'type
- (nth 1 args)
- 'subject
- (nth 2 args)
- 'start
- (car (cdr (car (nth 2 terminals))))
- 'end
- (cdr (cdr (car (nth 2 terminals)))))))
- ast-object))
+ `(
+ ast-type
+ property
+ modifiers
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ type
+ ,(nth 1 args)
+ subject
+ ,(nth 2 args)
+ start
+ ,(car (cdr (car (nth 2 terminals))))
+ end
+ ,(cdr (cdr (car (nth 2 terminals))))
+ ))
phps-mode-parser--table-translations)
;; attributed_class_statement -> (method_modifiers function returns_ref
identifier backup_doc_comment "(" parameter_list ")" return_type
backup_fn_flags method_body backup_fn_flags)
(puthash
280
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'method
- 'modifiers
- (phps-mode-parser-sdt--get-list-of-object (nth 0 args))
- 'returns-reference-p
- (not (equal (nth 2 args) nil))
- 'name
- (nth 3 args)
- 'parameter-list
- (nth 6 args)
- 'return-type
- (nth 8 args)
- 'children
- (if (nth 10 args)
- (phps-mode-parser-sdt--get-list-of-object (nth 10 args))
- nil)
- 'index
- (car (cdr (nth 3 terminals)))
- 'start
- (if (nth 10 args)
- (car (cdr (car (nth 10 terminals))))
- nil)
- 'end
- (if (nth 10 args)
- (cdr (cdr (car (cdr (cdr (nth 10 terminals))))))
- nil))))
- ;; (message "Method: %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ast-object))
+ `(
+ ast-type
+ method
+ modifiers
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ returns-reference-p
+ ,(not (equal (nth 2 args) nil))
+ name
+ ,(nth 3 args)
+ parameter-list
+ ,(nth 6 args)
+ return-type
+ ,(nth 8 args)
+ children
+ ,(if (nth 10 args)
+ (phps-mode-parser-sdt--get-list-of-object (nth 10 args))
+ nil)
+ index
+ ,(car (cdr (nth 3 terminals)))
+ start
+ ,(if (nth 10 args)
+ (car (cdr (car (nth 10 terminals))))
+ nil)
+ end
+ ,(if (nth 10 args)
+ (cdr (cdr (car (cdr (cdr (nth 10 terminals))))))
+ nil)
+ ))
phps-mode-parser--table-translations)
;; 301: method_body -> (";")
@@ -726,78 +681,66 @@
(puthash
318
(lambda(args terminals)
- ;; (message "318: %S %S" args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'assign-property-variable
- 'key
- (nth 0 args)
- 'value
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'index
- (car (cdr (nth 0 terminals)))
- 'start
- (car (cdr (nth 0 terminals)))
- 'end
- (cdr (cdr (nth 0 terminals))))))
- ast-object))
+ `(
+ ast-type
+ assign-property-variable
+ key
+ ,(nth 0 args)
+ value
+ ,(phps-mode-parser-sdt--get-list-of-object (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)
;; expr -> ("[" array_pair_list "]" "=" expr)
(puthash
336
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'assign-variables-from-array
- 'keys
- (nth 1 args)
- 'values
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args)))))
- ;; (message "Method: %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ast-object))
+ `(
+ ast-type
+ assign-variables-from-array
+ keys
+ ,(nth 1 args)
+ values
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> (variable "=" expr)
(puthash
337
(lambda(args terminals)
- ;; (message "337: %S %S" args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'assign-variable
- 'key
- (nth 0 args)
- 'value
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
- 'index
- (car (cdr (nth 0 terminals)))
- 'start
- (car (cdr (nth 0 terminals)))
- 'end
- (cdr (cdr (nth 0 terminals))))))
- ;; (message "Method: %S" ast-object)
- ;; (message "args: %S" args)
- ;; (message "terminals: %S" terminals)
- ast-object))
+ `(
+ ast-type
+ assign-variable
+ key
+ ,(nth 0 args)
+ value
+ ,(phps-mode-parser-sdt--get-list-of-object (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)
;; expr -> (variable T_INC)
(puthash
353
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'increment-variable
- 'variable
- (nth 0 args))))
- ast-object))
+ `(
+ ast-type
+ increment-variable
+ variable
+ ,(nth 0 args)
+ ))
phps-mode-parser--table-translations)
;; expr -> (expr T_BOOLEAN_OR expr)
@@ -810,7 +753,8 @@
a
,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
b
- ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> (expr T_BOOLEAN_AND expr)
@@ -823,7 +767,8 @@
a
,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
b
- ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> (expr T_LOGICAL_OR expr)
@@ -836,7 +781,8 @@
a
,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
b
- ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> (expr T_LOGICAL_AND expr)
@@ -849,7 +795,8 @@
a
,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
b
- ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> (expr T_LOGICAL_XOR expr)
@@ -862,7 +809,8 @@
a
,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
b
- ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> (expr "." expr)
@@ -875,35 +823,34 @@
a
,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
b
- ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> (expr "+" expr)
(puthash
366
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'addition-expression
- 'a
- (phps-mode-parser-sdt--get-list-of-object (nth 0 args))
- 'b
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args)))))
- ast-object))
+ `(
+ ast-type
+ addition-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; expr -> ("!" expr)
(puthash
376
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'negated-expression
- 'expression
- (nth 1 args))))
- ast-object))
+ `(
+ ast-type
+ negated-expression
+ expression
+ ,(nth 1 args)
+ ))
phps-mode-parser--table-translations)
;; expr -> (T_STATIC inline_function)
@@ -914,69 +861,68 @@
'ast-type
'static-inline-function
'inline-function
- ,(nth 1 args)))
+ ,(nth 1 args)
+ ))
phps-mode-parser--table-translations)
;; inline_function -> (function returns_ref backup_doc_comment "("
parameter_list ")" lexical_vars return_type backup_fn_flags "{"
inner_statement_list "}" backup_fn_flags)
(puthash
416
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'inline-function
- 'start
- (car (cdr (nth 9 terminals)))
- 'end
- (cdr (cdr (nth 11 terminals)))
- 'returns-ref
- (nth 1 args)
- 'backup-doc-comment
- (nth 2 args)
- 'parameter-list
- (nth 4 args)
- 'lexical-vars
- (phps-mode-parser-sdt--get-list-of-object (nth 6 args))
- 'return-type
- (nth 7 args)
- 'backup-fn-flags-1
- (nth 8 args)
- 'inner-statement-list
- (phps-mode-parser-sdt--get-list-of-object (nth 10 args))
- 'backup-fn-flags-2
- (nth 12 args))))
- ast-object))
+ `(
+ ast-type
+ inline-function
+ start
+ ,(car (cdr (nth 9 terminals)))
+ end
+ ,(cdr (cdr (nth 11 terminals)))
+ returns-ref
+ ,(nth 1 args)
+ backup-doc-comment
+ ,(nth 2 args)
+ parameter-list
+ ,(nth 4 args)
+ lexical-vars
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 6 args))
+ return-type
+ ,(nth 7 args)
+ backup-fn-flags-1
+ ,(nth 8 args)
+ inner-statement-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 10 args))
+ backup-fn-flags-2
+ ,(nth 12 args)
+ ))
phps-mode-parser--table-translations)
;; inline_function -> (fn returns_ref backup_doc_comment "(" parameter_list
")" return_type T_DOUBLE_ARROW backup_fn_flags backup_lex_pos expr
backup_fn_flags)
(puthash
417
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'arrow-function
- 'start
- (car (cdr (nth 9 terminals)))
- 'end
- (cdr (cdr (nth 11 terminals)))
- 'returns-ref
- (nth 1 args)
- 'backup-doc-comment
- (nth 2 args)
- 'parameter-list
- (nth 4 args)
- 'return-type
- (nth 6 args)
- 'backup-fn-flags-1
- (nth 8 args)
- 'backup-lex-pos
- (nth 9 args)
- 'expr
- (phps-mode-parser-sdt--get-list-of-object (nth 10 args))
- 'backup-fn-flags-2
- (nth 11 args))))
- ast-object))
+ `(
+ ast-type
+ arrow-function
+ start
+ ,(car (cdr (nth 9 terminals)))
+ end
+ ,(cdr (cdr (nth 11 terminals)))
+ returns-ref
+ ,(nth 1 args)
+ backup-doc-comment
+ ,(nth 2 args)
+ parameter-list
+ ,(nth 4 args)
+ return-type
+ ,(nth 6 args)
+ backup-fn-flags-1
+ ,(nth 8 args)
+ backup-lex-pos
+ ,(nth 9 args)
+ expr
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 10 args))
+ backup-fn-flags-2
+ ,(nth 11 args)
+ ))
phps-mode-parser--table-translations)
;; lexical_vars -> (T_USE "(" lexical_var_list possible_comma ")")
@@ -990,43 +936,42 @@
(puthash
429
(lambda(args terminals)
- (list
- 'ast-type
- 'lexical-var
- 'name
- args
- 'start
- (car (cdr terminals))
- 'end
- (cdr (cdr terminals))))
+ `(
+ ast-type
+ lexical-var
+ name
+ ,args
+ start
+ ,(car (cdr terminals))
+ end
+ ,(cdr (cdr terminals))
+ ))
phps-mode-parser--table-translations)
;; function_call -> (name argument_list)
(puthash
431
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'function-call
- 'name
- (nth 0 args)
- 'argument-list
- (phps-mode-parser-sdt--get-list-of-object (nth 1 args)))))
- ast-object))
+ `(
+ ast-type
+ function-call
+ name
+ ,(nth 0 args)
+ argument-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))
+ ))
phps-mode-parser--table-translations)
;; dereferencable_scalar -> (T_ARRAY "(" array_pair_list ")")
(puthash
447
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'dereferencable-scalar
- 'array-pair-list
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args)))))
- ast-object))
+ `(
+ ast-type
+ dereferencable-scalar
+ array-pair-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; dereferencable_scalar -> (T_CONSTANT_ENCAPSED_STRING)
@@ -1054,94 +999,87 @@
(puthash
483
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'callable-variable
- 'array-object-dereferencable
- 'array-index
- (phps-mode-parser-sdt--get-list-of-object (nth 2 args)))))
- ast-object))
+ `(
+ ast-type
+ callable-variable
+ array-object-dereferencable
+ array-index
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; callable_variable -> (array_object_dereferencable T_OBJECT_OPERATOR
property_name argument_list)
(puthash
485
(lambda(args _terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'callable-variable
- 'array-object-dereferencable
- (nth 0 args)
- 'property-name
- (nth 2 args)
- 'argument-list
- (phps-mode-parser-sdt--get-list-of-object (nth 3 args)))))
- ast-object))
+ `(
+ ast-type
+ callable-variable
+ array-object-dereferencable
+ ,(nth 0 args)
+ property-name
+ ,(nth 2 args)
+ argument-list
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 3 args))
+ ))
phps-mode-parser--table-translations)
;; 490: variable -> (array_object_dereferencable T_OBJECT_OPERATOR
property_name)
(puthash
490
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'array-object-dereferencable
- 'subject
- (nth 0 args)
- 'property-name
- (nth 2 args)
- 'property-start
- (car (cdr (nth 2 terminals)))
- 'property-end
- (cdr (cdr (nth 2 terminals))))))
- ast-object))
+ `(
+ ast-type
+ array-object-dereferencable
+ subject
+ ,(nth 0 args)
+ property-name
+ ,(nth 2 args)
+ property-start
+ ,(car (cdr (nth 2 terminals)))
+ property-end
+ ,(cdr (cdr (nth 2 terminals)))
+ ))
phps-mode-parser--table-translations)
;; simple_variable -> (T_VARIABLE)
(puthash
492
(lambda(args terminals)
- ;; (message "simple_variable: %S %S" args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'simple-variable
- 'name
- args
- 'start
- (car (cdr terminals))
- 'end
- (cdr (cdr terminals)))))
- ast-object))
+ `(
+ ast-type
+ simple-variable
+ name
+ ,args
+ start
+ ,(car (cdr terminals))
+ end
+ ,(cdr (cdr terminals))
+ ))
phps-mode-parser--table-translations)
;; static_member -> (class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable)
(puthash
495
(lambda(args terminals)
- (let ((ast-object
- (list
- 'ast-type
- 'static-member
- 'class
- (nth 0 args)
- 'member
- (nth 2 args)
- 'start
- (car (cdr (nth 0 terminals)))
- 'end
- (cdr (cdr (nth 0 terminals))))))
- ast-object))
+ `(
+ ast-type
+ static-member
+ class
+ ,(nth 0 args)
+ member
+ ,(nth 2 args)
+ start
+ ,(car (cdr (nth 0 terminals)))
+ end
+ ,(cdr (cdr (nth 0 terminals)))
+ ))
phps-mode-parser--table-translations)
;; non_empty_array_pair_list -> (non_empty_array_pair_list ","
possible_array_pair)
(puthash
513
(lambda(args _terminals)
- ;; (message "non_empty_array_pair_list 513: %S" args)
(if (nth 2 args)
(append (nth 0 args) (list (nth 2 args)))
(nth 0 args)))
@@ -1151,7 +1089,6 @@
(puthash
514
(lambda(args _terminals)
- ;; (message "non_empty_array_pair_list 514: %S" args)
(list args))
phps-mode-parser--table-translations)
@@ -1159,14 +1096,24 @@
(puthash
538
(lambda(args _terminals)
- `(ast-type isset-variables variables
,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ `(
+ ast-type
+ isset-variables
+ variables
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; internal_functions_in_yacc -> (T_EMPTY "(" expr ")")
(puthash
539
(lambda(args _terminals)
- `(ast-type empty-expression variables
,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))))
+ `(
+ ast-type
+ empty-expression
+ variables
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
phps-mode-parser--table-translations)
;; isset_variables -> (isset_variable)
- [elpa] externals/phps-mode e3bf9e8fed 059/212: SDT rules for some more infix operations, (continued)
- [elpa] externals/phps-mode e3bf9e8fed 059/212: SDT rules for some more infix operations, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2bc31a0f83 065/212: Added TODO items, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d802a669c0 061/212: Bookkeeping via AST working with isset() and !empty() scoped variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d9115ec583 069/212: Cleaned up AST bookkeeping tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f4d2164f8b 067/212: Bookkeeping via parser SDT passing static variables in function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e66abd00e5 064/212: Bookkeeping via AST passing nested isset() !empty() expressions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8b5ce22d87 072/212: Fixed issue with SDT for return statement, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 491c82a2a1 071/212: Added TODO item for bookkeeping via AST, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5ec32f5f5a 076/212: Bookkeeping via AST passing all tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 228f212127 080/212: Starting on removing the old process tokens in string function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5b1f5b4774 079/212: Improved format of SDT,
Christian Johansson <=
- [elpa] externals/phps-mode 3f3a8bb0fa 081/212: Major refactor of indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode b469f0ffbb 088/212: Passing indentation for multi-line class implements, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f69df4fdf6 083/212: Moved indentation to separate file and test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 481deb6331 082/212: More work on indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode fe9cb90c44 097/212: Passing indent test for some multi-line assignments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c9f715a1fd 093/212: Improved comments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f0ab7a2cdb 095/212: Passed tests for inline control structures, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 08f57c1d36 107/212: Added TODO item for indent, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3853ddf32a 099/212: Passed another concatenation test for indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1ed09d42f5 111/212: Passing another indent test, Christian Johansson, 2022/01/26