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

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

[elpa] externals/phps-mode 249f8a2a4d 087/135: Work on bookkeeping class


From: Christian Johansson
Subject: [elpa] externals/phps-mode 249f8a2a4d 087/135: Work on bookkeeping class static variable
Date: Sun, 29 Jan 2023 03:11:07 -0500 (EST)

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

    Work on bookkeeping class static variable
---
 phps-mode-parser-sdt.el    | 14 +++++++++-----
 test/phps-mode-test-ast.el |  2 ++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index ac09147928..991e3068ba 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -6218,10 +6218,6 @@
          (symbol-end
           (cdr (cdr terminals)))
          (namespace phps-mode-parser-sdt--bookkeeping-namespace))
-     (when phps-mode-parser-sdt--bookkeeping-namespace-stack
-       (setq
-        namespace
-        (pop phps-mode-parser-sdt--bookkeeping-namespace-stack)))
      (push
       (list
        symbol-name
@@ -6277,7 +6273,15 @@
        (let ((class-name-string (plist-get class-name 'name))
              (namespace phps-mode-parser-sdt--bookkeeping-namespace))
          (push (list 'static-member class-name-string) namespace)
-         (push namespace phps-mode-parser-sdt--bookkeeping-namespace-stack)))))
+         (setf
+          (nth 1 (car phps-mode-parser-sdt--bookkeeping-symbol-stack))
+          namespace)))
+      ((equal class-name-type 'class-name-static)
+       (let ((namespace phps-mode-parser-sdt--bookkeeping-namespace))
+         (push (list 'static-member "static") namespace)
+         (setf
+          (nth 1 (car phps-mode-parser-sdt--bookkeeping-symbol-stack))
+          namespace)))))
    `(
      ast-type
      static-member-class-name
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 7c0e498711..840add33be 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -343,6 +343,8 @@
    "Bookkeeping of static variables in different scopes without namespaces"
    '((" id $a" ((15 17))) ((15 17) 1) ((24 26) 1) (" function test id $a" ((61 
63))) ((73 75) 1) ((61 63) 1) (" class There function here id $this" ((121 
166))) (" class There function here id $a" ((138 140))) ((154 156) 1) ((138 
140) 1)))
 
+  ;; TODO WAS HERE
+
   (phps-mode-test-ast--should-bookkeep
    "<?php\nclass There\n{\n    private $variable;\n    private \\My\\Random 
$variable2;\n    private string $variable3;\n    private static $variable4;\n   
 private static \\My\\Random $variable5;\n    private static string 
$variable6;\n    function here()\n    {\n        if ($this->variable) {}\n      
  if ($this->variable2) {}\n        if ($this->variable3) {}\n        if 
($this->variable4) {}\n        if (self::$variable4) {}\n        if 
(self::$variable5) {}\n        if (self::$varia [...]
    "Bookkeeping of typed class variables"



reply via email to

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