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

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

[elpa] externals/phps-mode 6e43f9f6db 037/135: More messing around with


From: Christian Johansson
Subject: [elpa] externals/phps-mode 6e43f9f6db 037/135: More messing around with SDT
Date: Sun, 29 Jan 2023 03:11:02 -0500 (EST)

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

    More messing around with SDT
---
 phps-mode-parser-sdt.el | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 38c875efc3..779dfff2ed 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -596,6 +596,11 @@
   ""
   "Current bookkeeping namespace.")
 
+(defvar-local
+  phps-mode-parser-sdt-bookkeeping-symbol-stack
+  nil
+  "Current bookkeeping symbol stack.")
+
 ;; SDT starts here
 
 ;; 0 ((start) (top_statement_list))
@@ -3162,11 +3167,22 @@
  359
  (lambda(args terminals)
    ;; TODO Should probably have a expression / statement buffer of mentioned 
symbols and do a parse each time a expression / statement reaches its terminus
+   (let ((variable-type (plist-get (nth 0 args) 'ast-type)))
+     (cond
+      ((equal variable-type 'variable-callable-variable)
+       (let* ((callable-variable (plist-get (nth 0 args) 'callable-variable))
+              (callable-variable-type (plist-get callable-variable 'ast-type)))
+         (cond
+          ((equal callable-variable-type 'callable-variable-simple-variable)
+           (let ((callable-variable-simple-variable (plist-get 
callable-variable 'simple-variable)))
+             (message "callable-variable-simple-variable: %S" 
callable-variable-simple-variable)
+             )))))))
 
    ;; TODO Declare variable in bookkeeping and imenu here
    (message "expr-assign-variable-by-expr")
    (message "args: %S" args)
    (message "terminals: %S" terminals)
+   (message "stack: %S" phps-mode-parser-sdt-bookkeeping-symbol-stack)
    `(
      ast-type
      expr-assign-variable-by-expr
@@ -4942,6 +4958,7 @@
    `(
      ast-type
      callable-variable-simple-variable
+     simple-variable
      ,args))
  phps-mode-parser--table-translations)
 
@@ -5069,6 +5086,12 @@
            "%s id %s"
            phps-mode-parser-sdt-bookkeeping-namespace
            args)))
+     (push
+      (list
+       namespaced-variable
+         (car (cdr terminals))
+         (cdr (cdr terminals)))
+      phps-mode-parser-sdt-bookkeeping-symbol-stack)
 
      ;; Bookkeep whether we hit or miss the variable
      (if (gethash



reply via email to

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