[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 696d66d7e7 085/135: Bookkeeping of static var
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 696d66d7e7 085/135: Bookkeeping of static variable inside function |
Date: |
Sun, 29 Jan 2023 03:11:07 -0500 (EST) |
branch: externals/phps-mode
commit 696d66d7e76b37d968b226e9c892c42cb584ab77
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Bookkeeping of static variable inside function
---
phps-mode-parser-sdt.el | 15 +++++++++++++++
test/phps-mode-test-ast.el | 2 +-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index a328e6d803..ddb9bea944 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -1786,6 +1786,21 @@
(puthash
156
(lambda(args _terminals)
+ (let ((static-var-list (nth 1 args)))
+ (dolist (static-var static-var-list)
+ (let ((static-var-type (plist-get static-var 'ast-type)))
+ (cond
+ ((equal static-var-type 'variable)
+ (let* ((variable-name (plist-get static-var 'ast-name))
+ (variable-start (plist-get static-var 'ast-start))
+ (variable-end (plist-get static-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)))))))
`(
ast-type
static-statement
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 9619250711..4dde441bb1 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -331,7 +331,7 @@
(phps-mode-test-ast--should-bookkeep
"<?php\n\n$var = 123;\n\nfunction test($abc) {\n static $var;\n if
($var) {\n echo 'Hit';\n }\n}"
"Bookkeeping of static 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)))
+ '((" id $var" ((8 12))) ((8 12) 1) (" function test id $abc" ((35 39))) ("
function test id $var" ((54 58))) ((35 39) 1) ((68 72) 1)))
(phps-mode-test-ast--should-bookkeep
"<?php\n\nglobal $a, $b;\n\nif ($a) {\n echo 'Hit';\n}\n\nfunction
myFunction($c)\n{\n global $a;\n if ($a) {\n echo 'Hit';\n }\n
if ($b) {\n echo 'Miss';\n }\n}\n"
- [elpa] externals/phps-mode ebe28c3c9d 073/135: Work on improving symbol URI generation for class method variables, (continued)
- [elpa] externals/phps-mode ebe28c3c9d 073/135: Work on improving symbol URI generation for class method variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 61d3e7b1e0 093/135: Passing bookkeeping test but via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode d16c8a4e93 099/135: Passing some tests now with integrated bookkeeping and imenu-generation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 9a45a530d0 100/135: Passing more imenu tests, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 749659769c 115/135: More work on imenu generation via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 42b983bb16 045/135: More work on bookkeeping via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode cba467b26c 050/135: Added TODO items, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode e1752a3aa3 064/135: Bookkeeping of variables inside simple anonymous functions, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode d464cb1f01 077/135: Fixed bookkeeping of global variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 1a1245f186 082/135: Passing bookkeeping test isset and empty variables, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 696d66d7e7 085/135: Bookkeeping of static variable inside function,
Christian Johansson <=
- [elpa] externals/phps-mode cffad0d620 131/135: Merge branch 'feature/full-sdt', Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 249f8a2a4d 087/135: Work on bookkeeping class static variable, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 177b00f06a 132/135: Updated copyright years, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 0654fe8899 134/135: Updated documentation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 6e43f9f6db 037/135: More messing around with SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 86ad9e35ee 047/135: Renamed symbol id to symbol URI, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode dbaf508512 052/135: Work on getting bookkeeping for class properties working, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 531c98cf2b 053/135: Improved bookkeeping of class properties, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 5080effb1d 014/135: Added TODO item, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode cfcb795473 016/135: SDT for while_statement, Christian Johansson, 2023/01/29