[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode e887dc91e3 043/135: Added TODO items
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode e887dc91e3 043/135: Added TODO items |
Date: |
Sun, 29 Jan 2023 03:11:02 -0500 (EST) |
branch: externals/phps-mode
commit e887dc91e3b4fcd4f2a61a910146b20182754e5a
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added TODO items
---
phps-mode-parser-sdt.el | 105 +++++++++++++++++++++++++++++----------------
test/phps-mode-test-ast.el | 2 +
2 files changed, 71 insertions(+), 36 deletions(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index a0967a37a9..27d5d97111 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -1091,7 +1091,7 @@
args)
phps-mode-parser--table-translations)
-;; 108 ((top_statement) (statement))
+;; 108 ((top_statement) (attributed_statement))
(puthash
108
(lambda(args _terminals)
@@ -1120,6 +1120,13 @@
111
(lambda(args terminals)
(phps-mode-parser-sdt--parse-top-statement)
+ (let ((namespace-name (nth 1 args)))
+ (setq phps-mode-parser-sdt--bookkeeping-namespace
+ (format
+ " namespace %s%s"
+ namespace-name
+ phps-mode-parser-sdt--bookkeeping-namespace)))
+
`(
ast-type
namespace
@@ -1137,7 +1144,40 @@
(puthash
112
(lambda(args terminals)
+ (message "phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack: %S"
phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)
+ (message "phps-mode-parser-sdt--bookkeeping-symbol-stack: %S"
phps-mode-parser-sdt--bookkeeping-symbol-stack)
+ ;; Go through stacks and modify symbol namespaces
+ ;; but only for non-super-global variables
+ (let ((namespace-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)))
+ (unless (gethash
+ symbol-name
+ phps-mode-parser-sdt--bookkeeping--superglobal-variable-p)
+ (setcar symbol-list
+ (format
+ " namespace %s%s"
+ namespace-name
+ symbol-name))))))
+ (when phps-mode-parser-sdt--bookkeeping-symbol-stack
+ (dolist (
+ symbol-list
+ phps-mode-parser-sdt--bookkeeping-symbol-stack)
+ (let ((symbol-name (car symbol-list)))
+ (unless (gethash
+ symbol-name
+ phps-mode-parser-sdt--bookkeeping--superglobal-variable-p)
+ (setcar symbol-list
+ (format
+ " namespace %s%s"
+ namespace-name
+ symbol-name)))))))
+
(phps-mode-parser-sdt--parse-top-statement)
+
`(
ast-type
namespace
@@ -1812,7 +1852,7 @@
;; (message "parameter_list-args: %S" (nth 5 args))
;; (message "parameter_list-terminals: %S" (nth 5 terminals))
- ;; Iterate optional parameters are declare them
+ ;; Iterate optional parameters are declare them as new variable declarations
(when-let ((parameter-list (nth 5 args)))
(dolist (parameter parameter-list)
(let ((parameter-ast-type (plist-get parameter 'ast-type)))
@@ -1838,7 +1878,6 @@
symbol-end)
phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)))))))
-
;; (message
;; "phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack: %S"
;; phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)
@@ -1848,41 +1887,35 @@
;; Go through stacks and modify symbol namespaces
;; but only for non-super-global variables
- (when phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack
- (dolist (
+ (let ((function-name (nth 2 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)))
+ (unless (gethash
+ symbol-name
+ phps-mode-parser-sdt--bookkeeping--superglobal-variable-p)
+ (setcar
symbol-list
- phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)
- (let ((symbol-name (car symbol-list)))
- (unless (gethash
- symbol-name
- phps-mode-parser-sdt--bookkeeping--superglobal-variable-p)
- (setcar symbol-list
- (format
- " function %s%s"
- (nth 2 args)
- symbol-name)))))
- ;; (message
- ;; "new-phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack: %S"
- ;; phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)
- )
-
- (when phps-mode-parser-sdt--bookkeeping-symbol-stack
- (dolist (
+ (format
+ " function %s%s"
+ function-name
+ symbol-name))))))
+ (when phps-mode-parser-sdt--bookkeeping-symbol-stack
+ (dolist (
+ symbol-list
+ phps-mode-parser-sdt--bookkeeping-symbol-stack)
+ (let ((symbol-name (car symbol-list)))
+ (unless (gethash
+ symbol-name
+ phps-mode-parser-sdt--bookkeeping--superglobal-variable-p)
+ (setcar
symbol-list
- phps-mode-parser-sdt--bookkeeping-symbol-stack)
- (let ((symbol-name (car symbol-list)))
- (unless (gethash
- symbol-name
- phps-mode-parser-sdt--bookkeeping--superglobal-variable-p)
- (setcar symbol-list
- (format
- " function %s%s"
- (nth 2 args)
- symbol-name)))))
- ;; (message
- ;; "new-phps-mode-parser-sdt--bookkeeping-symbol-stack: %S"
- ;; phps-mode-parser-sdt--bookkeeping-symbol-stack)
- )
+ (format
+ " function %s%s"
+ function-name
+ symbol-name)))))))
`(
ast-type
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 7c29e7cb5e..826b20ccbc 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -373,6 +373,8 @@
"Bookkeeping of self reference inside arrow function inside of static
method"
'((" class myClass static id $var" 1) ((30 34) 1) (" class myClass function
myMethod id $a" 1) ((69 71) 1) (" class myClass function myMethod arrow
function 1 id $b" 1) ((85 87) 1) ((98 102) 1) ((105 107) 1) ((110 112) 1)))
+ ;; TODO Add trait class bookkeping test here
+
;; TODO Make this test pass
;; (phps-mode-test-ast--should-bookkeep
;; "<?php\nnamespace myNamespace;\nclass myClass\n{\n private $property1
= '';\n private $property2;\n protected function myMethod(\n
$argument1,\n $argument2,\n $argument3\n ) {\n if
($this->property2) {\n echo 'was here';\n }\n /*
@codingStandardsIgnoreEnd */\n if (\n $argument1\n
&& $argument2\n && $argument3\n && $argument4\n
&& !empty($argument1['index']) [...]
- [elpa] externals/phps-mode 6e43f9f6db 037/135: More messing around with SDT, (continued)
- [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
- [elpa] externals/phps-mode 38ccb4e728 019/135: More SDT for argument and union_type and intersection_type, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 7602348327 031/135: More SDT rules, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 7dcaa1df9e 034/135: Added SDT rules for all productions, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 258551c02a 035/135: More work on bookkeeping generation via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode e887dc91e3 043/135: Added TODO items,
Christian Johansson <=
- [elpa] externals/phps-mode 002b27bfb7 054/135: Started on bookkeeping support via SDT for class properties via object operator, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode ad3b10e716 055/135: Added variable reference to bookkeeping stack where it is referencing $this, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 911abb044e 024/135: SDT method_body, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 75743d0c25 022/135: Merge branch 'master' into feature/full-sdt, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 610358e2ef 026/135: SDT for property, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 4981a1eb45 032/135: SDT rules up to 520, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode b2454f1967 058/135: Bookkeeping of static class property, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 962b905ca0 057/135: Bookkeeping working for class non-static properties, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 7b9f8011f1 056/135: More testing, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode e2f2c86e18 059/135: Improved class properties bookkeeping test, Christian Johansson, 2023/01/29