emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/phps-mode 9a45a530d0 100/135: Passing more imenu tests


From: Christian Johansson
Subject: [elpa] externals/phps-mode 9a45a530d0 100/135: Passing more imenu tests
Date: Sun, 29 Jan 2023 03:11:08 -0500 (EST)

branch: externals/phps-mode
commit 9a45a530d01201720dd6340a4fc1133b2fd3a589
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Passing more imenu tests
---
 phps-mode-ast.el           | 1 +
 test/phps-mode-test-ast.el | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/phps-mode-ast.el b/phps-mode-ast.el
index 668fd3f9b6..f38af310d2 100644
--- a/phps-mode-ast.el
+++ b/phps-mode-ast.el
@@ -69,6 +69,7 @@
 
     (message "\nTranslation:\n%S\n\n" translation)
 
+    ;; TODO Should sort this by position
     (setq
      phps-mode-parser-sdt-symbol-imenu
      (nreverse phps-mode-parser-sdt-symbol-imenu))
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 38ec7d2925..b7bee26e20 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -156,12 +156,13 @@
   (phps-mode-test-ast--should-bookkeep
    "<?php\n\n// Super-globals\n\nif ($_GET) {\n    echo 'Hit';\n}\nif ($_POST) 
{\n    echo 'Hit';\n}\nif ($_COOKIE) {\n    echo 'Hit';\n}\nif ($_SESSION) {\n  
  echo 'Hit';\n}\nif ($_REQUEST) {\n    echo 'Hit';\n}\nif ($GLOBALS) {\n    
echo 'Hit';\n}\nif ($_SERVER) {\n    echo 'Hit';\n}\nif ($_FILES) {\n    echo 
'Hit';\n}\nif ($_ENV) {\n    echo 'Hit';\n}\nif ($argc) {\n    echo 
'Hit';\n}\nif ($argv) {\n    echo 'Hit';\n}\nif ($http_​response_​header) {\n   
 echo 'Hit';\n}"
    "Bookkeeping of super-globals"
-   '(((30 35) 1) ((61 67) 1) ((93 101) 1) ((127 136) 1) ((162 171) 1) ((197 
205) 1) ((231 239) 1) ((265 272) 1) ((298 303) 1) ((329 334) 1) ((360 365) 1) 
((391 414) 1)))
+   '(((30 35) -1) ((61 67) -1) ((93 101) -1) ((127 136) -1) ((162 171) -1) 
((197 205) -1) ((231 239) -1) ((265 272) -1) ((298 303) -1) ((329 334) -1) 
((360 365) -1) ((391 414) -1)))
 
   (phps-mode-test-ast--should-bookkeep
    "<?php\n\nnamespace myNamespaceA {\n    $var = 123;\n    class myClassA {\n 
       private $var2 = 123;\n        public static function myFunctionA($var3) 
{\n            $var4 = 123;\n            if ($var) {\n                echo 
'Miss';\n            }\n            if ($var2) {\n                echo 
'Miss';\n            }\n            if ($var3) {\n                echo 'Hit';\n 
           }\n            if ($var4) {\n                echo 'Hit';\n           
 }\n        }\n\n        fun [...]
    "Bookkeeping in maximum level with namespaces, classes and functions."
-   '((" namespace myNamespaceA id $var" ((37 41))) ((37 41) 1) (" namespace 
myNamespaceA class myClassA function myFunctionB id $var5" ((485 490))) (" 
namespace myNamespaceA class myClassA function myFunctionB id $this" ((500 
941))) (" namespace myNamespaceA class myClassA function myFunctionB id $var6" 
((514 519))) (" namespace myNamespaceA class myClassA function myFunctionA id 
$var3" ((142 147))) (" namespace myNamespaceA class myClassA function 
myFunctionA id $var4" ((163 168))) (" n [...]
+   '(((37 41) 1) ((485 490) 2) ((881 886) 4) ((814 819) 2) ((746 751) 0) ((678 
683) 0) ((610 615) 0) ((543 547) 0) ((514 519) 4) ((142 147) 5) ((394 399) 6) 
((327 332) 5) ((259 264) 0) ((192 196) 0) ((163 168) 6) ((86 91) 7) ((957 961) 
1) ((999 1004) 0) ((1043 1048) 0) ((1087 1092) 0) ((1131 1136) 0) ((1175 1180) 
0) ((1243 1248) 8) ((2088 2094) 9) ((2894 2900) 9) ((2826 2832) 11) ((2757 
2763) 0) ((2689 2694) 0) ((2621 2626) 0) ((2553 2558) 0) ((2486 2491) 0) ((2419 
2424) 0) ((2351 2356)  [...]
+   '(("namespace myNamespaceA id $var" . 37) ("namespace myNamespaceAclass 
myClassAfunction myFunctionB id $var5" . 485) ("namespace myNamespaceAclass 
myClassAfunction myFunctionB id $this" . 500) ("namespace myNamespaceAclass 
myClassAfunction myFunctionB id $var6" . 514) ("namespace myNamespaceAclass 
myClassAfunction myFunctionA id $var3" . 142) ("namespace myNamespaceAclass 
myClassAfunction myFunctionA id $var4" . 163) ("namespace myNamespaceAclass 
myClassA id $var2" . 86) ("namespace  [...]
 
   (phps-mode-test-ast--should-bookkeep
    "<?php\n\n// Conditional assignments\n\n$items = array(1, 2, 3);\nforeach 
($items as $item) {\n    if ($item) {\n        echo 'Hit';\n    }\n}\nforeach 
($items as $key => $value) {\n    if ($key || $value) {\n        echo 'Hit';\n  
  }\n}\nfor ($i = 0; $i < count($items); $i++) {\n    if ($i) {\n        echo 
'Hit';\n    }\n}\nif ($a = 123) {\n    if ($a) {\n        echo 'Hit';\n    
}\n}\nwhile ($b = 123) {\n    if ($a) {\n        echo 'Hit';\n    }\n}\ndo {\n  
  echo 'Hit';\n} while ( [...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]