[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 882e6f75dc 062/212: Work on SDT for interface
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 882e6f75dc 062/212: Work on SDT for interface methods |
Date: |
Wed, 26 Jan 2022 01:50:44 -0500 (EST) |
branch: externals/phps-mode
commit 882e6f75dc03ffb5fa45cea68bfc98629515e856
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Work on SDT for interface methods
---
phps-mode-ast-bookkeeping.el | 15 +++++++++++++--
phps-mode-parser-sdt.el | 19 ++++++++++++++++---
2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index 35a14eb3d7..79946fbec7 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -50,7 +50,8 @@
scope-name))))
((and
- (equal scope-type 'class)
+ (or (equal scope-type 'class)
+ (equal scope-type 'interface))
scope-name)
(setq
scope-string
@@ -131,7 +132,8 @@
scope-name))
((and
- (equal scope-type 'class)
+ (or (equal scope-type 'class)
+ (equal scope-type 'interface))
scope-name)
(if namespace
(setq
@@ -314,6 +316,7 @@
(push `(type function name ,name) sub-scope)
;; TODO should only do this is method is not static
+ ;; TODO should only do this if method is not in a interface class
(let ((this-ids
(phps-mode-ast-bookkeeping--generate-variable-scope-string
sub-scope
@@ -363,6 +366,14 @@
(dolist (child children)
(push `(,sub-scope ,child) bookkeeping-stack)))))
+ ((equal type 'interface)
+ (let ((name (plist-get item 'name))
+ (sub-scope scope))
+ (push `(type interface name ,name) sub-scope)
+ (when-let ((children (reverse (plist-get item 'children))))
+ (dolist (child children)
+ (push `(,sub-scope ,child) bookkeeping-stack)))))
+
((equal type 'if)
(let* ((conditions (reverse (plist-get item 'condition)))
(condition-stack conditions)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 0a20e3414e..fc47b97d72 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -530,19 +530,32 @@
'return-type
(nth 8 args)
'children
- (phps-mode-parser-sdt--get-list-of-object (nth 10 args))
+ (if (nth 10 args)
+ (phps-mode-parser-sdt--get-list-of-object (nth 10 args))
+ nil)
'index
(car (cdr (nth 3 terminals)))
'start
- (car (cdr (car (nth 10 terminals))))
+ (if (nth 10 args)
+ (car (cdr (car (nth 10 terminals))))
+ nil)
'end
- (cdr (cdr (car (cdr (cdr (nth 10 terminals)))))))))
+ (if (nth 10 args)
+ (cdr (cdr (car (cdr (cdr (nth 10 terminals))))))
+ nil))))
;; (message "Method: %S" ast-object)
;; (message "args: %S" args)
;; (message "terminals: %S" terminals)
ast-object))
phps-mode-parser--table-translations)
+;; 301: method_body -> (";")
+(puthash
+ 301
+ (lambda(_args _terminals)
+ nil)
+ phps-mode-parser--table-translations)
+
;; 302: method_body -> ("{" inner_statement_list "}")
(puthash
302
- [elpa] externals/phps-mode 733f36a123 203/212: Added more failing indentation tests, (continued)
- [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, 2022/01/26
- [elpa] externals/phps-mode 882e6f75dc 062/212: Work on SDT for interface methods,
Christian Johansson <=
- [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
- [elpa] externals/phps-mode 3565c7efb3 125/212: Fixed byte-compilation warnings for indent file, Christian Johansson, 2022/01/26