[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 004f60d 3/7: Started on test for SDT
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 004f60d 3/7: Started on test for SDT |
Date: |
Sun, 7 Nov 2021 14:21:36 -0500 (EST) |
branch: externals/phps-mode
commit 004f60dbfd34e3fc84f7006eca69c59af36c5969
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Started on test for SDT
---
phps-mode-test.el | 1 -
test/phps-mode-test-parser.el | 53 ++++++++++++++++++++++++++++++++++---------
2 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/phps-mode-test.el b/phps-mode-test.el
index b89d01d..3c0ba3d 100644
--- a/phps-mode-test.el
+++ b/phps-mode-test.el
@@ -48,7 +48,6 @@
(incremental-buffer)
(incremental-bookkeeping)
(incremental-nest-location-stack)
- (incremental)
(test-buffer-initial (generate-new-buffer "test-initial"))
(initial-state)
(initial-state-stack)
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index 9ed0948..e3e8045 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -81,9 +81,9 @@
(funcall logic)
(message "Passed %s" name)))
-(defun phps-mode-test-parser-boundaries ()
- "Run test for lexer."
- (message "-- Running tests for parser boundaries... --\n")
+(defun phps-mode-test-parser-parse ()
+ "Run test for parser."
+ (message "-- Running tests for parser basic... --\n")
(phps-mode-test-parser--buffer-contents
"<?php echo 'hello';"
@@ -100,7 +100,7 @@
"%d: %S -> %S"
production-number
(car (car production))
- (car (car (cdr production))))))
+ (car (cdr production)))))
(message "\n")
(should
(equal
@@ -153,7 +153,7 @@
"%d: %S -> %S"
production-number
(car (car production))
- (car (car (cdr production))))))
+ (car (cdr production)))))
(message "\n")
(should
(equal
@@ -174,7 +174,7 @@
"%d: %S -> %S"
production-number
(car (car production))
- (car (car (cdr production))))))
+ (car (cdr production)))))
(message "\n")
(should
(equal
@@ -195,7 +195,7 @@
"%d: %S -> %S"
production-number
(car (car production))
- (car (car (cdr production))))))
+ (car (cdr production)))))
(message "\n")
(should
(equal
@@ -216,7 +216,7 @@
"%d: %S -> %S"
production-number
(car (car production))
- (car (car (cdr production))))))
+ (car (cdr production)))))
(message "\n")
(should
(equal
@@ -237,7 +237,7 @@
"%d: %S -> %S"
production-number
(car (car production))
- (car (car (cdr production))))))
+ (car (cdr production)))))
(message "\n")
(should
(equal
@@ -304,13 +304,44 @@
(lambda()
(phps-mode-parser-parse)))
- (message "\n-- Ran tests for parser boundaries. --"))
+ (message "\n-- Ran tests for parser parse. --"))
+
+(defun phps-mode-test-parser-translate ()
+ "Run test for parse translation."
+ (message "-- Running tests for parser translation... --\n")
+
+ ;; TODO Generate bookkeeping and imenu index here
+
+ ;; (phps-mode-test-parser--buffer-contents
+ ;; "<?php\nfunction myFunctionA() {}\nfunction myFunctionB() {}\n$var =
function () {\n echo 'here';\n};"
+ ;; "Imenu function-oriented file with anonymous function"
+ ;; (lambda()
+ ;; (let ((parse (phps-mode-parser-parse)))
+ ;; (message "Left-to-right with left-most derivation:\n%S\n" parse)
+ ;; (dolist (production-number (reverse parse))
+ ;; (let ((production
+ ;; (phps-mode-parser--get-grammar-production-by-number
+ ;; production-number)))
+ ;; (message
+ ;; "%d: %S -> %S"
+ ;; production-number
+ ;; (car (car production))
+ ;; (car (cdr production))))))
+ ;; (let ((translation (phps-mode-parser-translate)))
+ ;; (should
+ ;; (equal
+ ;; (phps-mode-lex-analyzer--get-imenu)
+ ;; '(("myFunctionA" . 16) ("myFunctionB" . 42))))
+ ;; )))
+
+ (message "\n-- Ran tests for parser translation. --"))
(defun phps-mode-test-parser ()
"Run test for lexer."
(message "-- Running all tests for parser... --\n")
- (phps-mode-test-parser-boundaries)
+ (phps-mode-test-parser-parse)
+ (phps-mode-test-parser-translate)
(message "\n-- Ran all tests for parser. --"))
- [elpa] externals/phps-mode updated (38e99b2 -> 3734d56), Christian Johansson, 2021/11/07
- [elpa] externals/phps-mode 19dd2c7 2/7: Improved incremental test and fixed bug with inconsistent parse variable after incremental parse, Christian Johansson, 2021/11/07
- [elpa] externals/phps-mode 1c75371 1/7: Added FSF header to generated parser script, Christian Johansson, 2021/11/07
- [elpa] externals/phps-mode 004f60d 3/7: Started on test for SDT,
Christian Johansson <=
- [elpa] externals/phps-mode 8ec76e8 5/7: Improved parser to pass more meta-data about tokens for SDT, Christian Johansson, 2021/11/07
- [elpa] externals/phps-mode 3734d56 7/7: More testing with generating AST, Christian Johansson, 2021/11/07
- [elpa] externals/phps-mode 5994746 4/7: Started on generating imenu-index via parser translation, Christian Johansson, 2021/11/07
- [elpa] externals/phps-mode e82483e 6/7: More testing of generating imenu-index via parser SDT, Christian Johansson, 2021/11/07