[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode bb381d8127 041/212: Bookkeeping of class prop
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode bb381d8127 041/212: Bookkeeping of class properties via AST passed test |
Date: |
Wed, 26 Jan 2022 01:50:34 -0500 (EST) |
branch: externals/phps-mode
commit bb381d812780e363c9444c3fc9ad72440e2bc93a
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Bookkeeping of class properties via AST passed test
---
phps-mode-ast-bookkeeping.el | 6 ++++++
phps-mode-parser-sdt.el | 8 ++++++--
test/phps-mode-test-ast.el | 2 +-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index 7daf64317b..fc20aea951 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -563,6 +563,12 @@
(cond
((string= downcase-subject-name "$this")
+ (puthash
+ (list
+ (plist-get subject 'start)
+ (plist-get subject 'end))
+ 1
+ bookkeeping)
(let* ((sub-variable-namespace
(phps-mode-ast-bookkeeping--generate-variable-namespace
namespace
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 060e337288..7d883851d4 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -619,7 +619,7 @@
;; static_member -> (class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable)
(puthash
495
- (lambda(args _terminals)
+ (lambda(args terminals)
(let ((ast-object
(list
'ast-type
@@ -627,7 +627,11 @@
'class
(nth 0 args)
'member
- (nth 2 args))))
+ (nth 2 args)
+ 'start
+ (car (cdr (nth 0 terminals)))
+ 'end
+ (cdr (cdr (nth 0 terminals))))))
ast-object))
phps-mode-parser--table-translations)
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index ba863c74cf..6ad813295e 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -378,7 +378,7 @@
(phps-mode-ast-bookkeeping--generate)
(should (equal
(phps-mode-test--hash-to-list phps-mode-ast-bookkeeping--index t)
- '((" class myParent id $var1" 1) ((93 98) 1) (" class myParent
static id $var2" 1) ((127 132) 1) (" class myParent id $var3" 1) ((145 150) 1)
(" class myParent id $var4" 1) ((160 165) 1) (" class myParent function
__construct id $this" 1) ((208 213) 1) ((263 268) 1) ((270 274) 1) ((330 335)
0) ((392 397) 1) ((447 452) 1) ((454 458) 1) ((508 513) 1) ((515 519) 1) ((569
574) 1) ((576 580) 0) ((688 693) 0))))))
+ '((" class myClass id $var1" 1) ((93 98) 1) (" class myClass
static id $var2" 1) ((127 132) 1) (" class myClass id $var3" 1) ((145 150) 1)
(" class myClass id $var4" 1) ((160 165) 1) (" class myClass function
__construct id $this" 1) ((208 213) 1) ((263 268) 1) ((270 274) 1) ((330 335)
0) ((392 397) 1) ((447 452) 1) ((454 458) 1) ((508 513) 1) ((515 519) 1) ((569
574) 1) ((576 580) 0) ((688 693) 0))))))
(phps-mode-test-ast--buffer-contents
"<?php\n\ntry {\n \n} catch (\\Exception $e) {\n if ($e) {\n
echo 'Hit';\n }\n}\n\nif ($e) {\n echo 'Miss';\n}\n"
- [elpa] externals/phps-mode 4b4a96fda2 208/212: Improved cache filename, (continued)
- [elpa] externals/phps-mode 4b4a96fda2 208/212: Improved cache filename, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode ef97058a67 184/212: Added more tests for indentation helper functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a1af5b11fb 040/212: More work on bookkeeping of class properties via AST, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 4dc07c9041 050/212: Bookkeeping via AST working with assigned variables from array, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 4d226f18cc 048/212: Bookkeeping via AST working with referenced foreach variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5603e6266b 047/212: SDT for array values, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 787d82313e 045/212: Bookkeeping via AST now tracks variables around inline-functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a629baba89 053/212: More work on bookkeeping via AST for arrow function variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode df0b707a61 044/212: Added parser SDT for inline-function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 432382eddb 051/212: Added bookkeeping support for global variables in functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode bb381d8127 041/212: Bookkeeping of class properties via AST passed test,
Christian Johansson <=
- [elpa] externals/phps-mode e95df1027b 042/212: Reverted old tests for imenu and bookkeeping for lex-analyzer, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a65c8af308 008/212: Extract ast code into separate file and test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 23c001c33f 037/212: Moved parser SDT to separate file, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 261121f096 056/212: Fixed incorrect information in debug output in test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e8a47de694 052/212: Work on supported arrow functions for bookkeeping via AST, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5686703a6b 074/212: Passing bookkeeping via AST for $this inside arrow function body inside class method, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a9d0e941df 066/212: Started on SDT for static variables statement, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a8fecdfd68 055/212: Bookkeeping of variables inside arrow functions now working, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e42646dc3a 058/212: Added SDT for isset() and empty(), Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 9ad46d061e 057/212: Bookkeeping via AST passing two more tests, Christian Johansson, 2022/01/26