[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 61d3e7b1e0 093/135: Passing bookkeeping test
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 61d3e7b1e0 093/135: Passing bookkeeping test but via SDT |
Date: |
Sun, 29 Jan 2023 03:11:07 -0500 (EST) |
branch: externals/phps-mode
commit 61d3e7b1e0ec6c8d1dd70bf5a26fa9f101f5b124
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passing bookkeeping test but via SDT
---
phps-mode-parser-sdt.el | 23 ++++-------------------
test/phps-mode-test-ast.el | 11 +++++------
2 files changed, 9 insertions(+), 25 deletions(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 2db915af81..6926c821ea 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -816,10 +816,12 @@
symbol-scope)))
(message
- "assign symbol uri: %S from %S + %S"
+ "assign symbol uri: %S from %S + %S, start: %S, end: %S"
symbol-uri
symbol-name
- symbol-scope)
+ symbol-scope
+ symbol-start
+ symbol-end)
(if (gethash symbol-uri phps-mode-parser-sdt-bookkeeping)
(puthash
@@ -3783,23 +3785,6 @@
(puthash
340
(lambda(args terminals)
- ;; Save variable declaration in bookkeeping buffer
- (let* ((symbol-name
- (nth 0 args))
- (symbol-start
- (car (cdr (car terminals))))
- (symbol-end
- (cdr (cdr (car terminals))))
- (symbol-scope
- phps-mode-parser-sdt--bookkeeping-namespace))
- (push
- (list
- symbol-name
- symbol-scope
- symbol-start
- symbol-end)
- phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack))
-
`(
ast-type
property-assigned-variable
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index ca213fa2ae..a464055f95 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -236,7 +236,7 @@
(phps-mode-test-ast--should-bookkeep
"<?php\n\nnamespace myNamespaceA {\n $var = 123;\n class myClassA {\n
private $var2 = 123;\n public static function myFunctionA($var3)
{\n $var4 = 123;\n if ($var) {\n echo
'Miss';\n }\n if ($var2) {\n echo
'Miss';\n }\n if ($var3) {\n echo 'Hit';\n
}\n if ($var4) {\n echo 'Hit';\n
}\n }\n\n fun [...]
"Bookkeeping in maximum level with namespaces, classes and functions."
- '((" namespace myNamespaceA id $var" ((37 41))) ((37 41) 1) (" namespace
myNamespaceA class myClassA function myFunctionB id $var5" ((485 490))) ("
namespace myNamespaceA class myClassA function myFunctionB id $this" ((500
941))) (" namespace myNamespaceA class myClassA function myFunctionB id $var6"
((514 519))) (" namespace myNamespaceA class myClassA function myFunctionA id
$var3" ((142 147))) (" namespace myNamespaceA class myClassA function
myFunctionA id $var4" ((163 168))) (" n [...]
+ '((" namespace myNamespaceA id $var" ((37 41))) ((37 41) 1) (" namespace
myNamespaceA class myClassA function myFunctionB id $var5" ((485 490))) ("
namespace myNamespaceA class myClassA function myFunctionB id $this" ((500
941))) (" namespace myNamespaceA class myClassA function myFunctionB id $var6"
((514 519))) (" namespace myNamespaceA class myClassA function myFunctionA id
$var3" ((142 147))) (" namespace myNamespaceA class myClassA function
myFunctionA id $var4" ((163 168))) (" n [...]
(phps-mode-test-ast--should-bookkeep
"<?php\n\n// Conditional assignments\n\n$items = array(1, 2, 3);\nforeach
($items as $item) {\n if ($item) {\n echo 'Hit';\n }\n}\nforeach
($items as $key => $value) {\n if ($key || $value) {\n echo 'Hit';\n
}\n}\nfor ($i = 0; $i < count($items); $i++) {\n if ($i) {\n echo
'Hit';\n }\n}\nif ($a = 123) {\n if ($a) {\n echo 'Hit';\n
}\n}\nwhile ($b = 123) {\n if ($a) {\n echo 'Hit';\n }\n}\ndo {\n
echo 'Hit';\n} while ( [...]
@@ -246,7 +246,7 @@
(phps-mode-test-ast--should-bookkeep
"<?php\n\n// Class properties\n\nclass myParent {}\n\nclass myClass extends
myParent {\n private $var1 = 123;\n protected static $var2;\n public
$var3;\n var $var4;\n function __construct() {\n if ($this) {\n
echo 'Hit';\n }\n if ($this->var1) {\n echo
'Hit';\n }\n if (self::$var1) {\n echo 'Miss';\n
}\n if (self::$var2) {\n echo 'Hit';\n }\n if
(static::$var2) {\n [...]
"Bookkeeping of class properties"
- '((" class myClass function __construct id $this" ((194 743))) (" class
myClass id $var4" ((160 165))) (" class myClass id $var3" ((145 150))) (" class
myClass static id $var2" ((127 132))) (" class myClass id $var1" ((93 98) (93
98))) ((639 643) 0) ((632 637) 1) ((578 582) 1) ((571 576) 1) ((517 521) 1)
((510 515) 1) ((455 460) 1) ((392 397) 1) ((330 335) 0) ((270 274) 1) ((263
268) 1) ((208 213) 1) ((160 165) 1) ((145 150) 1) ((127 132) 1) ((93 98) 1)
((751 756) 0)))
+ '((" class myClass function __construct id $this" ((194 743))) (" class
myClass id $var4" ((160 165))) (" class myClass id $var3" ((145 150))) (" class
myClass static id $var2" ((127 132))) (" class myClass id $var1" ((93 98)))
((639 643) 0) ((632 637) 1) ((578 582) 1) ((571 576) 1) ((517 521) 1) ((510
515) 1) ((455 460) 1) ((392 397) 1) ((330 335) 0) ((270 274) 1) ((263 268) 1)
((208 213) 1) ((160 165) 1) ((145 150) 1) ((127 132) 1) ((93 98) 1) ((751 756)
0)))
(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"
@@ -366,16 +366,15 @@
(phps-mode-test-ast--should-bookkeep
"<?php\n\nclass myClass\n{\n private $tost = 'abc';\n public function
test($d)\n {\n return fn($e) => $this->tost . $d . $e;\n
}\n}\n\n$a = new myClass();\necho $a->test('def')('ghi');"
"Bookkeeping of $this reference inside arrow function inside of method"
- '((" class myClass function test id $d" ((76 78))) (" class myClass
function test id $this" ((84 139))) (" class myClass arrow 1 function test id
$e" ((104 106))) (" class myClass id $tost" ((36 41) (36 41))) ((76 78) 1)
((104 106) 1) ((130 132) 1) ((125 127) 1) ((118 122) 1) ((111 116) 1) ((36 41)
1) (" id $a" ((143 145))) ((143 145) 1) ((168 170) 1)))
-
- ;; TODO this is wrong: '(" class myClass id $var" ((35 39))) for below
+ '((" class myClass function test id $d" ((76 78))) (" class myClass
function test id $this" ((84 139))) (" class myClass arrow 1 function test id
$e" ((104 106))) (" class myClass id $tost" ((36 41))) ((76 78) 1) ((104 106)
1) ((130 132) 1) ((125 127) 1) ((118 122) 1) ((111 116) 1) ((36 41) 1) (" id
$a" ((143 145))) ((143 145) 1) ((168 170) 1)))
(phps-mode-test-ast--should-bookkeep
"<?php\n\nclass myClass\n{\n static $var = '123';\n static function
myMethod($a)\n {\n return fn($b) => self::$var . $a . $b;\n
}\n}\n\necho myClass::myMethod('4')('5');"
"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)))
+ '((" class myClass function myMethod id $a" ((78 80))) (" class myClass
arrow 1 function myMethod id $b" ((106 108))) (" class myClass static id $var"
((35 39))) ((78 80) 1) ((106 108) 1) ((131 133) 1) ((126 128) 1) ((119 123) 1)
((35 39) 1)))
;; TODO Add trait class bookkeping test here
+ ;; TODO Add test for class properties in class construct here
;; TODO Make this test pass
;; (phps-mode-test-ast--should-bookkeep
- [elpa] externals/phps-mode b68d94ee08 030/135: More SDT rules, (continued)
- [elpa] externals/phps-mode b68d94ee08 030/135: More SDT rules, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode eb07936ea8 036/135: added todo notes, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 0ca63fe2b6 041/135: Passing another bookkeeping test via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode e74d0fd634 010/135: SDT for inner_statement, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 8dc2235f17 017/135: Added SDT for if_stmt, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode d73af7968e 033/135: SDT to 538, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode 0e8923c0bd 042/135: Passed super-globals bookkeeping test via SDT, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode cc584ff4d6 061/135: Bookkeping of static class properties test passing, Christian Johansson, 2023/01/29
- [elpa] externals/phps-mode eefe70b999 072/135: Work on improving symbol URI calculation, Christian Johansson, 2023/01/29
- [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 <=
- [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, 2023/01/29
- [elpa] externals/phps-mode cffad0d620 131/135: Merge branch 'feature/full-sdt', Christian Johansson, 2023/01/29