branch: externals/phps-mode
commit 0daaa97f8d55a4077039495c6fe9a473abe7fcb8
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
SDT for for() loop started
---
phps-mode-ast.el | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/phps-mode-ast.el b/phps-mode-ast.el
index 2110d3aa36..908a700f8d 100644
--- a/phps-mode-ast.el
+++ b/phps-mode-ast.el
@@ -141,6 +141,25 @@
(nth 1 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
+ (nth 2 args)
+ 'test
+ (nth 4 args)
+ 'incremental
+ (nth 6 args)
+ 'children
+ (nth 8 args))))
+ ast-object))
+ phps-mode-parser--table-translations)
+
;; statement -> (T_ECHO echo_expr_list ";")
(puthash
152
@@ -859,6 +878,38 @@
child)
bookkeeping-stack))))
+ ((equal type 'for)
+ ;; Optional incremental
+ (when-let ((child (plist-get item 'incremental)))
+ (push
+ (list
+ (list
+ class
+ function
+ namespace)
+ child)
+ bookkeeping-stack))
+ ;; Optional test
+ (when-let ((child (plist-get item 'test)))
+ (push
+ (list
+ (list
+ class
+ function
+ namespace)
+ child)
+ bookkeeping-stack))
+ ;; Optional initial
+ (when-let ((child (plist-get item 'initial)))
+ (push
+ (list
+ (list
+ class
+ function
+ namespace)
+ child)
+ bookkeeping-stack)))
+
((equal type 'assign-variable)
(let ((id (format
"%s id %s"