[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 8b0ed29617 2/4: Storing referenced variable i
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 8b0ed29617 2/4: Storing referenced variable in variable assigned by reference |
Date: |
Mon, 30 Jan 2023 15:33:12 -0500 (EST) |
branch: externals/phps-mode
commit 8b0ed296173be77b0a662e3e927e3fedaeddbebb
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Storing referenced variable in variable assigned by reference
---
phps-mode-parser-sdt.el | 93 ++++++++++++++++++++++++++++++-------------------
1 file changed, 58 insertions(+), 35 deletions(-)
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 43e24dc5b0..37b6466295 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -5288,43 +5288,66 @@
360
(lambda(args terminals)
;; Save variable declaration in bookkeeping buffer
- (let ((variable-type (plist-get (nth 0 args) 'ast-type)))
+ (let ((variable-type1 (plist-get (nth 0 args) 'ast-type))
+ (variable-type2 (plist-get (nth 3 args) 'ast-type)))
(cond
- ((equal variable-type 'variable-callable-variable)
- (let* ((callable-variable (plist-get (nth 0 args) 'callable-variable))
- (callable-variable-type (plist-get callable-variable 'ast-type)))
+ ((and
+ (equal variable-type1 'variable-callable-variable)
+ (equal variable-type2 'variable-callable-variable))
+ (let* ((callable-variable1 (plist-get (nth 0 args) 'callable-variable))
+ (callable-variable-type1 (plist-get callable-variable1
'ast-type))
+ (callable-variable2 (plist-get (nth 3 args) 'callable-variable))
+ (callable-variable-type2 (plist-get callable-variable2
'ast-type)))
(cond
- ((equal callable-variable-type 'callable-variable-simple-variable)
- (let ((callable-variable-simple-variable (plist-get
callable-variable 'simple-variable)))
- (let ((callable-variable-simple-variable-type
- (plist-get
- callable-variable-simple-variable
- 'ast-type)))
- (cond
- ((equal
- callable-variable-simple-variable-type
- 'simple-variable-variable)
- (let* ((variable-name
- (plist-get
- callable-variable-simple-variable
- 'variable))
- (symbol-name
- variable-name)
- (symbol-start
- (car (cdr (car terminals))))
- (symbol-end
- (cdr (cdr (car terminals))))
- (symbol-scope
- phps-mode-parser-sdt--bookkeeping-namespace))
-
- ;; (message "declared variable from terminals: %S"
terminals)
- (push
- (list
- symbol-name
- symbol-scope
- symbol-start
- symbol-end)
-
phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack))))))))))))
+ ((and
+ (equal callable-variable-type1 'callable-variable-simple-variable)
+ (equal callable-variable-type2 'callable-variable-simple-variable))
+ (let* ((callable-variable-simple-variable1
+ (plist-get callable-variable1 'simple-variable))
+ (callable-variable-simple-variable-type1
+ (plist-get
+ callable-variable-simple-variable1
+ 'ast-type))
+ (callable-variable-simple-variable2
+ (plist-get callable-variable2 'simple-variable))
+ (callable-variable-simple-variable-type2
+ (plist-get
+ callable-variable-simple-variable2
+ 'ast-type)))
+ (cond
+ ((and
+ (equal
+ callable-variable-simple-variable-type1
+ 'simple-variable-variable)
+ (equal
+ callable-variable-simple-variable-type2
+ 'simple-variable-variable))
+ (let* ((variable-name1
+ (plist-get
+ callable-variable-simple-variable1
+ 'variable))
+ (variable-name2
+ (plist-get
+ callable-variable-simple-variable2
+ 'variable))
+ (symbol-name1
+ variable-name1)
+ (symbol-name2
+ variable-name2)
+ (symbol-start
+ (car (cdr (car terminals))))
+ (symbol-end
+ (cdr (cdr (car terminals))))
+ (symbol-scope
+ phps-mode-parser-sdt--bookkeeping-namespace))
+ (push `(reference ,symbol-name2) symbol-scope)
+ (push
+ (list
+ symbol-name1
+ symbol-scope
+ symbol-start
+ symbol-end)
+
phps-mode-parser-sdt--bookkeeping-symbol-assignment-stack)))))))))))
`(
ast-type