[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode e66abd00e5 064/212: Bookkeeping via AST passi
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode e66abd00e5 064/212: Bookkeeping via AST passing nested isset() !empty() expressions |
Date: |
Wed, 26 Jan 2022 01:50:44 -0500 (EST) |
branch: externals/phps-mode
commit e66abd00e52fd52c35aad0902017d1ff0dd5ddde
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Bookkeeping via AST passing nested isset() !empty() expressions
---
phps-mode-ast-bookkeeping.el | 4 ++--
phps-mode-parser-sdt.el | 17 +++++++++++------
test/phps-mode-test-ast.el | 6 +++---
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index dceac2a81f..f372160d7e 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -286,7 +286,7 @@
(let ((name (plist-get item 'name))
(sub-scope scope))
(push `(type function name ,name) sub-scope)
- (when-let ((parameter-list (reverse (plist-get item
'parameter-list))))
+ (when-let ((parameter-list (plist-get item 'parameter-list)))
(dolist (parameter parameter-list)
(let ((ids
(phps-mode-ast-bookkeeping--generate-variable-scope-string
@@ -345,7 +345,7 @@
1
bookkeeping))))
- (when-let ((parameter-list (reverse (plist-get item
'parameter-list))))
+ (when-let ((parameter-list (plist-get item 'parameter-list)))
(dolist (parameter parameter-list)
(let ((ids
(phps-mode-ast-bookkeeping--generate-variable-scope-string
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 957ab4a76b..bb651cf501 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -402,16 +402,21 @@
(puthash
231
(lambda(args _terminals)
- (if (listp (car (nth 0 args)))
- (nth 0 args)
- (list (nth 0 args))))
+ (nth 0 args))
+ phps-mode-parser--table-translations)
+
+; 233: non_empty_parameter_list -> (attributed_parameter)
+(puthash
+ 233
+ (lambda(args _terminals)
+ (list args))
phps-mode-parser--table-translations)
; 234: non_empty_parameter_list -> (non_empty_parameter_list ","
attributed_parameter)
(puthash
234
(lambda(args _terminals)
- (list (nth 0 args) (nth 2 args)))
+ (append (nth 0 args) (list (nth 2 args))))
phps-mode-parser--table-translations)
;; 241: parameter -> (optional_visibility_modifier
optional_type_without_static is_reference is_variadic T_VARIABLE
backup_doc_comment)
@@ -825,7 +830,7 @@
'backup-doc-comment
(nth 2 args)
'parameter-list
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ (nth 4 args)
'lexical-vars
(phps-mode-parser-sdt--get-list-of-object (nth 6 args))
'return-type
@@ -856,7 +861,7 @@
'backup-doc-comment
(nth 2 args)
'parameter-list
- (phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ (nth 4 args)
'return-type
(nth 6 args)
'backup-fn-flags-1
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index bf4fa56eef..9d1d02283f 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -647,7 +647,7 @@
(should
(equal
(phps-mode-test--hash-to-list phps-mode-ast-bookkeeping--index t)
- '(((50 52) 0) (" function myFunction2 id $b" 1) ((87 89) 1) ((103 105)
1) ((143 145) 1))))))
+ '((" function myFunction2 id $b" 1) ((87 89) 1) ((103 105) 1) ((143
145) 1))))))
(phps-mode-test-ast--buffer-contents
"<?php\n\n$a = array(1, 2, 3);\nforeach ($a as $uri => $page)\n{\n if
(isset($pages)) {\n if ($a) {\n echo 'Hit';\n }\n
if ($uri) {\n echo 'Hit';\n }\n if ($page) {\n
echo 'Hit';\n }\n }\n}\n"
@@ -691,7 +691,7 @@
(should
(equal
(phps-mode-test--hash-to-list phps-mode-ast-bookkeeping--index t)
- '((" defined 1 id $b" 2) ((17 19) 1) ((28 30) 1) (" id $c" 1) ((42 44)
1) ((55 57) 1))))))
+ '((" defined 1 id $b" 2) ((17 19) 1) ((28 30) 2) (" id $c" 1) ((42 44)
1) ((55 57) 1))))))
(phps-mode-test-ast--buffer-contents
"<?php\nif (!isset($a)) {\n if ($a) {\n echo 'Miss';\n }\n}"
@@ -735,7 +735,7 @@
(should
(equal
(phps-mode-test--hash-to-list phps-mode-ast-bookkeeping--index t)
- '((" function myFunction id $a" 1) ((28 30) 1) (" function myFunction
id $b" 1) ((32 34) 1) (" function myFunction id $c" 1) ((36 38) 1) (" function
myFunction id $d" 1) ((40 42) 1) (" function myFunction id $f" 1) ((57 59) 1)
(" function myFunction id $g" 1) ((61 63) 1) (" function myFunction defined 1
id $f" 1) ((79 81) 1) (" function myFunction defined 2 id $g" 1) ((105 107) 1)
((128 130) 1) ((192 194) 1) ((256 258) 1) ((320 322) 1))))))
+ '((" function myFunction id $a" 1) ((28 30) 1) (" function myFunction
id $b" 1) ((32 34) 1) (" function myFunction id $c" 1) ((36 38) 1) (" function
myFunction id $d" 1) ((40 42) 1) (" function myFunction id $f" 1) ((57 59) 1)
(" function myFunction id $g" 1) ((61 63) 1) (" function myFunction defined 1
id $f" 1) ((79 81) 1) (" function myFunction defined 1 defined 2 id $g" 1)
((105 107) 1) ((128 130) 1) ((192 194) 1) ((256 258) 1) ((320 322) 1))))))
(phps-mode-test-ast--buffer-contents
"<?php\n\n$var = 123;\n\nfunction test($abc) {\n static $var;\n if
($var) {\n echo 'Hit';\n }\n}"
- [elpa] externals/phps-mode d072fe5315 136/212: Improved indentation around array elements, (continued)
- [elpa] externals/phps-mode d072fe5315 136/212: Improved indentation around array elements, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f880ba2d62 164/212: Improved indentation on lines after assignment that ends with closing bracket, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode db019887af 170/212: Passed new indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 781356557c 194/212: More adjustments to indent helper to find previous command, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 0735959c08 209/212: Using silent cache write, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e3bf9e8fed 059/212: SDT rules for some more infix operations, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 2bc31a0f83 065/212: Added TODO items, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d802a669c0 061/212: Bookkeeping via AST working with isset() and !empty() scoped variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d9115ec583 069/212: Cleaned up AST bookkeeping tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f4d2164f8b 067/212: Bookkeeping via parser SDT passing static variables in function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e66abd00e5 064/212: Bookkeeping via AST passing nested isset() !empty() expressions,
Christian Johansson <=
- [elpa] externals/phps-mode 8b5ce22d87 072/212: Fixed issue with SDT for return statement, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 491c82a2a1 071/212: Added TODO item for bookkeeping via AST, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5ec32f5f5a 076/212: Bookkeeping via AST passing all tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 228f212127 080/212: Starting on removing the old process tokens in string function, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 5b1f5b4774 079/212: Improved format of SDT, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3f3a8bb0fa 081/212: Major refactor of indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode b469f0ffbb 088/212: Passing indentation for multi-line class implements, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f69df4fdf6 083/212: Moved indentation to separate file and test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 481deb6331 082/212: More work on indentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode fe9cb90c44 097/212: Passing indent test for some multi-line assignments, Christian Johansson, 2022/01/26