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

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

[elpa] externals/phps-mode 0daaa97f8d 025/212: SDT for for() loop starte


From: Christian Johansson
Subject: [elpa] externals/phps-mode 0daaa97f8d 025/212: SDT for for() loop started
Date: Wed, 26 Jan 2022 01:50:18 -0500 (EST)

branch: externals/phps-mode
commit 0daaa97f8d55a4077039495c6fe9a473abe7fcb8
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    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"



reply via email to

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