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

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

[elpa] externals/phps-mode 7c6ee3e 107/405: More work on renaming


From: Stefan Monnier
Subject: [elpa] externals/phps-mode 7c6ee3e 107/405: More work on renaming
Date: Sat, 13 Jul 2019 09:59:53 -0400 (EDT)

branch: externals/phps-mode
commit 7c6ee3ee1148c15766a4f952e8e0815244a2d875
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>

    More work on renaming
---
 phps-mode-lexer.el          |  26 +++---
 phps-mode-test-functions.el | 184 +++++++++++++++++++--------------------
 phps-mode-test-lexer.el     | 208 ++++++++++++++++++++++----------------------
 3 files changed, 209 insertions(+), 209 deletions(-)

diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el
index 24d6b68..a221c83 100644
--- a/phps-mode-lexer.el
+++ b/phps-mode-lexer.el
@@ -1260,9 +1260,9 @@ ANY_CHAR'
    ))
 
 ;; TODO Need to store lexer state and stack at each changing point of buffer 
to be able to rewind lexer
-(defun phps-mode-lexer-lex--SETUP (start end)
+(defun phps-mode-lexer-setup (start end)
   "Just prepare other lexers for lexing region START to END."
-  ;; (message "phps-mode-lexer-lex--SETUP %s %s" start end)
+  ;; (message "phps-mode-lexer-setup %s %s" start end)
   (when (and (eq start 1)
              end)
     (delete-all-overlays)
@@ -1273,16 +1273,16 @@ ANY_CHAR'
     
     (phps-mode-lexer-BEGIN phps-mode-lexer-ST_INITIAL)))
 
-(defun phps-mode-lexer-lex--RUN ()
+(defun phps-mode-lexer-run ()
   "Run lexer."
   (interactive)
   (setq phps-mode-lexer-tokens (semantic-lex-buffer)))
 
-(defun phps-mode-lexer-move-lexer-states (start diff)
+(defun phps-mode-lexer-move-states (start diff)
   "Move lexer states after (or equal to) START with modification DIFF."
-  (setq phps-mode-lexer-states (phps-mode-lexer-get-moved-lexer-states 
phps-mode-lexer-states start diff)))
+  (setq phps-mode-lexer-states (phps-mode-lexer-get-moved-states 
phps-mode-lexer-states start diff)))
 
-(defun phps-mode-lexer-get-moved-lexer-states (states start diff)
+(defun phps-mode-lexer-get-moved-states (states start diff)
   "Return moved lexer STATES after (or equal to) START with modification DIFF."
   (let ((old-states states)
         (new-states '()))
@@ -1304,7 +1304,7 @@ ANY_CHAR'
 
 (defun phps-mode-lexer-move-tokens (start diff)
   "Update tokens with moved lexer tokens after or equal to START with 
modification DIFF."
-  (setq phps-mode-lexer-tokens (phps-mode-lexer-get-moved-lexer-tokens 
phps-mode-lexer-tokens start diff)))
+  (setq phps-mode-lexer-tokens (phps-mode-lexer-get-moved-tokens 
phps-mode-lexer-tokens start diff)))
 
 (defun phps-mode-lexer-get-moved-tokens (old-tokens start diff)
   "Return moved lexer OLD-TOKENS positions after (or equal to) START with DIFF 
points."
@@ -1384,7 +1384,7 @@ ANY_CHAR'
               ;; TODO Here clear all tokens after previous-token-start and add 
new tokens to stack
               ))
         ;; (display-warning "phps-mode" (format "Found no state to rewind to 
for %s in stack %s, buffer point max: %s" change-start states (point-max)))
-        (phps-mode-lexer-lex--RUN)))
+        (phps-mode-lexer-run)))
     (setq phps-mode-lexer-buffer-changes--start nil)))
 
 (define-lex phps-mode-lexer-tags-lexer
@@ -1403,17 +1403,17 @@ ANY_CHAR'
 
   semantic-lex-default-action)
 
-(defun phps-mode-lexer-lexer-init ()
+(defun phps-mode-lexer-init ()
   "Initialize lexer."
 
-  (when (boundp 'phps-mode-lexer-syntax-table)
-    (setq semantic-lex-syntax-table phps-mode-lexer-syntax-table))
+  (when (boundp 'phps-mode-syntax-table)
+    (setq semantic-lex-syntax-table phps-mode-syntax-table))
 
   (setq semantic-lex-analyzer #'phps-mode-lexer-tags-lexer)
 
-  (add-hook 'semantic-lex-reset-functions #'phps-mode-lexer-lex--SETUP)
+  (add-hook 'semantic-lex-reset-functions #'phps-mode-lexer-setup)
 
-  (phps-mode-lexer-lex--RUN))
+  (phps-mode-lexer-run))
 
 (provide 'phps-mode-lexer)
 
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 8f989d5..844edd8 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -36,210 +36,210 @@
 
 ;; TODO Add unit tests for HEREDOC, NOWDOC as well
 
-(defun phps-mode/test-indent-line ()
+(defun phps-mode-test-functions-indent-line ()
   "Test for indentation."
 
   ;; Curly bracket tests
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) 
{\necho $title;\n\n} ?></title><body>Bla bla</body></html>"
    (goto-char 69)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<html><head><title><?php if 
($myCondition) {\n    if ($mySeconCondition) {\necho $title;\n\n} 
?></title><body>Bla bla</body></html>"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) 
{\necho $title1;\n} ?></title><body>Bla bla</body></html>"
    (goto-char 75)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<html><head><title><?php if 
($myCondition) {\nif ($mySeconCondition) {\n        echo $title1;\n} 
?></title><body>Bla bla</body></html>"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) 
{\necho $title2;\n\n} ?></title><body>Bla bla</body></html>"
    (goto-char 98)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<html><head><title><?php if 
($myCondition) {\nif ($mySeconCondition) {\necho $title2;\n\n    } 
?></title><body>Bla bla</body></html>"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) 
{\necho $title3;\n\n}\n?>\n</title><body>Bla bla</body></html>"
    (goto-char 110)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<html><head><title><?php if 
($myCondition) {\nif ($mySeconCondition) {\necho 
$title3;\n\n}\n?>\n</title><body>Bla bla</body></html>"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$variable = array(\n'random3'\n);\n$variable = true;\n"
    (goto-char 28)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<?php\n$variable = array(\n    
'random3'\n);\n$variable = true;\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$variable = array(\n    'random2'\n    );\n$variable = true;\n"
    (goto-char 43)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<?php\n$variable = array(\n    
'random2'\n);\n$variable = true;\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n/**\n* My first line\n* My second line\n**/\n"
    (goto-char 20)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<?php\n/**\n * My first line\n* My 
second line\n**/\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n/**\n* My first line\n* My second line\n**/\n"
    (goto-char 9)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<?php\n/**\n* My first line\n* My second 
line\n**/\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n/**\n* My first line\n* My second line\n**/\n"
    (goto-char 46)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<?php\n/**\n* My first line\n* My second 
line\n **/\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$variable = array(\n'random4');\n$variable = true;\n"
    (goto-char 29)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<?php\n$variable = array(\n    
'random4');\n$variable = true;\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nadd_filter(\n\"views_{$screen->id}\",'__return_empty_array'\n);"
    (goto-char 25)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nadd_filter(\n    
\"views_{$screen->id}\",'__return_empty_array'\n);"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (random_expression(\ntrue\n)) {\nsome_logic_here();\n}"
    (goto-char 36)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (random_expression(\ntrue\n)) 
{\nsome_logic_here();\n}"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (empty(\n$this->var\n) && !empty($this->var)\n) {\n$this->var = 
'abc123';\n}\n"
    (goto-char 54)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents  "<?php\nif (empty(\n$this->var\n) && 
!empty($this->var)\n) {\n$this->var = 'abc123';\n}\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (myFirstCondition()) {\n    $this->var = 'abc123';\n    } else 
{\n    $this->var = 'def456';\n}\n"
    (goto-char 68)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (myFirstCondition()) {\n    
$this->var = 'abc123';\n} else {\n    $this->var = 'def456';\n}\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (myFirstCondition()) {\n    $this->var = 'abc123';\n    } else 
if (mySeconCondition()) {\n    $this->var = 'def456';\n}\n"
    (goto-char 68)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s point %s" phps-mode/lexer-tokens (point))
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (myFirstCondition()) {\n    
$this->var = 'abc123';\n} else if (mySeconCondition()) {\n    $this->var = 
'def456';\n}\n"))))
 
   ;; Square bracket
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$var = [\n    'random' => [\n        'hello',\n],\n];\n"
    (goto-char 51)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\n$var = [\n    'random' => [\n      
  'hello',\n    ],\n];\n"))))
   
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (myRandomCondition()):\necho 'Something here';\n    else:\n    
echo 'Something else here';\nendif;\n"
    (goto-char 60)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    ;; (message "Tokens %s" phps-mode/lexer-tokens)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (myRandomCondition()):\necho 
'Something here';\nelse:\n    echo 'Something else here';\nendif;\n"))))
 
   ;; switch case
   
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nswitch (myRandomCondition()) {\ncase 'Something here':\necho 
'Something else here';\n}\n"
    (goto-char 45)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nswitch (myRandomCondition()) {\n   
 case 'Something here':\necho 'Something else here';\n}\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nswitch (myRandomCondition()) {\ncase 'Something here':\necho 
'Something else here';\n}\n"
    (goto-char 65)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nswitch (myRandomCondition()) 
{\ncase 'Something here':\n        echo 'Something else here';\n}\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (myRandomCondition())\necho 'Something here';\necho 'Something 
else here';\n"
    (goto-char 40)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (myRandomCondition())\n    echo 
'Something here';\necho 'Something else here';\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (myRandomCondition())\n    echo 'Something here';\n    echo 
'Something else here';\n"
    (goto-char 60)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (myRandomCondition())\n    echo 
'Something here';\necho 'Something else here';\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (myRandomCondition()):\necho 'Something here';\n    echo 
'Something else here';\nendif;\n"
    (goto-char 40)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (myRandomCondition()):\n    
echo 'Something here';\n    echo 'Something else here';\nendif;\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nmyFunction(\n    array(\n        'random' => 'abc',\n        ),\n   
 $var2\n);\n"
    (goto-char 50)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nmyFunction(\n    array(\n        
'random' => 'abc',\n    ),\n    $var2\n);\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$var = $var2->getHead()\n->getTail();\n"
    (goto-char 35)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\n$var = $var2->getHead()\n    
->getTail();\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$var =\n'random string';\n"
    (goto-char 20)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\n$var =\n    'random string';\n"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (empty($this->var)):\n$this->var = 'abc123';\n    endif;"
    (goto-char 60)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif 
(empty($this->var)):\n$this->var = 'abc123';\nendif;"))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (empty($this->var)):\n$this->var = 'abc123';\n    endif;"
    (goto-char 30)
-   (phps-mode/indent-line)
+   (phps-mode-functions-indent-line)
    (let ((buffer-contents (buffer-substring-no-properties (point-min) 
(point-max))))
      (should (equal buffer-contents "<?php\nif (empty($this->var)):\n    
$this->var = 'abc123';\n    endif;"))))
 
@@ -251,100 +251,100 @@
 ;; TODO Support nested square brackets [[[ ]]]
 
 
-(defun phps-mode/test-functions--get-point-data ()
+(defun phps-mode-test-functions-get-point-data ()
   "Return information about point in tokens."
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nNAMESPACE MyNameSpace;\nCLASS MyClass {\n\tpublic function 
__construct() {\n\t\texit;\n\t}\n}\n"
    (goto-char 35)
-   (should (equal (list (list t 0 0 0 0 3 nil) (list t 1 0 0 0 6 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 0 0 0 0 3 nil) (list t 1 0 0 0 6 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php echo $title; ?></title><body>Bla 
bla</body></html>"
    (goto-char 15)
-   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 5 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 5 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php echo $title; ?>\n</title><body>Bla 
bla</body></html>"
    (goto-char 50)
-   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 nil nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 nil nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title></title><body>Bla bla</body></html>"
    (goto-char 15)
-   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 nil nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 nil nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php echo $title; ?></title><body>Bla 
bla</body></html>"
    (goto-char 30)
-   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 5 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 5 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php echo $title; ?></title><body>Bla 
bla</body></html>"
    (goto-char 50)
-   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 5 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 5 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) { \n   if ($mySeconCondition) { 
echo $title; } } ?></title><body>Bla bla</body></html>"
    (goto-char 48)
-   (should (equal (list (list t 1 0 0 0 5 nil) (list nil 0 0 0 0 17 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 1 0 0 0 5 nil) (list nil 0 0 0 0 17 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) { if ($mySeconCondition) {\n 
echo $title;\n} } ?></title><body>Bla bla</body></html>"
    (goto-char 72)
-   (should (equal (list (list t 2 0 0 0 10 nil) (list t 2 0 0 0 13 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 2 0 0 0 10 nil) (list t 2 0 0 0 13 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) {\nif ($mySeconCondition) 
{\necho $title;\n}\n}\n ?></title><body>Bla bla</body></html>"
    (goto-char 84)
-   (should (equal (list (list t 2 0 0 0 13 nil) (list t 1 0 0 0 14 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 2 0 0 0 13 nil) (list t 1 0 0 0 14 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head><title><?php if ($myCondition) { if ($mySeconCondition) { echo 
$title; } } ?></title><body>Bla bla</body></html>"
    (goto-char 100)
-   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 17 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list nil 0 0 0 0 nil nil) (list nil 0 0 0 0 17 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php /**\n * My first line\n * My second line\n **/"
    (goto-char 20)
-   (should (equal (list (list t 0 0 0 0 nil t) (list t 0 0 0 0 nil t)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 0 0 0 0 nil t) (list t 0 0 0 0 nil t)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php /**\n * My first line\n * My second line\n **/"
    (goto-char 9)
-   (should (equal (list (list nil 0 0 0 0 nil nil) (list t 0 0 0 0 1 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list nil 0 0 0 0 nil nil) (list t 0 0 0 0 1 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php /**\n * My first line\n * My second line\n **/"
    (goto-char 50)
-   (should (equal (list (list t 0 0 0 0 nil t) (list t 0 0 0 0 nil t)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 0 0 0 0 nil t) (list t 0 0 0 0 nil t)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$variable = array(\n'random4');\n$variable = true;\n"
    (goto-char 29)
-   (should (equal (list (list t 0 1 0 0 4 nil) (list t 0 0 0 0 7 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 0 1 0 0 4 nil) (list t 0 0 0 0 7 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nif (empty(\n$this->var\n) && !empty($this->var)\n) {\n$this->var = 
'abc123';\n}\n"
    (goto-char 54)
-   (should (equal (list (list t 0 1 0 0 16 nil) (list t 1 0 0 0 18 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 0 1 0 0 16 nil) (list t 1 0 0 0 18 nil)) 
(phps-mode-functions-get-point-data))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n$var = [\n    'random' => [\n        'hello',\n    ],\n];\n"
    (goto-char 46)
-   (should (equal (list (list t 0 0 2 0 6 nil) (list t 0 0 2 0 8 nil)) 
(phps-mode/get-point-data))))
+   (should (equal (list (list t 0 0 2 0 6 nil) (list t 0 0 2 0 8 nil)) 
(phps-mode-functions-get-point-data))))
 
   )
 
-
 ;; TODO Add tests for all examples here: https://www.php-fig.org/psr/psr-2/
 
 (defun phps-mode-test-functions ()
   "Run test for functions."
-  (phps-mode/test-functions--get-point-data)
-  (phps-mode/test-indent-line))
+  ;; (toggle-debug-on-error t)
+  (phps-mode-test-functions-get-point-data)
+  (phps-mode-test-functions-indent-line))
 
-(phps-mod/test-functions)
+(phps-mode-test-functions)
 
 (provide 'phps-mode-test-functions)
 
diff --git a/phps-mode-test-lexer.el b/phps-mode-test-lexer.el
index 5a24387..10f870c 100644
--- a/phps-mode-test-lexer.el
+++ b/phps-mode-test-lexer.el
@@ -35,234 +35,234 @@
 (autoload 'phps-mode-lexer-move-lexer-tokens "phps-mode-lexer")
 (autoload 'should "ert")
 
-(defun phps-mode-test-lexer--script-boundaries ()
+(defun phps-mode-test-lexer-script-boundaries ()
   "Run test for lexer."
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\t$var=1; exit $var;\t?>"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 11 . 12) 
(T_LNUMBER 12 . 13) (";" 13 . 14) (T_EXIT 15 . 19) (T_VARIABLE 20 . 24) (";" 24 
. 25) (";" 26 . 28) (T_CLOSE_TAG 26 . 28)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nexit;\n?>"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_EXIT 7 . 11) (";" 11 . 12) (";" 13 . 
15) (T_CLOSE_TAG 13 . 15)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php exit; ?>"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_EXIT 7 . 11) (";" 11 . 12) (";" 13 . 
15) (T_CLOSE_TAG 13 . 15)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<html><head>blabla</head<body>\n\n \t<?php\nexit;\n?>\n\n</body></html>"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 35 . 41) (T_EXIT 41 . 45) (";" 45 . 46) (";" 
47 . 50) (T_CLOSE_TAG 47 . 50)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "\n\n \t<html><title>echo 
\"Blaha\";</title><?php\n\n\nexit?>\n\n<html><random /></html><?php exit ?>"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 39 . 45) (T_EXIT 47 . 51) (";" 51 . 54) 
(T_CLOSE_TAG 51 . 54) (T_OPEN_TAG 78 . 84) (T_EXIT 84 . 88) (";" 89 . 91) 
(T_CLOSE_TAG 89 . 91)))))
 
   )
 
-(defun phps-mode-test-lexer--simple-tokens ()
+(defun phps-mode-test-lexer-simple-tokens ()
   "Run test for simple tokens."
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo $var = array('');"
-     (should (equal phps-mode/lexer-tokens
+     (should (equal phps-mode-lexer-tokens
                     '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_VARIABLE 12 . 16) 
("=" 17 . 18) (T_ARRAY 19 . 24) ("(" 24 . 25) (T_CONSTANT_ENCAPSED_STRING 25 . 
27) (")" 27 . 28) (";" 28 . 29)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php if 
(empty($parameters[self::PARAMETER_CONFIGURATION_INTERNAL_FILENAME])) { 
$parameters[self::PARAMETER_CONFIGURATION_INTERNAL_FILENAME] = ''; }"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_IF 7 . 9) ("(" 10 . 11) (T_EMPTY 11 
. 16) ("(" 16 . 17) (T_VARIABLE 17 . 28) ("[" 28 . 29) (T_STRING 29 . 33) 
(T_PAAMAYIM_NEKUDOTAYIM 33 . 35) (T_STRING 35 . 76) ("]" 76 . 77) (")" 77 . 78) 
(")" 78 . 79) ("{" 80 . 81) (T_VARIABLE 82 . 93) ("[" 93 . 94) (T_STRING 94 . 
98) (T_PAAMAYIM_NEKUDOTAYIM 98 . 100) (T_STRING 100 . 141) ("]" 141 . 142) ("=" 
143 . 144) (T_CONSTANT_ENCAPSED_STRING 145 . 147) (";" 147 . 148) ("}" 149 . 
150)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo $var = array(\"\");"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_VARIABLE 12 . 16) 
("=" 17 . 18) (T_ARRAY 19 . 24) ("(" 24 . 25) (T_CONSTANT_ENCAPSED_STRING 25 . 
27) (")" 27 . 28) (";" 28 . 29)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo $var = array('abc' => '123');"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_VARIABLE 12 . 16) 
("=" 17 . 18) (T_ARRAY 19 . 24) ("(" 24 . 25) (T_CONSTANT_ENCAPSED_STRING 25 . 
30) (T_DOUBLE_ARROW 31 . 33) (T_CONSTANT_ENCAPSED_STRING 34 . 39) (")" 39 . 40) 
(";" 40 . 41)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $var = []; "
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) ("[" 
14 . 15) ("]" 15 . 16) (";" 16 . 17)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $var = ''; $var = 'abc'; "
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) 
(T_CONSTANT_ENCAPSED_STRING 14 . 16) (";" 16 . 17) (T_VARIABLE 18 . 22) ("=" 23 
. 24) (T_CONSTANT_ENCAPSED_STRING 25 . 30) (";" 30 . 31)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nswitch (myRandomCondition()) {\ncase 'Something here':\necho 
'Something else here';\n}\n"
-   ;; (message "Tokens: %s" phps-mode/lexer-tokens)
-   (should (equal phps-mode/lexer-tokens
+   ;; (message "Tokens: %s" phps-mode-lexer-tokens)
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_SWITCH 7 . 13) ("(" 14 . 15) 
(T_STRING 15 . 32) ("(" 32 . 33) (")" 33 . 34) (")" 34 . 35) ("{" 36 . 37) 
(T_CASE 38 . 42) (T_CONSTANT_ENCAPSED_STRING 43 . 59) (":" 59 . 60) (T_ECHO 61 
. 65) (T_CONSTANT_ENCAPSED_STRING 66 . 87) (";" 87 . 88) ("}" 89 . 90)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $var = \"\"; $var = \"abc\"; $var = \"abc\\def\\ghj\";"
-   ;; (message "Tokens: %s" phps-mode/lexer-tokens)
-   (should (equal phps-mode/lexer-tokens
+   ;; (message "Tokens: %s" phps-mode-lexer-tokens)
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) 
(T_CONSTANT_ENCAPSED_STRING 14 . 16) (";" 16 . 17) (T_VARIABLE 18 . 22) ("=" 23 
. 24) (T_CONSTANT_ENCAPSED_STRING 25 . 30) (";" 30 . 31) (T_VARIABLE 32 . 36) 
("=" 37 . 38) (T_CONSTANT_ENCAPSED_STRING 39 . 52) (";" 52 . 53)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo isset($backtrace[1]['file']) ? 'yes' : 'no'; "
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_ISSET 12 . 17) ("(" 
17 . 18) (T_VARIABLE 18 . 28) ("[" 28 . 29) (T_LNUMBER 29 . 30) ("]" 30 . 31) 
("[" 31 . 32) (T_CONSTANT_ENCAPSED_STRING 32 . 38) ("]" 38 . 39) (")" 39 . 40) 
("?" 41 . 42) (T_CONSTANT_ENCAPSED_STRING 43 . 48) (":" 49 . 50) 
(T_CONSTANT_ENCAPSED_STRING 51 . 55) (";" 55 . 56)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php myFunction(); "
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_STRING 7 . 17) ("(" 17 . 18) (")" 18 
. 19) (";" 19 . 20)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php // echo 'random';?><!--</div>-->"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_COMMENT 7 . 24) (";" 24 . 26) 
(T_CLOSE_TAG 24 . 26)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php //echo $contact_position;?><!--</div>-->"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_COMMENT 7 . 32) (";" 32 . 34) 
(T_CLOSE_TAG 32 . 34)))))
 
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo isset($backtrace[1]['file']) ? 'yes' : 'no';\n//a random 
comment\n// another random comment\n/**\n * More comments\n* More\n **/\necho 
$backtrace; ?>"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_ISSET 12 . 17) ("(" 
17 . 18) (T_VARIABLE 18 . 28) ("[" 28 . 29) (T_LNUMBER 29 . 30) ("]" 30 . 31) 
("[" 31 . 32) (T_CONSTANT_ENCAPSED_STRING 32 . 38) ("]" 38 . 39) (")" 39 . 40) 
("?" 41 . 42) (T_CONSTANT_ENCAPSED_STRING 43 . 48) (":" 49 . 50) 
(T_CONSTANT_ENCAPSED_STRING 51 . 55) (";" 55 . 56) (T_COMMENT 57 . 75) 
(T_COMMENT 76 . 101) (T_DOC_COMMENT 102 . 134) (T_ECHO 135 . 139) (T_VARIABLE 
140 . 150) (";" 150 . 151) (";" 152 . 154)  [...]
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $var EXIT die function return yield from yield try catch finally 
throw if elseif endif else while endwhile do for endfor foreach endforeach 
declare enddeclare instanceof as switch endswitch case default break continue 
goto echo print class interface trait extends implements :: \\ ... ?? new clone 
var (int) (integer) (real) (double) (float) (string) (binary) (array) (object) 
(boolean) (bool) (unset) eval include include_once require require_once 
namespace use insteadof global is [...]
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) (T_EXIT 12 . 16) 
(T_DIE 17 . 20) (T_FUNCTION 21 . 29) (T_RETURN 30 . 36) (T_YIELD_FROM 37 . 48) 
(T_YIELD 48 . 53) (T_TRY 54 . 57) (T_CATCH 58 . 63) (T_FINALLY 64 . 71) 
(T_THROW 72 . 77) (T_IF 78 . 80) (T_ELSEIF 81 . 87) (T_ENDIF 88 . 93) (T_ELSE 
94 . 98) (T_WHILE 99 . 104) (T_ENDWHILE 105 . 113) (T_DO 114 . 116) (T_FOR 117 
. 120) (T_ENDFOR 121 . 127) (T_FOREACH 128 . 135) (T_ENDFOREACH 136 . 146) 
(T_DECLARE 147 . 154) (T_ENDDECLA [...]
 
   )
 
-(defun phps-mode-test-lexer--complex-tokens ()
+(defun phps-mode-test-lexer-complex-tokens ()
   "Run test for complex tokens."
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $var->property;"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) (T_OBJECT_OPERATOR 
11 . 13) (T_STRING 13 . 21) (";" 21 . 22)))))
 
   ;; Double quoted strings with variables
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo \"My $variable is here\"; echo \"you know\";"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) ("\"" 12 . 13) 
(T_ENCAPSED_AND_WHITESPACE 13 . 16) (T_VARIABLE 16 . 25) 
(T_CONSTANT_ENCAPSED_STRING 25 . 33) ("\"" 33 . 34) (";" 34 . 35) (T_ECHO 36 . 
40) (T_CONSTANT_ENCAPSED_STRING 41 . 51) (";" 51 . 52)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo \"My ${variable} is here 1\";"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) ("\"" 12 . 13) 
(T_ENCAPSED_AND_WHITESPACE 13 . 16) (T_DOLLAR_OPEN_CURLY_BRACES 16 . 18) 
(T_STRING_VARNAME 18 . 26) ("}" 26 . 27) (T_CONSTANT_ENCAPSED_STRING 27 . 37) 
("\"" 37 . 38) (";" 38 . 39)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo \"Mine {$first_variable} is here and my $second is there.\";"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) ("\"" 12 . 13) 
(T_ENCAPSED_AND_WHITESPACE 13 . 18) (T_CURLY_OPEN 18 . 19) (T_VARIABLE 19 . 34) 
("}" 34 . 35) (T_CONSTANT_ENCAPSED_STRING 35 . 51) (T_VARIABLE 51 . 58) 
(T_CONSTANT_ENCAPSED_STRING 58 . 68) ("\"" 68 . 69) (";" 69 . 70)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo \" Hello $variable[0], how are you?\";"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) ("\"" 12 . 13) 
(T_ENCAPSED_AND_WHITESPACE 13 . 20) (T_VARIABLE 20 . 30) (T_NUM_STRING 30 . 31) 
("]" 31 . 32) (T_CONSTANT_ENCAPSED_STRING 32 . 46) ("\"" 46 . 47) (";" 47 . 
48)))))
 
   ;; Heredoc
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo <<<\"MYLABEL\"\nline 1\n line 2\nMYLABEL\n;"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_START_HEREDOC 12 . 
25) (T_ENCAPSED_AND_WHITESPACE 25 . 39) (T_END_HEREDOC 39 . 47) (";" 48 . 
49)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo <<<MYLABEL\nline 1\n line 2\nMYLABEL\n;"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_START_HEREDOC 12 . 
23) (T_ENCAPSED_AND_WHITESPACE 23 . 37) (T_END_HEREDOC 37 . 45) (";" 46 . 
47)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo <<<\"MYLABEL\"\nMYLABEL\n"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_START_HEREDOC 12 . 
25) (T_END_HEREDOC 25 . 33)))))
 
   ;; Test heredoc with variables $, {$, ${ here
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo <<<\"MYLABEL\"\nline 1 $variable1\n line 2\n${variable2} line 
3\n line {$variable3} here\nline 5 $variable[3] here\nMYLABEL;\n"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_START_HEREDOC 12 . 
25) (T_ENCAPSED_AND_WHITESPACE 25 . 32) (T_VARIABLE 32 . 42) 
(T_ENCAPSED_AND_WHITESPACE 42 . 51) (T_DOLLAR_OPEN_CURLY_BRACES 51 . 53) 
(T_STRING_VARNAME 53 . 62) ("}" 62 . 63) (T_ENCAPSED_AND_WHITESPACE 63 . 77) 
(T_CURLY_OPEN 77 . 78) (T_VARIABLE 78 . 88) ("}" 88 . 89) 
(T_ENCAPSED_AND_WHITESPACE 89 . 102) (T_VARIABLE 102 . 112) (T_NUM_STRING 112 . 
113) ("]" 113 . 114) (T_ENCAPSED_AND_WHITESPACE 114 . 119) (T_END_ [...]
 
   ;; Nowdoc
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php echo <<<'MYLABEL'\nline 1\n line 2\nMYLABEL;\n"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_START_HEREDOC 12 . 
25) (T_ENCAPSED_AND_WHITESPACE 25 . 39) (T_END_HEREDOC 39 . 47) (";" 47 . 
48)))))
 
   ;; Backquotes
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php `echo \"HELLO\"`;"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) ("`" 7 . 8) (T_CONSTANT_ENCAPSED_STRING 
8 . 20) ("`" 20 . 21) (";" 21 . 22)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php `echo \"HELLO $variable or {$variable2} or ${variable3} or 
$variable[index][0] here\"`;"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) ("`" 7 . 8) (T_CONSTANT_ENCAPSED_STRING 
8 . 20) (T_VARIABLE 20 . 29) (T_CONSTANT_ENCAPSED_STRING 29 . 33) (T_CURLY_OPEN 
33 . 34) (T_VARIABLE 34 . 44) ("}" 44 . 45) (T_CONSTANT_ENCAPSED_STRING 45 . 
49) (T_DOLLAR_OPEN_CURLY_BRACES 49 . 51) (T_STRING_VARNAME 51 . 60) ("}" 60 . 
61) (T_CONSTANT_ENCAPSED_STRING 61 . 65) (T_VARIABLE 65 . 75) (T_STRING 75 . 
80) ("]" 80 . 81) (T_CONSTANT_ENCAPSED_STRING 81 . 90) ("`" 90 . 91) (";" 91 . 
92)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $wpdb->posts; ?>"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 12) (T_OBJECT_OPERATOR 
12 . 14) (T_STRING 14 . 19) (";" 19 . 20) (";" 21 . 23) (T_CLOSE_TAG 21 . 
23)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $var = \"SELECT post_parent FROM $wpdb->posts WHERE ID = 
'\".$id.\"'\"; ?>"
-   ;; (message "Tokens 1: %s" phps-mode/lexer-tokens)
-   (should (equal phps-mode/lexer-tokens
+   ;; (message "Tokens 1: %s" phps-mode-lexer-tokens)
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 11) ("=" 12 . 13) ("\"" 
14 . 15) (T_ENCAPSED_AND_WHITESPACE 15 . 39) (T_VARIABLE 39 . 44) 
(T_OBJECT_OPERATOR 44 . 46) (T_STRING 46 . 51) (T_CONSTANT_ENCAPSED_STRING 51 . 
64) ("\"" 64 . 65) ("." 65 . 66) (T_VARIABLE 66 . 69) ("." 69 . 70) 
(T_CONSTANT_ENCAPSED_STRING 70 . 73) (";" 73 . 74) (";" 75 . 77) (T_CLOSE_TAG 
75 . 77)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php $wpdb->get_var(\"SELECT post_parent FROM $wpdb->posts WHERE ID = 
'\".$id.\"'\"); ?>"
-   ;; (message "Tokens 2: %s" phps-mode/lexer-tokens)
-   (should (equal phps-mode/lexer-tokens
+   ;; (message "Tokens 2: %s" phps-mode-lexer-tokens)
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_VARIABLE 7 . 12) (T_OBJECT_OPERATOR 
12 . 14) (T_STRING 14 . 21) ("(" 21 . 22) ("\"" 22 . 23) 
(T_ENCAPSED_AND_WHITESPACE 23 . 47) (T_VARIABLE 47 . 52) (T_OBJECT_OPERATOR 52 
. 54) (T_STRING 54 . 59) (T_CONSTANT_ENCAPSED_STRING 59 . 72) ("\"" 72 . 73) 
("." 73 . 74) (T_VARIABLE 74 . 77) ("." 77 . 78) (T_CONSTANT_ENCAPSED_STRING 78 
. 81) (")" 81 . 82) (";" 82 . 83) (";" 84 . 86) (T_CLOSE_TAG 84 . 86)))))
 
   ;; TODO Test object properties inside heredoc, nowdocs strings
 
   )
 
-(defun phps-mode-test-lexer--namespaces ()
+(defun phps-mode-test-lexer-namespaces ()
   "Run test for namespaces."
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nnamespace MyNameSpace{\n\tclass MyClass {\n\t\tpublic function 
__construct() {\n\t\t\texit;\n\t\t}\n\t}\n}\n"
    
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_NAMESPACE 7 . 16) (T_STRING 17 . 28) 
("{" 28 . 29) (T_CLASS 31 . 36) (T_STRING 37 . 44) ("{" 45 . 46) (T_PUBLIC 49 . 
55) (T_FUNCTION 56 . 64) (T_STRING 65 . 76) ("(" 76 . 77) (")" 77 . 78) ("{" 79 
. 80) (T_EXIT 84 . 88) (";" 88 . 89) ("}" 92 . 93) ("}" 95 . 96) ("}" 97 . 
98)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\nNAMESPACE MyNameSpace;\nCLASS MyClass {\n\tpublic function 
__construct() {\n\t\texit;\n\t}\n}\n"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_NAMESPACE 7 . 16) (T_STRING 17 . 28) 
(";" 28 . 29) (T_CLASS 30 . 35) (T_STRING 36 . 43) ("{" 44 . 45) (T_PUBLIC 47 . 
53) (T_FUNCTION 54 . 62) (T_STRING 63 . 74) ("(" 74 . 75) (")" 75 . 76) ("{" 77 
. 78) (T_EXIT 81 . 85) (";" 85 . 86) ("}" 88 . 89) ("}" 90 . 91)))))
   )
 
-(defun phps-mode-test-lexer--errors ()
+(defun phps-mode-test-lexer-errors ()
   "Run test for errors."
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\necho \"My neverending double quotation\n"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_ERROR 12 . 45)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n`My neverending backquotes\n"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) ("`" 7 . 8) (T_ERROR 8 . 34)))))
 
-  (phps-mode/with-test-buffer
+  (phps-mode-test-with-buffer
    "<?php\n<<<LABEL\nMy neverending heredoc\ngoes on forever\n"
-   (should (equal phps-mode/lexer-tokens
+   (should (equal phps-mode-lexer-tokens
                   '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 7 . 16) (T_ERROR 16 . 
55)))))
 
   )
@@ -272,23 +272,23 @@
 
   (should (equal
            '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 7 . 16) (T_ERROR 21 . 60))
-           (phps-mode/get-moved-lexer-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 8 5)))
+           (phps-mode-lexer-get-moved-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 8 5)))
 
   (should (equal
            '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 7 . 16) (T_ERROR 11 . 50))
-           (phps-mode/get-moved-lexer-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 8 -5)))
+           (phps-mode-lexer-get-moved-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 8 -5)))
 
   (should (equal
            '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 8 . 17) (T_ERROR 17 . 56))
-           (phps-mode/get-moved-lexer-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 7 1)))
+           (phps-mode-lexer-get-moved-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 7 1)))
 
   (should (equal
            '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55))
-           (phps-mode/get-moved-lexer-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 20 1)))
+           (phps-mode-lexer-get-moved-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 20 1)))
 
   (should (equal
            '((T_OPEN_TAG 2 . 8) (T_START_HEREDOC 8 . 17) (T_ERROR 17 . 56))
-           (phps-mode/get-moved-lexer-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) -20 1)))
+           (phps-mode-lexer-get-moved-tokens '((T_OPEN_TAG 1 . 7) 
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) -20 1)))
 
   )
 
