branch: externals/phps-mode
commit c4d9f8d909fb78e5fafa9036e06ecf9873e64301
Author: Christian Johansson <christ...@cvj.se>
Commit: Christian Johansson <christ...@cvj.se>

    More work on SDT
---
 phps-mode-ast-bookkeeping.el |  1 +
 phps-mode-parser-sdt.el      | 38 ++++++++++++++++++++++++++++++--------
 2 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index 6bf8875c65..e46e98f642 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -250,6 +250,7 @@
 (defun phps-mode-ast-bookkeeping--generate (&optional tree)
   "Generate AST for current buffer or optionally for TREE."
   (setq phps-mode-ast-bookkeeping--index phps-mode-parser-sdt-bookkeeping)
+  (message "phps-mode-parser-sdt--bookkeeping-symbol-stack: %S" 
phps-mode-parser-sdt--bookkeeping-symbol-stack)
   phps-mode-ast-bookkeeping--index)
 
 
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 779dfff2ed..996b27f2ac 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -592,12 +592,12 @@
   "Bookkeeping")
 
 (defvar-local
-  phps-mode-parser-sdt-bookkeeping-namespace
+  phps-mode-parser-sdt--bookkeeping-namespace
   ""
   "Current bookkeeping namespace.")
 
 (defvar-local
-  phps-mode-parser-sdt-bookkeeping-symbol-stack
+  phps-mode-parser-sdt--bookkeeping-symbol-stack
   nil
   "Current bookkeeping symbol stack.")
 
@@ -3176,13 +3176,34 @@
           ((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)
-             )))))))
+             (let ((callable-variable-simple-variable-type
+                    (plist-get
+                     callable-variable-simple-variable
+                     'ast-type)))
+                   (cond
+                    ((equal
+                      callable-variable-simple-variable-type
+                      'simple-variable-variable)
+                     (push
+                      (list
+                       'write
+                       (format
+                        "%s id %s"
+                        phps-mode-parser-sdt--bookkeeping-namespace
+                        (plist-get
+                         callable-variable-simple-variable
+                         'variable))
+                       (car (cdr (car terminals)))
+                       (cdr (cdr (car terminals))))
+                      phps-mode-parser-sdt--bookkeeping-symbol-stack)))))))))))
+
+   ;; TODO Should parse bookkeeping writes and reads at every statement 
terminus
 
    ;; 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)
+   (message "stack: %S" phps-mode-parser-sdt--bookkeeping-symbol-stack)
    `(
      ast-type
      expr-assign-variable-by-expr
@@ -5084,14 +5105,15 @@
    (let ((namespaced-variable
           (format
            "%s id %s"
-           phps-mode-parser-sdt-bookkeeping-namespace
+           phps-mode-parser-sdt--bookkeeping-namespace
            args)))
      (push
       (list
+       'read
        namespaced-variable
-         (car (cdr terminals))
-         (cdr (cdr terminals)))
-      phps-mode-parser-sdt-bookkeeping-symbol-stack)
+       (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