[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 1dc3b453c9 043/212: Passed bookkeeping via AS
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 1dc3b453c9 043/212: Passed bookkeeping via AST for try catch blocks |
Date: |
Wed, 26 Jan 2022 01:50:38 -0500 (EST) |
branch: externals/phps-mode
commit 1dc3b453c9593b87df32151f6bb3c11ff66c5e83
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passed bookkeeping via AST for try catch blocks
---
phps-mode-ast-bookkeeping.el | 60 ++++++++++++++++++++++++++++++++++++++++++++
phps-mode-parser-sdt.el | 38 ++++++++++++++++++++++++++++
2 files changed, 98 insertions(+)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index fc20aea951..bc05f9deed 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -554,6 +554,66 @@
(plist-get item 'variable))
bookkeeping-stack))
+ ((equal type 'try)
+ (when-let ((children (reverse (plist-get item
'inner-statement-list))))
+ (dolist (child children)
+ (push
+ (list
+ (list
+ class
+ function
+ namespace)
+ child)
+ bookkeeping-stack)))
+ (when-let ((children (reverse (plist-get item 'catch-list))))
+ (dolist (child children)
+ (push
+ (list
+ (list
+ class
+ function
+ namespace)
+ child)
+ bookkeeping-stack)))
+ (when-let ((children (reverse (plist-get item
'finally-statement))))
+ (dolist (child children)
+ (push
+ (list
+ (list
+ class
+ function
+ namespace)
+ child)
+ bookkeeping-stack))))
+
+ ((equal type 'catch)
+ (when-let ((optional-variable (plist-get item 'optional-variable)))
+ (let ((id
+ (format
+ "%s id %s"
+ variable-namespace
+ optional-variable)))
+ (puthash
+ id
+ 1
+ bookkeeping)
+ (puthash
+ (list
+ (plist-get item 'optional-variable-start)
+ (plist-get item 'optional-variable-end))
+ 1
+ bookkeeping)))
+ (when-let ((children (reverse (plist-get item 'children))))
+ (dolist (child children)
+ (push
+ (list
+ (list
+ class
+ function
+ namespace)
+ child)
+ bookkeeping-stack))))
+
((equal type 'array-object-dereferencable)
(let* ((subject (plist-get item 'subject))
(property-name (plist-get item 'property))
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 7d883851d4..f61ab9a926 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -217,6 +217,44 @@
ast-object))
phps-mode-parser--table-translations)
+;; statement -> (T_TRY "{" inner_statement_list "}" catch_list
finally_statement)
+(puthash
+ 160
+ (lambda(args _terminals)
+ (let ((ast-object
+ (list
+ 'ast-type
+ 'try
+ 'inner-statement-list
+ (phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ 'catch-list
+ (phps-mode-parser-sdt--get-list-of-object (nth 4 args))
+ 'finally-statement
+ (nth 5 args))))
+ ast-object))
+ phps-mode-parser--table-translations)
+
+;; catch_list -> (catch_list T_CATCH "(" catch_name_list optional_variable ")"
"{" inner_statement_list "}")
+(puthash
+ 164
+ (lambda(args terminals)
+ (let ((ast-object
+ (list
+ 'ast-type
+ 'catch
+ 'catch-name-list
+ (phps-mode-parser-sdt--get-list-of-object (nth 3 args))
+ 'optional-variable
+ (nth 4 args)
+ 'optional-variable-start
+ (car (cdr (nth 4 terminals)))
+ 'optional-variable-end
+ (cdr (cdr (nth 4 terminals)))
+ 'children
+ (nth 7 args))))
+ ast-object))
+ phps-mode-parser--table-translations)
+
;; function_declaration_statement -> (function returns_ref T_STRING
backup_doc_comment "(" parameter_list ")" return_type backup_fn_flags "{"
inner_statement_list "}" backup_fn_flags)
(puthash
174
- [elpa] externals/phps-mode 55d59ee365 207/212: More work on cache support, (continued)
- [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, 2022/01/26
- [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 <=
- [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
- [elpa] externals/phps-mode 6fac0d5585 102/212: Passed indent test for heredoc string, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1af63142f3 127/212: Fixed incremental issue with new SDT based bookkeeping, Christian Johansson, 2022/01/26