[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 10336eed90 08/15: Parser now handles multiple
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 10336eed90 08/15: Parser now handles multiple alternative cases switch case statement |
Date: |
Sat, 26 Feb 2022 02:06:37 -0500 (EST) |
branch: externals/phps-mode
commit 10336eed906dfeff92ee0206888f9ee67e8cc9ff
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Parser now handles multiple alternative cases switch case statement
---
test/phps-mode-test-parser.el | 50 +++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index 390788bfeb..4039a61822 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -75,8 +75,8 @@
(lambda()
(let ((parse (phps-mode-parser-parse)))
- (message "Left-to-right with right-most derivation:\n%S\n" parse)
- (dolist (production-number (reverse parse))
+ (message "Left-to-right with right-most derivation in reverse:\n%S\n"
parse)
+ (dolist (production-number parse)
(let ((production
(phps-mode-parser--get-grammar-production-by-number
production-number)))
@@ -88,7 +88,7 @@
(message "\n")
(should
(equal
- '(80 449 456 403 325 324 152 102 79)
+ '(84 472 479 426 347 346 157 107 83)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -97,7 +97,7 @@
(lambda()
(should
(equal
- '(80 449 456 403 325 324 152 102 79 159 102 79)
+ '(84 472 479 426 347 346 157 107 83 164 107 83)
(phps-mode-parser-parse)))))
(phps-mode-test-parser--buffer-contents
@@ -106,7 +106,7 @@
(lambda()
(should
(equal
- '(80 449 456 403 325 324 152 102 79)
+ '(84 472 479 426 347 346 157 107 83)
(phps-mode-parser-parse)))))
(phps-mode-test-parser--buffer-contents
@@ -128,8 +128,8 @@
"Advanced echo test with 2 echo sections"
(lambda()
(let ((parse (phps-mode-parser-parse)))
- (message "Left-to-right with right-most derivation:\n%S\n" parse)
- (dolist (production-number (reverse parse))
+ (message "Left-to-right with right-most derivation in reverse:\n%S\n"
parse)
+ (dolist (production-number parse)
(let ((production
(phps-mode-parser--get-grammar-production-by-number
production-number)))
@@ -141,7 +141,7 @@
(message "\n")
(should
(equal
- '(80 449 456 403 325 324 152 102 79 159 102 79 153 102 79 449 456 403
325 324 152 102 79 159 102 79 153 102 79)
+ '(84 472 479 426 347 346 157 107 83 164 107 83 158 107 83 472 479 426
347 346 157 107 83 164 107 83 158 107 83)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -149,8 +149,8 @@
"Simple function defintion"
(lambda()
(let ((parse (phps-mode-parser-parse)))
- (message "Left-to-right with right-most derivation:\n%S\n" parse)
- (dolist (production-number (reverse parse))
+ (message "Left-to-right with right-most derivation in reverse:\n%S\n"
parse)
+ (dolist (production-number parse)
(let ((production
(phps-mode-parser--get-grammar-production-by-number
production-number)))
@@ -162,7 +162,7 @@
(message "\n")
(should
(equal
- '(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)
+ '(84 442 446 443 248 256 180 182 443 254 247 244 123 242 279 444 140
515 505 511 474 426 359 159 141 139 515 505 511 356 494 154 141 139 444 179 102
108 83)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -170,8 +170,8 @@
"Simple function defintion inside un-bracketed namespace"
(lambda()
(let ((parse (phps-mode-parser-parse)))
- (message "Left-to-right with right-most derivation:\n%S\n" parse)
- (dolist (production-number (reverse parse))
+ (message "Left-to-right with right-most derivation in reverse:\n%S\n"
parse)
+ (dolist (production-number parse)
(let ((production
(phps-mode-parser--get-grammar-production-by-number
production-number)))
@@ -183,7 +183,7 @@
(message "\n")
(should
(equal
- '(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)
+ '(84 81 85 111 83 442 446 443 248 256 180 182 443 254 247 244 123 242
279 444 140 515 505 511 474 426 359 159 141 139 515 505 511 356 494 154 141 139
444 179 102 108 83)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -191,8 +191,8 @@
"Simple function defintion inside bracketed namespace"
(lambda()
(let ((parse (phps-mode-parser-parse)))
- (message "Left-to-right with right-most derivation:\n%S\n" parse)
- (dolist (production-number (reverse parse))
+ (message "Left-to-right with right-most derivation in reverse:\n%S\n"
parse)
+ (dolist (production-number parse)
(let ((production
(phps-mode-parser--get-grammar-production-by-number
production-number)))
@@ -204,7 +204,7 @@
(message "\n")
(should
(equal
- '(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)
+ '(84 81 85 84 442 446 443 248 256 180 182 443 254 247 244 123 242 279
444 140 515 505 511 474 426 359 159 141 139 515 505 511 356 494 154 141 139 444
179 102 108 83 112 83)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -212,8 +212,8 @@
"Simple function defintion and property inside class inside non-bracketed
namespace"
(lambda()
(let ((parse (phps-mode-parser-parse)))
- (message "Left-to-right with right-most derivation:\n%S\n" parse)
- (dolist (production-number (reverse parse))
+ (message "Left-to-right with right-most derivation in reverse:\n%S\n"
parse)
+ (dolist (production-number parse)
(let ((production
(phps-mode-parser--get-grammar-production-by-number
production-number)))
@@ -225,7 +225,7 @@
(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)
+ '(84 81 85 111 83 198 202 443 297 332 328 324 256 472 479 426 443 340
338 298 302 296 330 328 327 442 446 81 443 248 256 180 182 443 254 247 244 123
242 279 444 140 515 505 511 474 426 359 159 141 139 515 505 511 356 494 154 141
139 323 444 300 302 296 185 103 108 83)
parse)))))
(phps-mode-test-parser--buffer-contents
@@ -289,11 +289,11 @@
(phps-mode-parser-parse)))
;; TODO Make this pass
- ;; (phps-mode-test-parser--buffer-contents
- ;; "<?php\n$case = 'First';\nswitch ($case)\n{\n case 'First':\n case
'Second':\n echo 'was here';\n}"
- ;; "Switch case with multiple conditions for same case"
- ;; (lambda()
- ;; (phps-mode-parser-parse)))
+ (phps-mode-test-parser--buffer-contents
+ "<?php\n$case = 'First';\nswitch ($case)\n{\n case 'First':\n case
'Second':\n echo 'was here';\n}"
+ "Switch case with multiple conditions for same case"
+ (lambda()
+ (phps-mode-parser-parse)))
(message "\n-- Ran tests for parser parse. --"))
- [elpa] externals/phps-mode ccbb452889 04/15: Fixed automatic grammar translation from PHP 8.1 YACC, (continued)
- [elpa] externals/phps-mode ccbb452889 04/15: Fixed automatic grammar translation from PHP 8.1 YACC, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 2122f23ad1 01/15: Added failing indentation case, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 924fb345ec 06/15: Minor tweaks in parser generation automation, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode b82471b38a 09/15: Removed TODO item, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 85eed0d30e 07/15: Updated parser to PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode bc2ecad56a 11/15: More work on PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode b5fcf0e7b7 02/15: Updated automation for PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 3e1142c30c 14/15: Passing bookkeeping tests with PHP 8.1 parser and AST, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode be18349ec9 15/15: Updated version, date and TODO, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode fe89129aaa 03/15: More work on PHP 8.1 automation, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 10336eed90 08/15: Parser now handles multiple alternative cases switch case statement,
Christian Johansson <=
- [elpa] externals/phps-mode d7ae56f698 10/15: Passing imenu-tests for PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode faf6632911 13/15: Improved SDT for more infix operators, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 16ec02520a 12/15: Fixed ampersand in lexer, Christian Johansson, 2022/02/26