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

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

[elpa] externals/phps-mode 1aadb1b 285/405: Added failing lexer test for


From: Stefan Monnier
Subject: [elpa] externals/phps-mode 1aadb1b 285/405: Added failing lexer test for comment vs doc-comment
Date: Sat, 13 Jul 2019 10:00:33 -0400 (EDT)

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

    Added failing lexer test for comment vs doc-comment
---
 phps-mode-lexer.el      | 2 +-
 phps-mode-test-lexer.el | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el
index f6e51809..f2e887c 100644
--- a/phps-mode-lexer.el
+++ b/phps-mode-lexer.el
@@ -1312,7 +1312,7 @@
              )))))
 
     (phps-mode-lexer-re2c-rule
-     (and ST_IN_SCRIPTING (looking-at (concat "\\(/\\*\\|/\\*\\*\\)" 
phps-mode-lexer-WHITESPACE)))
+     (and ST_IN_SCRIPTING (looking-at (concat "\\(/\\*\\|/\\*\\*" 
phps-mode-lexer-WHITESPACE "\\)")))
      (lambda()
        (let* ((start (match-beginning 0))
               (end (match-end 0))
diff --git a/phps-mode-test-lexer.el b/phps-mode-test-lexer.el
index a08a5e3..d201484 100644
--- a/phps-mode-test-lexer.el
+++ b/phps-mode-test-lexer.el
@@ -175,7 +175,12 @@
    (should (equal (phps-mode-lexer-get-tokens)
                   '((T_OPEN_TAG 1 . 7) (T_ECHO 7 . 11) (T_VARIABLE 12 . 18) 
("[" 18 . 19) (T_CONSTANT_ENCAPSED_STRING 19 . 24) ("]" 24 . 25) (";" 25 . 26) 
(T_ECHO 27 . 31) ("\"" 32 . 33) (T_ENCAPSED_AND_WHITESPACE 33 . 36) (T_VARIABLE 
36 . 43) (T_NUM_STRING 43 . 45) ("]" 45 . 46) (T_CONSTANT_ENCAPSED_STRING 46 . 
63) ("\"" 63 . 64) (";" 64 . 65)))))
 
-  ;; TODO Add test for long as var offset
+  (phps-mode-test-with-buffer
+   "<?php\n/*my comment */\n/** my doc comment */"
+   "Comment vs doc-comment"
+   (message "Tokens: %s" (phps-mode-lexer-get-tokens))
+   (should (equal (phps-mode-lexer-get-tokens)
+                  '((T_OPEN_TAG 1 . 7) (T_COMMENT 7 . 22) (T_DOC_COMMENT 23 . 
44)))))
 
   ;; (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 gl [...]



reply via email to

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