[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 07a983d 66/96: Passing parser tests
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 07a983d 66/96: Passing parser tests |
Date: |
Fri, 29 Oct 2021 11:14:50 -0400 (EDT) |
branch: externals/phps-mode
commit 07a983dafd2ccd28a73a95a4c82a779d0e46bde7
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passing parser tests
---
test/phps-mode-test-parser.el | 68 +++++++++++++++++++++----------------------
1 file changed, 33 insertions(+), 35 deletions(-)
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index 598d6f7..9ce280e 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -68,7 +68,7 @@
(message "\n")
(should
(equal
- '(80 459 466 411 333 332 154 102 79)
+ '(80 449 456 403 325 324 152 102 79)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -77,7 +77,7 @@
(lambda()
(should
(equal
- '(80 459 466 411 333 332 154 102 79)
+ '(80 449 456 403 325 324 152 102 79)
(phps-mode-parser-parse)))))
(phps-mode-test-parser--buffer-contents
@@ -86,7 +86,7 @@
(lambda()
(should
(equal
- '(80 459 466 411 333 332 154 102 79)
+ '(80 449 456 403 325 324 152 102 79)
(phps-mode-parser-parse)))))
(phps-mode-test-parser--buffer-contents
@@ -121,7 +121,7 @@
(message "\n")
(should
(equal
- '(80 459 466 411 333 332 154 102 79 155 102 79 459 466 411 333 332
154 102 79 155 102 79)
+ '(80 449 456 403 325 324 152 102 79 153 102 79 449 456 403 325 324
152 102 79 153 102 79)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -142,7 +142,7 @@
(message "\n")
(should
(equal
- '(80 427 431 428 176 178 428 247 241 238 120 236 266 429 137 502 492
498 461 411 345 156 138 136 502 492 498 342 481 151 138 136 429 175 98 105 79)
+ '(80 419 423 420 237 243 175 177 420 241 236 233 118 231 260 421 135
492 482 488 451 403 337 154 136 134 492 482 488 334 471 149 136 134 421 174 98
103 79)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -163,7 +163,7 @@
(message "\n")
(should
(equal
- '(80 77 81 107 79 427 431 428 176 178 428 247 241 238 120 236 266 429
137 502 492 498 461 411 345 156 138 136 502 492 498 342 481 151 138 136 429 175
98 105 79)
+ '(80 77 81 106 79 419 423 420 237 243 175 177 420 241 236 233 118 231
260 421 135 492 482 488 451 403 337 154 136 134 492 482 488 334 471 149 136 134
421 174 98 103 79)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -184,37 +184,35 @@
(message "\n")
(should
(equal
- '(80 77 81 108 79 137 427 431 428 176 178 428 247 241 238 120 236 266
429 137 502 492 498 461 411 345 156 138 136 502 492 498 342 481 151 138 136 429
175 98 139 136 142 102 79)
+ '(80 77 81 80 419 423 420 237 243 175 177 420 241 236 233 118 231 260
421 135 492 482 488 451 403 337 154 136 134 492 482 488 334 471 149 136 134 421
174 98 103 79 107 79)
parse)))))
- ;; TODO Make this test pass
- ;; (phps-mode-test-parser--buffer-contents
- ;; "<?php\nnamespace myNamespace;\nclass MyClass\n{\n private $var =
'abc';\n public function myFunction($arg) {\n $arg = 2;\n
return $arg;\n }\n}\n"
- ;; "Simple function defintion and property inside class inside
non-bracketed namespace"
- ;; (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 (car (cdr production))))))
- ;; (message "\n")
- ;; (should
- ;; (equal
- ;; '(80 77 81 108 79 137 427 431 428 176 178 428 247 241 238 120 236
266 429 137 502 492 498 461 411 345 156 138 136 502 492 498 342 481 151 138 136
429 175 98 139 136 142 102 79)
- ;; parse)))))
-
- ;; ;; TODO Make following test work
- ;; (phps-mode-test-parser--buffer-contents
- ;; "<?php\n\nnamespace myNamespaceA {\n $var = 123;\n class myClassA
{\n private $var2 = 123;\n function myFunctionA($var3) {\n
$var4 = 123;\n if ($var) {\n echo 'Miss';\n
}\n if ($var2) {\n echo 'Miss';\n }\n
if ($var3) {\n echo 'Hit';\n }\n
if ($var4) {\n echo 'Hit';\n }\n }\n\n
function myFun [...]
- ;; "Object oriented PHP with bracket namespace"
- ;; (lambda()
- ;; (phps-mode-parser-parse)))
+ (phps-mode-test-parser--buffer-contents
+ "<?php\nnamespace myNamespace;\nclass MyClass\n{\n private $var =
'abc';\n public function myFunction($arg) {\n $arg = 2;\n
return $arg;\n }\n}\n"
+ "Simple function defintion and property inside class inside non-bracketed
namespace"
+ (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 (car (cdr production))))))
+ (message "\n")
+ (should
+ (equal
+ '(80 77 81 106 79 187 191 420 277 311 307 303 243 449 456 403 420 318
316 278 281 276 309 307 306 419 423 77 420 237 243 175 177 420 241 236 233 118
231 260 421 135 492 482 488 451 403 337 154 136 134 492 482 488 334 471 149 136
134 302 421 280 281 276 180 99 103 79)
+ parse)))))
+
+ (phps-mode-test-parser--buffer-contents
+ "<?php\n\nnamespace myNamespaceA {\n $var = 123;\n class myClassA {\n
private $var2 = 123;\n function myFunctionA($var3) {\n
$var4 = 123;\n if ($var) {\n echo 'Miss';\n
}\n if ($var2) {\n echo 'Miss';\n }\n
if ($var3) {\n echo 'Hit';\n }\n if
($var4) {\n echo 'Hit';\n }\n }\n\n
function myFuncti [...]
+ "Object oriented PHP with bracket namespace"
+ (lambda()
+ (phps-mode-parser-parse)))
(message "\n-- Ran tests for parser boundaries. --"))
- [elpa] externals/phps-mode 605b76c 57/96: Removed note, (continued)
- [elpa] externals/phps-mode 605b76c 57/96: Removed note, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 20ad000 68/96: Added another TODO item, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode a6c5db1 45/96: Updated grammar productions based on automatically parsed grammar from YACC, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 2ac480a 47/96: Started on automatic generation of terminals, non-terminals and start as well, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode eb17d8c 51/96: Improved resuming of parser-generation, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 6af98c4 56/96: Productions are now read automatically again, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 212fd7f 63/96: Fixed warning in byte-compilation, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode fb57c3b 53/96: Started on parser for global declaration, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode e418621 59/96: Projects passes tests and byte-compilation again, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 945571c 65/96: Fixed byte-compilation issues with parser, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 07a983d 66/96: Passing parser tests,
Christian Johansson <=
- [elpa] externals/phps-mode b551e69 67/96: Added TODO items, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 37fdd2e 78/96: Passing all tests with parser integrated somewhat, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode e3b9403 69/96: Removed garbage collection modification, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 1789d15 60/96: Fixed bug in gramamr automation, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 08e1325 74/96: Test of parser not dependent on buffer name, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode eced7be 77/96: Parser now not dependent on lex-analyzer variables, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 4f7126b 70/96: Fixed automation grammar setting of lex-analyzer functions, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode ce5e28e 72/96: Added generated grammar in output of automation, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode e698a2e 64/96: Re-generated parser with automated grammar, Christian Johansson, 2021/10/29
- [elpa] externals/phps-mode 128868c 75/96: Added another parse test, Christian Johansson, 2021/10/29