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

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

[elpa] externals/phps-mode 685375c 31/62: Passing all unit tests after u


From: Christian Johansson
Subject: [elpa] externals/phps-mode 685375c 31/62: Passing all unit tests after updated lex-analyzer
Date: Tue, 20 Apr 2021 10:56:18 -0400 (EDT)

branch: externals/phps-mode
commit 685375c3f0abc87a0cede689aa9efae274539d3f
Author: Christian Johansson <christian@mediastrategi.se>
Commit: Christian Johansson <christian@mediastrategi.se>

    Passing all unit tests after updated lex-analyzer
---
 phps-mode-lex-analyzer.el           | 8 +++++---
 phps-mode-lexer.el                  | 2 +-
 test/phps-mode-test-lex-analyzer.el | 7 ++++---
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index 13867bb..2fc683e 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -1706,9 +1706,11 @@ SQUARE-BRACKET-LEVEL and ROUND-BRACKET-LEVEL."
                     (setq imenu-namespace-index '())
                     (setq imenu-in-namespace-declaration nil))
 
-                   ((and (or (equal token 'T_NAME_RELATIVE)
-                             (equal token 'T_NAME_FULLY_QUALIFIED)
-                             (equal token 'T_NAME_QUALIFIED))
+                   ((and (or
+                          (equal token 'T_STRING)
+                          (equal token 'T_NAME_RELATIVE)
+                          (equal token 'T_NAME_FULLY_QUALIFIED)
+                          (equal token 'T_NAME_QUALIFIED))
                          (setq
                           imenu-in-namespace-name
                           (concat
diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el
index 6d4fd71..e5cdb04 100644
--- a/phps-mode-lexer.el
+++ b/phps-mode-lexer.el
@@ -1070,7 +1070,7 @@
         (looking-at (concat phps-mode-lexer--label "[\\[}]")))
        (let* ((start (match-beginning 0))
               (end (1- (match-end 0)))
-              (data (buffer-substring-no-properties start end)))
+              (_data (buffer-substring-no-properties start end)))
          (phps-mode-lexer--yyless 1)
          (phps-mode-lexer--yy-pop-state)
          (phps-mode-lexer--yy-push-state 'ST_IN_SCRIPTING)
diff --git a/test/phps-mode-test-lex-analyzer.el 
b/test/phps-mode-test-lex-analyzer.el
index 677ba4f..64af009 100644
--- a/test/phps-mode-test-lex-analyzer.el
+++ b/test/phps-mode-test-lex-analyzer.el
@@ -1414,9 +1414,10 @@
   (phps-mode-test--with-buffer
    "<?php\n\nnamespace myNamespaceA {\n    $var = 123;\n    class myClassA {\n 
       private $var2 = 123;\n        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        
function myFuncti [...]
    "Bookkeeping in maximum level with namespaces, classes and functions."
-   (should (equal
-            (phps-mode-test--hash-to-list 
(phps-mode-lex-analyzer--get-bookkeeping) 1)
-            (list (list " id $var" 1) (list (list 37 41) 1) (list " namespace 
myNamespaceA class myClassA id $var2" 1) (list (list 86 91) 1) (list " 
namespace myNamespaceA class myClassA function myFunctionA id $this" 1) (list " 
namespace myNamespaceA class myClassA function myFunctionA id $var3" 1) (list 
(list 128 133) 1) (list " namespace myNamespaceA class myClassA function 
myFunctionA id $var4" 1) (list (list 149 154) 1) (list (list 178 182) 0) (list 
(list 245 250) 0) (list (list 313 [...]
+   (should
+    (equal
+     (phps-mode-test--hash-to-list (phps-mode-lex-analyzer--get-bookkeeping) 1)
+     (list (list " id $var" 1) (list (list 37 41) 1) (list " namespace 
myNamespaceA class myClassA id $var2" 1) (list (list 86 91) 1) (list " 
namespace myNamespaceA class myClassA function myFunctionA id $this" 1) (list " 
namespace myNamespaceA class myClassA function myFunctionA id $var3" 1) (list 
(list 128 133) 1) (list " namespace myNamespaceA class myClassA function 
myFunctionA id $var4" 1) (list (list 149 154) 1) (list (list 178 182) 0) (list 
(list 245 250) 0) (list (list 313 318) 1 [...]
 
   (phps-mode-test--with-buffer
    "<?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]