[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 66c02b9be1 083/135: Passing test for bookkeep
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 66c02b9be1 083/135: Passing test for bookkeeping of interface variables |
Date: |
Sun, 29 Jan 2023 03:11:06 -0500 (EST) |
branch: externals/phps-mode
commit 66c02b9be1eb3dbf147ba2caaf3f2b6249e17661
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passing test for bookkeeping of interface variables
---
phps-mode-parser-sdt.el | 32 ++++++++++++++++++++++++++++++++
test/phps-mode-test-ast.el | 2 +-
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index bf35794061..68e343d11f 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -2293,6 +2293,38 @@
(puthash
191
(lambda(args terminals)
+ ;; Go through stacks and modify symbol name-spaces
+ ;; but only for non-super-global variables.
+ ;;
+ ;; Should place class scope first in scope
+ ;; unless a namespace exists, in that case it should be placed second in
scope
+ (let ((class-name (nth 1 args)))
+ (when phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack
+ (dolist (
+ symbol-list
+ phps-mode-parser-sdt--bookkeeping-symbol-assignment-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)
+ (push
+ (list symbol-name symbol-scope symbol-start symbol-end)
+ phps-mode-parser-sdt--bookkeeping-symbol-stack)))))))
+
`(
ast-type
interface-declaration-statement
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 4930dacd01..1fb50e6b56 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -301,7 +301,7 @@
(phps-mode-test-ast--should-bookkeep
"<?php\ninterface myInterface\n{\n function myFunction1();\n function
myFunction2($x);\n}\n"
"Bookkeeping variable in interface function"
- '((" class myInterface function myFunction2 id $x" 1) ((84 86) 1)))
+ '((" interface myInterface function myFunction2 id $x" ((84 86))) ((84 86)
1)))
(phps-mode-test-ast--should-bookkeep
"<?php\n\nfunction myFunction1()\n{\n return isset($a);\n}\n\nfunction
myFunction2()\n{\n $b = 2;\n if ($b) {\n echo 'Hit';\n }\n
if ($b) {\n echo 'Hit';\n }\n}\n"
- [elpa] externals/phps-mode c0c37bafd9 110/135: Added some TODO items, (continued)
- [elpa] externals/phps-mode c0c37bafd9 110/135: Added some TODO items, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 76ef8cceac 124/135: More fixes in code, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 3b6eb46d4c 129/135: Added new MVP bookkeeping and imenu test, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode f9ddef260c 039/135: Passing first bookkeeping test using SDT generated bookkeeping, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode fb42b49970 044/135: Added more TODO items, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode dd2fadefe7 048/135: Bookkeeping class properties, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 804a0dbdb9 074/135: Added static uri for symbol names, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 7bb676dc8b 076/135: Bookkeeping for anonymous function passing, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode f86d8dc6ac 078/135: More work on arrow function variable uri, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 787aaa2bb4 081/135: Passing another bookkeeping test, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 66c02b9be1 083/135: Passing test for bookkeeping of interface variables,
Christian Johansson <=
- [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, 2023/01/29