[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 0bf9b31fef 062/135: Passed bookkeeping via SD
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 0bf9b31fef 062/135: Passed bookkeeping via SDT for try catch variables |
Date: |
Sun, 29 Jan 2023 03:11:04 -0500 (EST) |
branch: externals/phps-mode
commit 0bf9b31fefe7443dbbd808512f67c296244c1578
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passed bookkeeping via SDT for try catch variables
---
phps-mode-ast.el | 3 +++
phps-mode-parser-sdt.el | 29 ++++++++++++++++++++++++-----
test/phps-mode-test-ast.el | 2 +-
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/phps-mode-ast.el b/phps-mode-ast.el
index 5483c9bb1d..0e392b127e 100644
--- a/phps-mode-ast.el
+++ b/phps-mode-ast.el
@@ -36,6 +36,9 @@
(setq
phps-mode-parser-sdt--bookkeeping-namespace
nil)
+ (setq
+ phps-mode-parser-sdt--bookkeeping-namespace-stack
+ nil)
(setq
phps-mode-parser-sdt--bookkeeping-symbol-stack
nil)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 6c7fb4b525..139c340665 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -1836,20 +1836,39 @@
(puthash
169
(lambda(args terminals)
+ (let ((optional-variable (nth 4 args))
+ (optional-variable-start)
+ (optional-variable-end))
+ (when optional-variable
+ (setq optional-variable-start (car (cdr (nth 4 terminals))))
+ (setq optional-variable-end (cdr (cdr (nth 4 terminals))))
+ (push
+ (list
+ optional-variable
+ phps-mode-parser-sdt--bookkeeping-namespace
+ optional-variable-start
+ optional-variable-end)
+ phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)
+ (push
+ (list
+ optional-variable
+ phps-mode-parser-sdt--bookkeeping-namespace
+ optional-variable-start
+ optional-variable-end)
+ phps-mode-parser-sdt--bookkeeping-symbol-stack))
`(
ast-type
catch-list
catch-name-list
,(nth 3 args)
optional-variable
- ,(nth 4 args)
+ ,optional-variable
optional-variable-start
- ,(car (cdr (nth 4 terminals)))
+ ,optional-variable-start
optional-variable-end
- ,(cdr (cdr (nth 4 terminals)))
+ ,optional-variable-end
inner-statement-list
- ,(nth 7 args)
- ))
+ ,(nth 7 args))))
phps-mode-parser--table-translations)
;; 170 ((catch_name_list) (class_name))
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index ce995c6c02..4d79c3153c 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -251,7 +251,7 @@
(phps-mode-test-ast--should-bookkeep
"<?php\n\ntry {\n \n} catch (\\Exception $e) {\n if ($e) {\n
echo 'Hit';\n }\n}\n\nif ($e) {\n echo 'Miss';\n}\n"
"Bookkeeping of try catch variable assignment"
- '((" id $e" 1) ((39 41) 1) ((53 55) 1) ((92 94) 1)))
+ '((" id $e" ((39 41))) ((39 41) 1) ((53 55) 1) ((92 94) 1)))
(phps-mode-test-ast--should-bookkeep
"<?php\n\n$example = function ($test) {\n if ($test) {\n echo
'Hit';\n }\n if ($example) {\n echo 'Miss';\n }\n};\n$example2
= function ($test2) use ($example) {\n if ($test2) {\n echo 'Hit';\n
}\n if ($example) {\n echo 'Hit';\n }\n if ($example2) {\n
echo 'Miss';\n }\n if ($example3) {\n echo 'Miss';\n
}\n};\nif ($test) {\n echo 'Miss';\n}\nif ($test2) {\n echo 'Miss';\n}"
- [elpa] externals/phps-mode d98f6d78d8 114/135: Saving symbol-table after parse, (continued)
- [elpa] externals/phps-mode d98f6d78d8 114/135: Saving symbol-table after parse, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 1594c15e9e 117/135: More work on imenu generation, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 776c818ff9 121/135: Passing some more imenu tests, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode c6e4844753 122/135: Some byte-compilation fixes, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 96eeff74f8 130/135: Added more todo items for bookkeeping and imenu, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 66ad034207 025/135: SDT member_modifier, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 34a595fa09 028/135: SDT class_const_list, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 1332919417 049/135: Passing another bookkeeping test via SDT, Christian Johansson, 2023/01/29
- [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 <=
- [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, 2023/01/29
- [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