[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode e6bc401d0b 068/135: Work on improving test fo
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode e6bc401d0b 068/135: Work on improving test for global variable bookkeeping |
Date: |
Sun, 29 Jan 2023 03:11:05 -0500 (EST) |
branch: externals/phps-mode
commit e6bc401d0bd601431310c06528d0356c8a1726b9
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Work on improving test for global variable bookkeeping
---
phps-mode-parser-sdt.el | 30 ++++++++++++++++++++++++++++--
test/phps-mode-test-ast.el | 2 +-
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 9d4866167a..c79fdef75a 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -647,6 +647,11 @@
(setq function space-name))
((equal space-type 'anonymous-function)
(setq anonymous-function space-name))
+ ((equal space-type 'global)
+ (setq namespace nil)
+ (setq class nil)
+ (setq function nil)
+ (setq anonymous-function nil))
((equal space-type 'object-operator)
(let ((downcased-space-name
(downcase space-name)))
@@ -1694,12 +1699,33 @@
(puthash
155
(lambda(args _terminals)
+ (let ((global-var-list (nth 1 args)))
+ (dolist (global-var global-var-list)
+ (let ((global-var-type (plist-get global-var 'ast-type)))
+ (cond
+ ((equal global-var-type 'simple-variable-variable)
+ (let ((variable-name (plist-get global-var 'variable))
+ (variable-start (plist-get global-var 'ast-start))
+ (variable-end (plist-get global-var 'ast-end)))
+ (push
+ (list
+ variable-name
+ phps-mode-parser-sdt--bookkeeping-namespace
+ variable-start
+ variable-end)
+ phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)
+ (push
+ (list
+ variable-name
+ '((global))
+ variable-start
+ variable-end)
+ phps-mode-parser-sdt--bookkeeping-symbol-stack)))))))
`(
ast-type
global-statement
global-var-list
- ,(nth 1 args)
- ))
+ ,(nth 1 args)))
phps-mode-parser--table-translations)
;; 156 ((statement) (T_STATIC static_var_list ";"))
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 15621b146a..e21aff41eb 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -274,7 +274,7 @@
'((" id $bandom" ((18 25))) (" id $random" ((9 16))) ((18 25) 1) ((9 16) 1)
((45 52) 1) ((78 85) 1)))
(phps-mode-test-ast--should-bookkeep
- "<?php\n\n$var = 123;\n\nfunction test($abc) {\n global $var;\n if
($var) {\n echo 'Hit';\n }\n}"
+ "<?php\n\n$var = 123;\n\nfunction test($abc) {\n global $var, $var2;\n
if ($var) {\n echo 'Hit';\n }\n if ($var2) {\n echo
'Hit';\n }\n}"
"Bookkeeping of global variable declaration in function"
'((" id $var" 1) ((8 12) 1) (" function test id $abc" 1) ((35 39) 1) ("
function test id $var" 1) ((54 58) 1) ((68 72) 1)))
- [elpa] externals/phps-mode 438ec520fc 051/135: Passing bookkeeping via SDT for conditional assignments, (continued)
- [elpa] externals/phps-mode 438ec520fc 051/135: Passing bookkeeping via SDT for conditional assignments, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 7fa721a85d 060/135: More work on bookkeeping static class properties, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 0bf9b31fef 062/135: Passed bookkeeping via SDT for try catch variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 40d7d88fb8 069/135: Work on bookkeeping global variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode a10656fc34 070/135: Passing bookkeeping test for global variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 9c67facc86 075/135: Work on bookkeeping of class static properties, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 39a6fe03ae 079/135: Improved is-varadic and is-reference argument flags, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode e8a5dbe153 126/135: Fix for trait and interface imenu, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 579034d1c6 127/135: Passing imenu test via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode fb9a181135 088/135: Passed more bookkeeping tsts, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode e6bc401d0b 068/135: Work on improving test for global variable bookkeeping,
Christian Johansson <=
- [elpa] externals/phps-mode 4949daefd9 101/135: Passing another SDT imenu test, Christian Johansson, 2023/01/29
- [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