branch: externals/phps-mode
commit 26b8d5cc97d4a82a23df0fb894037e721f7d93ae
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Added bookkeeping support for super-globals
---
phps-mode-ast.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/phps-mode-ast.el b/phps-mode-ast.el
index cfe794c1d7..7d3a37f319 100644
--- a/phps-mode-ast.el
+++ b/phps-mode-ast.el
@@ -45,6 +45,10 @@
nil
"Tree for current buffer.")
+(defvar
+ phps-mode-ast--superglobal-variable-p
+ #s(hash-table size 12 test equal rehash-size 1.5 rehash-threshold 0.8125
data ("$_GET" 1 "$_POST" 1 "$_COOKIE" 1 "$_SESSION" 1 "$_REQUEST" 1 "$GLOBALS"
1 "$_SERVER" 1 "$_FILES" 1 "$_ENV" 1 "$argc" 1 "$argv" 1
"$http_​response_​header" 1))
+ "Hash-table of super-global variables.")
;; Syntax directed translation for grammar
@@ -517,6 +521,14 @@
(setq
defined-p
1))
+
+ ;; Is a super-global variable?
+ (when (gethash
+ (plist-get item 'name)
+ phps-mode-ast--superglobal-variable-p)
+ (setq
+ defined-p
+ 1))
(puthash
object
defined-p