branch: externals/phps-mode
commit e36d477d299b177e45104d8a87266d28bd49dd6a
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
token-number from point now is the same format as (nth)
---
phps-lexer.el | 7 +++----
phps-test-lexer.el | 16 ++++++++--------
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/phps-lexer.el b/phps-lexer.el
index c281b93..39d745e 100644
--- a/phps-lexer.el
+++ b/phps-lexer.el
@@ -1268,17 +1268,16 @@ ANY_CHAR'
(start-brace-level 0)
(start-parenthesis-level 0)
(start-inline-function-level 0)
- (start-token-number 0)
+ (start-token-number -1)
(end-in-scripting nil)
(end-brace-level 0)
(end-parenthesis-level 0)
(end-inline-function-level 0)
- (end-token-number 0))
+ (end-token-number -1))
(catch 'stop-iteration
(dolist (item phps-mode/lexer-tokens)
(let ((token (car item))
- (start (car (cdr item)))
- (end (cdr (cdr item))))
+ (start (car (cdr item))))
;; (message "Token: %s Start: %s End: %s Item: %s" token start end
item)
(when (> start line-end)
diff --git a/phps-test-lexer.el b/phps-test-lexer.el
index db5fb53..0897a08 100644
--- a/phps-test-lexer.el
+++ b/phps-test-lexer.el
@@ -274,44 +274,44 @@
(phps-mode/with-test-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 4) (list t 1 0 0 7))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list t 0 0 0 3) (list t 1 0 0 6))
(phps-mode/lexer-get-point-data))))
(phps-mode/with-test-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) (list nil 0 0 0 6))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list nil 0 0 0 -1) (list nil 0 0 0 5))
(phps-mode/lexer-get-point-data))))
(phps-mode/with-test-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) (list nil 0 0 0 6))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list nil 0 0 0 -1) (list nil 0 0 0 5))
(phps-mode/lexer-get-point-data))))
(phps-mode/with-test-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) (list nil 0 0 0 6))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list nil 0 0 0 -1) (list nil 0 0 0 5))
(phps-mode/lexer-get-point-data))))
(phps-mode/with-test-buffer
"<html><head><title><?php if ($myCondition) { \n if ($mySeconCondition) {
echo $title; } } ?></title><body>Bla bla</body></html>"
;; (message "Tokens: %s" phps-mode/lexer-tokens)
(goto-char 48)
- (should (equal (list (list t 1 0 0 6) (list nil 0 0 0 18))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list t 1 0 0 5) (list nil 0 0 0 17))
(phps-mode/lexer-get-point-data))))
(phps-mode/with-test-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 11) (list t 2 0 0 14))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list t 2 0 0 10) (list t 2 0 0 13))
(phps-mode/lexer-get-point-data))))
(phps-mode/with-test-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 14) (list t 1 0 0 15))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list t 2 0 0 13) (list t 1 0 0 14))
(phps-mode/lexer-get-point-data))))
(phps-mode/with-test-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) (list nil 0 0 0 18))
(phps-mode/lexer-get-point-data))))
+ (should (equal (list (list nil 0 0 0 -1) (list nil 0 0 0 17))
(phps-mode/lexer-get-point-data))))
)