[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 4e021b8413 046/212: Bookkeeping via AST now p
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 4e021b8413 046/212: Bookkeeping via AST now passing method calls |
Date: |
Wed, 26 Jan 2022 01:50:39 -0500 (EST) |
branch: externals/phps-mode
commit 4e021b8413a3731f27408183f8c8276cc11b0f9c
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Bookkeeping via AST now passing method calls
---
phps-mode-ast-bookkeeping.el | 12 +++++----
phps-mode-parser-sdt.el | 63 +++++++++++++++++++++++++++++++++++++-------
test/phps-mode-test-ast.el | 2 +-
3 files changed, 62 insertions(+), 15 deletions(-)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index 2bd8fe7f2d..bd645fafcd 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -223,8 +223,8 @@
(let ((name (plist-get item 'name))
(sub-scope scope))
(push `(type function name ,name) sub-scope)
- (when-let ((parameters (reverse (plist-get item 'parameters))))
- (dolist (parameter parameters)
+ (when-let ((parameter-list (reverse (plist-get item
'parameter-list))))
+ (dolist (parameter parameter-list)
(let ((id
(phps-mode-ast-bookkeeping--generate-variable-scope-string
sub-scope
@@ -260,8 +260,8 @@
this-id
1
bookkeeping))
- (when-let ((parameters (reverse (plist-get item 'parameters))))
- (dolist (parameter parameters)
+ (when-let ((parameter-list (reverse (plist-get item
'parameter-list))))
+ (dolist (parameter parameter-list)
(let ((id
(phps-mode-ast-bookkeeping--generate-variable-scope-string
sub-scope
@@ -388,7 +388,9 @@
defined
bookkeeping)))
- ((equal type 'assign-variable)
+ ((and
+ (equal type 'assign-variable)
+ (plist-get (plist-get item 'key) 'name))
(let ((id
(phps-mode-ast-bookkeeping--generate-variable-scope-string
scope
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index c4eb35190b..2935227814 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -273,7 +273,7 @@
(car (cdr (nth 11 terminals)))
'returns-reference-p
(not (equal (nth 1 args) nil))
- 'parameters
+ 'parameter-list
(nth 5 args)
'return-type
(nth 7 args)
@@ -412,6 +412,20 @@
ast-object))
phps-mode-parser--table-translations)
+;; 262: argument_list -> ("(" ")")
+(puthash
+ 262
+ (lambda(_args _terminals)
+ nil)
+ phps-mode-parser--table-translations)
+
+;; 263: argument_list -> ("(" non_empty_argument_list possible_comma ")")
+(puthash
+ 263
+ (lambda(args _terminals)
+ (nth 1 args))
+ phps-mode-parser--table-translations)
+
;; class_statement_list -> (class_statement_list class_statement)
(puthash
276
@@ -460,7 +474,7 @@
(not (equal (nth 2 args) nil))
'name
(nth 3 args)
- 'parameters
+ 'parameter-list
(nth 6 args)
'return-type
(nth 8 args)
@@ -478,6 +492,13 @@
ast-object))
phps-mode-parser--table-translations)
+;; 302: method_body -> ("{" inner_statement_list "}")
+(puthash
+ 302
+ (lambda(args _terminals)
+ (nth 1 args))
+ phps-mode-parser--table-translations)
+
;; 304: variable_modifiers -> (T_VAR)
(puthash
304
@@ -527,13 +548,6 @@
'final)
phps-mode-parser--table-translations)
-;; 302: method_body -> ("{" inner_statement_list "}")
-(puthash
- 302
- (lambda(args _terminals)
- (nth 1 args))
- phps-mode-parser--table-translations)
-
;; property -> (T_VARIABLE backup_doc_comment)
(puthash
317
@@ -669,6 +683,37 @@
ast-object))
phps-mode-parser--table-translations)
+;; callable_variable -> (array_object_dereferencable "[" optional_expr "]")
+(puthash
+ 483
+ (lambda(args _terminals)
+ (let ((ast-object
+ (list
+ 'ast-type
+ 'callable-variable
+ 'array-object-dereferencable
+ 'array-index
+ (phps-mode-parser-sdt--get-list-of-object (nth 2 args)))))
+ ast-object))
+ phps-mode-parser--table-translations)
+
+;; callable_variable -> (array_object_dereferencable T_OBJECT_OPERATOR
property_name argument_list)
+(puthash
+ 485
+ (lambda(args _terminals)
+ (let ((ast-object
+ (list
+ 'ast-type
+ 'callable-variable
+ 'array-object-dereferencable
+ (nth 0 args)
+ 'property-name
+ (nth 2 args)
+ 'argument-list
+ (phps-mode-parser-sdt--get-list-of-object (nth 3 args)))))
+ ast-object))
+ phps-mode-parser--table-translations)
+
;; simple_variable -> (T_VARIABLE)
(puthash
492
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 6ad813295e..a4636ef861 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -441,7 +441,7 @@
(phps-mode-ast-bookkeeping--generate)
(should (equal
(phps-mode-test--hash-to-list phps-mode-ast-bookkeeping--index t)
- (list (list " class myClass function __construct id $this" 1)
(list (list 89 94) 1) (list (list 114 119) 1))))))
+ (list (list " class myClass function random id $this" 1) (list "
class myClass function __construct id $this" 1))))))
(phps-mode-test-ast--buffer-contents
"<?php\n$items = array(1, 2, 3);\nforeach ($items as &$item) {\n if
($item) {\n echo 'Hit';\n }\n}\nforeach ($items as $key => &$item2)
{\n if ($item) {\n echo 'Hit';\n }\n}"
- [elpa] externals/phps-mode 3e79319cf5 195/212: Added failing indent test, (continued)
- [elpa] externals/phps-mode 3e79319cf5 195/212: Added failing indent test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 72c692b511 210/212: Re-scan buffer interactively now clears cache and kills running threads, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 55d59ee365 207/212: More work on cache support, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 733f36a123 203/212: Added more failing indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d4f0db2c0c 211/212: Added failing bookkeeping test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode cb4d95cd7a 204/212: Passed new indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode a907f103f0 026/212: More work on AST for bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 95078e0db2 029/212: Added SDT for increment variable production, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d90b470109 035/212: Fixed bookkeeping of class property, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode bcf0c68945 038/212: AST-imenu and AST-bookkeeping now in standalone files, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 4e021b8413 046/212: Bookkeeping via AST now passing method calls,
Christian Johansson <=
- [elpa] externals/phps-mode 712f5e9f2b 049/212: Removed invalid syntax code from old bookkeeping test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1dc3b453c9 043/212: Passed bookkeeping via AST for try catch blocks, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 882e6f75dc 062/212: Work on SDT for interface methods, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 30e9fa14ff 075/212: Added a failing bookkeeping test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 16ce2acfb7 077/212: Removed debug output for bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode bc5039e32f 086/212: Created custom determine string indentation function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode daff4ad5e0 085/212: More work on indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode b82475c697 090/212: Passed token-blind indentation for multi-line class extends and implements, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2ea2360c3e 091/212: Created indent helper functions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode df91b8e433 117/212: More handling of string-doc indentation, Christian Johansson, 2022/01/26