@@ -300,7 +300,7 @@
              (10 67 1 '(1))
              (1 7 1 '(1)))
            
-           (phps-mode/get-moved-lexer-states
+           (phps-mode-lexer-get-moved-states
             '((66 74 1 '(1))
               (8 65 1 '(1))
               (1 7 1 '(1)))
@@ -312,7 +312,7 @@
              (9 66 1 '(1))
              (2 8 1 '(1)))
            
-           (phps-mode/get-moved-lexer-states
+           (phps-mode-lexer-get-moved-states
             '((66 74 1 '(1))
               (8 65 1 '(1))
               (1 7 1 '(1)))
@@ -324,7 +324,7 @@
              (8 65 1 '(1))
              (1 7 1 '(1)))
            
-           (phps-mode/get-moved-lexer-states
+           (phps-mode-lexer-get-moved-states
             '((66 74 1 '(1))
               (8 65 1 '(1))
               (1 7 1 '(1)))
@@ -336,7 +336,7 @@
              (6 63 1 '(1))
              (1 7 1 '(1)))
            
-           (phps-mode/get-moved-lexer-states
+           (phps-mode-lexer-get-moved-states
             '((66 74 1 '(1))
               (8 65 1 '(1))
               (3 9 1 '(1)))
@@ -348,17 +348,17 @@
   "Run test for lexer."
   ;; (message "-- Running all tests for lexer... --\n")
   ;; (setq debug-on-error t)
-  (phps-mode/test-lexer--script-boundaries)
-  (phps-mode/test-lexer--simple-tokens)
-  (phps-mode/test-lexer--complex-tokens)
-  (phps-mode/test-lexer--namespaces)
-  (phps-mode/test-lexer--errors)
-  (phps-mode/test-get-moved-lexer-tokens)
-  (phps-mode/test-get-moved-lexer-states)
+  (phps-mode-test-lexer-script-boundaries)
+  (phps-mode-test-lexer-simple-tokens)
+  (phps-mode-test-lexer-complex-tokens)
+  (phps-mode-test-lexer-namespaces)
+  (phps-mode-test-lexer-errors)
+  (phps-mode-test-lexer-get-moved-lexer-tokens)
+  (phps-mode-test-lexer-get-moved-lexer-states)
   ;; (message "\n-- Ran all tests for lexer. --")
   )
 
-(phps-mode/test-lexer)
+(phps-mode-test-lexer)
 
 (provide 'phps-mode-test-lexer)
 



reply via email to

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