[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode c7ad55c 255/405: Passed first integration-tes
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode c7ad55c 255/405: Passed first integration-test |
Date: |
Sat, 13 Jul 2019 10:00:27 -0400 (EDT) |
branch: externals/phps-mode
commit c7ad55c9c03da6bd3bdd6b64cce5f024db3668e5
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Passed first integration-test
---
phps-mode-lexer.el | 24 ++++++++++++++----------
phps-mode-test-integration.el | 29 +++++++++++++++++++++++------
2 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el
index 4dc8814..1e6b00f 100644
--- a/phps-mode-lexer.el
+++ b/phps-mode-lexer.el
@@ -1269,6 +1269,20 @@ ANY_CHAR'
(defun phps-mode-lexer-setup (start end)
"Just prepare other lexers for lexing region START to END."
;; (message "phps-mode-lexer-setup %s %s" start end)
+
+ ;; Reset line indents
+ (when (and (boundp 'phps-mode-functions-lines-indent)
+ phps-mode-functions-lines-indent)
+ (setq phps-mode-functions-lines-indent nil))
+
+ ;; Reset imenu index
+ (when (and (boundp 'phps-mode-functions-imenu)
+ phps-mode-functions-imenu)
+ (setq phps-mode-functions-imenu nil))
+
+ ;; TODO Delete all overlays after point of change if it's incremental
+
+ ;; Does lexer start from the beginning of buffer?
(when (and (eq start 1)
end)
(delete-all-overlays)
@@ -1278,16 +1292,6 @@ ANY_CHAR'
phps-mode-lexer-buffer-changes--start)
(setq phps-mode-lexer-buffer-changes--start nil))
- ;; Reset line indents
- (when (and (boundp 'phps-mode-functions-lines-indent)
- phps-mode-functions-lines-indent)
- (setq phps-mode-functions-lines-indent nil))
-
- ;; Reset imenu index
- (when (and (boundp 'phps-mode-functions-imenu)
- phps-mode-functions-imenu)
- (setq phps-mode-functions-imenu nil))
-
(setq phps-mode-lexer-states nil)
(phps-mode-lexer-BEGIN phps-mode-lexer-ST_INITIAL)))
diff --git a/phps-mode-test-integration.el b/phps-mode-test-integration.el
index 9d865e7..4d37fcb 100644
--- a/phps-mode-test-integration.el
+++ b/phps-mode-test-integration.el
@@ -41,7 +41,7 @@
(phps-mode-test-with-buffer
"<?php\nnamespace myNamespace\n{\n class myClass\n {\n public
function myFunction()\n {\n echo 'my statement';\n }\n
}\n}\n"
- "Regular PHP with namespaces, classes and functions"
+ "Integration-test for regular PHP with namespaces, classes and functions"
;; Tokens
(when (and (boundp 'phps-mode-lexer-tokens)
@@ -55,12 +55,29 @@
;; Imenu
(should (equal (phps-mode-functions-get-imenu) '(("\\myNamespace" . 17)
("\\myNamespace\\myClass" . 41) ("\\myNamespace\\myClass->myFunction()" . 79))))
- ;; TODO Make changes
+ ;; Make changes
+ (goto-char 144)
+ (insert "\n\n public function myFunctionB()\n {\n
echo 'my second statement';\n }\n")
- ;; TODO New test for tokens
- ;; TODO New test for indentation
- ;; TODO new test for Imenu
- )
+ ;; Verify stored point of change
+ (when (boundp 'phps-mode-functions-buffer-changes-start)
+ (should (equal phps-mode-functions-buffer-changes-start 144)))
+
+ ;; Run incremental lexer
+ (phps-mode-lexer-run-incremental)
+
+ ;; Tokens
+ (when (and (boundp 'phps-mode-lexer-tokens)
+ phps-mode-lexer-tokens)
+ ;; (message "Tokens %s" phps-mode-lexer-tokens)
+ (should (equal phps-mode-lexer-tokens '((T_OPEN_TAG 1 . 7) (T_NAMESPACE 7
. 16) (T_STRING 17 . 28) ("{" 29 . 30) (T_CLASS 35 . 40) (T_STRING 41 . 48)
("{" 53 . 54) (T_PUBLIC 63 . 69) (T_FUNCTION 70 . 78) (T_STRING 79 . 89) ("("
89 . 90) (")" 90 . 91) ("{" 100 . 101) (T_ECHO 114 . 118)
(T_CONSTANT_ENCAPSED_STRING 119 . 133) (";" 133 . 134) ("}" 143 . 144)
(T_PUBLIC 154 . 160) (T_FUNCTION 161 . 169) (T_STRING 170 . 181) ("(" 181 .
182) (")" 182 . 183) ("{" 192 . 193) (T_ECHO 206 . 210 [...]
+
+ ;; Indentation
+ ;; (message "indent: %s" (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent)))
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (1 0)) (5 (1 0)) (6 (2
0)) (7 (2 0)) (8 (3 0)) (9 (2 0)) (10 (2 0)) (11 (2 0)) (12 (2 0)) (13 (3 0))
(14 (2 0)) (15 (2 0)) (16 (1 0)) (17 (0 0))) (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent))))
+
+ ;; Imenu
+ (should (equal (phps-mode-functions-get-imenu) '(("\\myNamespace" . 17)
("\\myNamespace\\myClass" . 41) ("\\myNamespace\\myClass->myFunction()" . 79)
("\\myNamespace\\myClass->myFunctionB()" . 170)))))
)
- [elpa] externals/phps-mode e78d8ed 248/405: Clean-up of indentation code, (continued)
- [elpa] externals/phps-mode e78d8ed 248/405: Clean-up of indentation code, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c2db7d3 250/405: Preparations for integration test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 11309b8 256/405: Updated readme, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode fcc920f 258/405: More preparations for merging indent and Imenu into one function, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 41c12c1 251/405: Updated paths for byte-compilation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0e927e8 252/405: Fixed compilation command in makefile, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6593242 257/405: Preparations for doing indentation and imenu in one pass, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 318001e 259/405: Merged Imenu and indentation generation into one iteration of tokens, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 5bb45ce 253/405: Added lexer test for properties inside heredoc, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode caafeba 260/405: Changed idle interval for incremental lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c7ad55c 255/405: Passed first integration-test,
Stefan Monnier <=
- [elpa] externals/phps-mode 310521b 254/405: Started with first integration-test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode d39152b 279/405: Added unit test for NUM_STRING token inside double-quoted string, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 44a997e 270/405: Added syntax coloring for "." tokens, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode aa0c23d 263/405: Updated font-locks for token color syntax, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b86dd54 262/405: Indentation now supports new lexer token T_INLINE HTML, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2c8f28c 275/405: Added docstrings to variables, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c9f0254 271/405: Fixed some minor flycheck complains in lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 68ef657 280/405: Removed debugging output from unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 40bffbc 265/405: Added syntax coloring for [ )( ,, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9deb882 266/405: Added syntax coloring for ? ! < > :, Stefan Monnier, 2019/07/13