[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 5681944d10 20/29: Passing all unit tests and
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 5681944d10 20/29: Passing all unit tests and byte compilation with incremental lexer |
Date: |
Thu, 15 Feb 2024 03:14:37 -0500 (EST) |
branch: externals/phps-mode
commit 5681944d10fba87f772a71f79d9df0b3c29fc41b
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passing all unit tests and byte compilation with incremental lexer
---
phps-mode-lex-analyzer.el | 9 ++--
test/phps-mode-test-lex-analyzer.el | 28 +-----------
test/phps-mode-test-lexer.el | 87 -------------------------------------
3 files changed, 5 insertions(+), 119 deletions(-)
diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index 0ec26fa5e0..99cb1a52ad 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -643,18 +643,14 @@ of performed operations. Optionally do it
FORCE-SYNCHRONOUS."
;; Do partial lex from previous-token-end to change-stop
- (let ((buffer-contents)
- (buffer-max))
+ (let ((buffer-contents))
(save-restriction
(widen)
(setq
buffer-contents
(buffer-substring-no-properties
(point-min)
- (point-max)))
- (setq
- buffer-max
- (point-max)))
+ (point-max))))
(phps-mode-lex-analyzer--incremental-lex-string
(buffer-name)
@@ -996,6 +992,7 @@ of performed operations. Optionally do it
FORCE-SYNCHRONOUS."
loaded-from-cache
(let* ((buffer (generate-new-buffer "*PHPs Parser*"))
(cache)
+ (tokens)
(parse-error)
(parse-trail)
(ast-tree)
diff --git a/test/phps-mode-test-lex-analyzer.el
b/test/phps-mode-test-lex-analyzer.el
index 612ecfffe2..3fe40ceb88 100644
--- a/test/phps-mode-test-lex-analyzer.el
+++ b/test/phps-mode-test-lex-analyzer.el
@@ -26,7 +26,7 @@
(insert "<?php echo 'test';\n?>")
(should (equal
(phps-mode-lex-analyzer--process-changes)
- '((RUN-FULL-LEXER) (FOUND-NO-HEAD-TOKENS 1)))))
+ '((INCREMENTAL-LEX 1)))))
(phps-mode-test--with-buffer
"\n<html>\n<?php\n/**\n * Bla\n */"
@@ -42,30 +42,7 @@
(insert "\necho 'I was here';\n")
(should (equal
(phps-mode-lex-analyzer--process-changes)
- '((INCREMENTAL-LEX 15)))))
-
- )
-
-(defun phps-mode-test-lex-analyzer--get-moved-imenu ()
- "Test for moving imenu index."
-
- ;; (message "Moved imenu %s" (phps-mode-lex-analyzer--get-moved-imenu
'(("myNamespace" ("myClass" ("myFunctionA" . 108) ("myFunctionB" . 161)))) 0 2))
-
- (should (equal
- '(("myNamespace" ("myClass" ("myFunctionA" . 110) ("myFunctionB" .
163))))
- (phps-mode-lex-analyzer--get-moved-imenu '(("myNamespace"
("myClass" ("myFunctionA" . 108) ("myFunctionB" . 161)))) 0 2)))
-
- (should (equal
- '(("myNamespace" ("myClass" ("myFunctionA" . 106) ("myFunctionB" .
159))))
- (phps-mode-lex-analyzer--get-moved-imenu '(("myNamespace"
("myClass" ("myFunctionA" . 108) ("myFunctionB" . 161)))) 0 -2)))
-
- (should (equal
- '(("myNamespace" ("myClass" ("myFunctionA" . 108) ("myFunctionB" .
171))))
- (phps-mode-lex-analyzer--get-moved-imenu '(("myNamespace"
("myClass" ("myFunctionA" . 108) ("myFunctionB" . 161)))) 110 10)))
-
- (should (equal
- '(("myNamespace" ("myClass" ("myFunctionA" . 108) ("myFunctionB" .
161))))
- (phps-mode-lex-analyzer--get-moved-imenu '(("myNamespace"
("myClass" ("myFunctionA" . 108) ("myFunctionB" . 161)))) 180 10)))
+ '((INCREMENTAL-LEX 29)))))
)
@@ -214,7 +191,6 @@
;; (setq debug-on-error t)
(phps-mode-test-lex-analyzer--narrow-to-defun)
(phps-mode-test-lex-analyzer--process-changes)
- (phps-mode-test-lex-analyzer--get-moved-imenu)
(phps-mode-test-lex-analyzer--comment-uncomment-region))
(phps-mode-test-lex-analyzer)
diff --git a/test/phps-mode-test-lexer.el b/test/phps-mode-test-lexer.el
index 2ab8be0e73..79a2b920cf 100644
--- a/test/phps-mode-test-lexer.el
+++ b/test/phps-mode-test-lexer.el
@@ -649,91 +649,6 @@
)
-(defun phps-mode-test-lexer--get-moved-lexer-tokens ()
- "Run test for get moved lexer tokens."
-
- (should
- (equal
- '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 7 . 21) (T_ERROR 21 . 60))
- (phps-mode-lex-analyzer--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 . 11) (T_ERROR 11 . 50))
- (phps-mode-lex-analyzer--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 . 8) (T_START_HEREDOC 8 . 17) (T_ERROR 17 . 56))
- (phps-mode-lex-analyzer--get-moved-tokens '((T_OPEN_TAG 1 . 7)
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 6 1)))
-
- (should
- (equal
- '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 7 . 16) (T_ERROR 16 . 56))
- (phps-mode-lex-analyzer--get-moved-tokens '((T_OPEN_TAG 1 . 7)
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 20 1)))
-
- (should
- (equal
- '((T_OPEN_TAG 1 . 7) (T_START_HEREDOC 7 . 16) (T_ERROR 16 . 54))
- (phps-mode-lex-analyzer--get-moved-tokens '((T_OPEN_TAG 1 . 7)
(T_START_HEREDOC 7 . 16) (T_ERROR 16 . 55)) 20 -1)))
-
- )
-
-(defun phps-mode-test-lexer--get-moved-lexer-states ()
- "Run test for get moved lexer states."
-
- (should
- (equal
- '((68 76 1 '(1) nil nil nil)
- (10 67 1 '(1) nil nil nil)
- (1 9 1 '(1) nil nil nil))
-
- (phps-mode-lex-analyzer--get-moved-states
- '((66 74 1 '(1) nil nil nil)
- (8 65 1 '(1) nil nil nil)
- (1 7 1 '(1) nil nil nil))
- 6
- 2)))
-
- (should
- (equal
- '((67 75 1 '(1) nil nil nil)
- (9 66 1 '(1) nil nil nil)
- (2 8 1 '(1) nil nil nil))
-
- (phps-mode-lex-analyzer--get-moved-states
- '((66 74 1 '(1) nil nil nil)
- (8 65 1 '(1) nil nil nil)
- (1 7 1 '(1) nil nil nil))
- 0
- 1)))
-
- (should
- (equal
- '((66 74 1 '(1) nil nil nil)
- (8 65 1 '(1) nil nil nil)
- (1 7 1 '(1) nil nil nil))
-
- (phps-mode-lex-analyzer--get-moved-states
- '((66 74 1 '(1) nil nil nil)
- (8 65 1 '(1) nil nil nil)
- (1 7 1 '(1) nil nil nil))
- 100
- 1)))
-
- (should
- (equal
- '((64 72 1 '(1) nil nil nil)
- (6 63 1 '(1) nil nil nil)
- (1 7 1 '(1) nil nil nil))
-
- (phps-mode-lex-analyzer--get-moved-states
- '((66 74 1 '(1) nil nil nil)
- (8 65 1 '(1) nil nil nil)
- (3 9 1 '(1) nil nil nil))
- 3
- -2))))
-
(defun phps-mode-test-lexer--benchmark ()
"Benchmark the lexer test."
(require 'benchmark)
@@ -763,8 +678,6 @@
(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. --")
)
- [elpa] externals/phps-mode 673a801311 25/29: Resolved issue of parser buffer not closing, (continued)
- [elpa] externals/phps-mode 673a801311 25/29: Resolved issue of parser buffer not closing, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 676cfe11e6 28/29: Updated version and change-log, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode e7e5cdacf0 29/29: Fixed bye-compilation warning and missing error declaration, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode ad00c6eac5 27/29: Updated parser generator information and cleaned up code, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 0262e707ca 05/29: Passing more parsing tests, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 396397b97d 06/29: Passing all old unit tests for parser, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode c2716544f4 10/29: Started on SDT for PHP 8.3, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode aa2a23c296 18/29: Started on incremental lexer support again, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 34d34330a2 13/29: Passing unit tests for indentation, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 9bbd3cd7fa 14/29: Some byte compilation fixes, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode 5681944d10 20/29: Passing all unit tests and byte compilation with incremental lexer,
Christian Johansson <=
- [elpa] externals/phps-mode 055ca735f1 21/29: Cache validation check, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode a24fb65377 23/29: Fix for environment were threads support is lacking, Christian Johansson, 2024/02/15
- [elpa] externals/phps-mode d76ba9f39f 22/29: Optimized cache storage size, Christian Johansson, 2024/02/15