[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode f053587ff6 091/135: Passing another bookkeepi
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode f053587ff6 091/135: Passing another bookkeeping test |
Date: |
Sun, 29 Jan 2023 03:11:07 -0500 (EST) |
branch: externals/phps-mode
commit f053587ff60edcb8465bfc71ea44ae863960b590
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passing another bookkeeping test
---
phps-mode-parser-sdt.el | 28 ++++++++++++++++++++++++----
test/phps-mode-test-ast.el | 2 +-
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 5054cbacac..2db915af81 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -2349,10 +2349,30 @@
(setq symbol-scope (reverse symbol-scope))
(setcar
(cdr symbol-list)
- symbol-scope)
- (push
- (list symbol-name symbol-scope symbol-start symbol-end)
- phps-mode-parser-sdt--bookkeeping-symbol-stack)))))))
+ symbol-scope))))))
+
+ (when phps-mode-parser-sdt--bookkeeping-symbol-stack
+ (dolist (
+ symbol-list
+ phps-mode-parser-sdt--bookkeeping-symbol-stack)
+ (let ((symbol-name (car symbol-list))
+ (symbol-start (nth 2 symbol-list))
+ (symbol-end (nth 3 symbol-list)))
+ (unless (gethash
+ symbol-name
+ phps-mode-parser-sdt--bookkeeping--superglobal-variable-p)
+ (let ((symbol-scope (reverse (car (cdr symbol-list)))))
+ (if (equal (car (car symbol-scope)) 'namespace)
+ (let ((namespace-name (car (cdr (car symbol-scope)))))
+ (setcar symbol-scope (list 'interface class-name))
+ (push (list 'namespace namespace-name) symbol-scope))
+ (push
+ (list 'interface class-name)
+ symbol-scope))
+ (setq symbol-scope (reverse symbol-scope))
+ (setcar
+ (cdr symbol-list)
+ symbol-scope)))))))
`(
ast-type
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index f5c1c25482..3eb4679195 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -346,7 +346,7 @@
(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"
- '((" class There function here id $this" ((245 482))) (" class There static
id $variable6" ((209 219))) (" class There static id $variable5" ((171 181)))
(" class There static id $variable4" ((129 139))) (" class There id $variable3"
((98 108))) (" class There id $variable2" ((67 77))) (" class There id
$variable" ((33 42))) ((462 472) 1) ((429 439) 1) ((396 406) 1) ((364 373) 0)
((357 362) 1) ((331 340) 1) ((324 329) 1) ((298 307) 1) ((291 296) 1) ((266
274) 1) ((259 264) 1)))
+ '((" class There function here id $this" ((245 482))) (" class There static
id $variable6" ((209 219))) (" class There static id $variable5" ((171 181)))
(" class There static id $variable4" ((129 139))) (" class There id $variable3"
((98 108))) (" class There id $variable2" ((67 77))) (" class There id
$variable" ((33 42))) ((462 472) 1) ((429 439) 1) ((396 406) 1) ((364 373) 0)
((357 362) 1) ((331 340) 1) ((324 329) 1) ((298 307) 1) ((291 296) 1) ((266
274) 1) ((259 264) 1) ((209 21 [...]
(phps-mode-test-ast--should-bookkeep
"<?php\n\n$a = $b = $c = 3;\n\nif ($a) {\n echo 'a=',$a;\n} else {\n
echo '$a is undefined!';\n}\nif ($b) {\n echo 'b=',$b;\n} else {\n echo
'$b is undefined!';\n}\nif ($c) {\n echo 'c=',$c;\n} else {\n echo '$c is
undefined!';\n}"
- [elpa] externals/phps-mode 66c02b9be1 083/135: Passing test for bookkeeping of interface variables, (continued)
- [elpa] externals/phps-mode 66c02b9be1 083/135: Passing test for bookkeeping of interface variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 1afe6aaec7 086/135: Passing more tests for static variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode d456658676 089/135: Passing bookkeeping test for $this inside arrow function, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode f4be94ccfc 094/135: Passing bookkeeping test for class properties inside conditional expression, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 18f1f12fc6 096/135: Added new bookkeeping test for class parameters in constructor method, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 6d3cadbdf0 104/135: More integration of new imenu and bookkeeping via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 171e96b043 123/135: Fixes for some tests, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 6944154fd3 125/135: Imenu via SDT passing some more tests, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode d1b1fd0a19 071/135: Started bookkeeping of arrow function variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode ae68e19c0a 080/135: Passing bookkeeping arrow function, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode f053587ff6 091/135: Passing another bookkeeping test,
Christian Johansson <=
- [elpa] externals/phps-mode 9c43bc30c4 103/135: Removed old bookkeeping and imenu and integrated new via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode a447ae69ba 106/135: Starting on generating imenu index for namespaces, classes, methods, traits, interfaces via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 16a63da318 113/135: More TODO items for bookkeeping, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 807c834649 116/135: More work on imenu generation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode a84bfdccd3 120/135: More fighting the AST, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 23ba458f20 133/135: Updated version and date for 0.4.31, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode d5bdadc6fc 135/135: Improved installation documentation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 8259e390b4 092/135: Added TODO item, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 9f21c86dd1 108/135: SDT integration now passing byte-compilation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode ddc5b5aa2a 112/135: Using sorted bookkeeping for test, Christian Johansson, 2023/01/29