[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode ed8db6b5b7 08/27: Improved debug output
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode ed8db6b5b7 08/27: Improved debug output |
Date: |
Sat, 4 Mar 2023 03:24:56 -0500 (EST) |
branch: externals/phps-mode
commit ed8db6b5b78915cbf21e0e93fe632d56835519f4
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Improved debug output
---
phps-mode-test.el | 14 +++++
test/phps-mode-test-ast.el | 12 +----
test/phps-mode-test-parser.el | 122 ++++--------------------------------------
3 files changed, 26 insertions(+), 122 deletions(-)
diff --git a/phps-mode-test.el b/phps-mode-test.el
index 6193a9a981..d41313f974 100644
--- a/phps-mode-test.el
+++ b/phps-mode-test.el
@@ -188,6 +188,20 @@ Each element is a list: (list key value), optionally
UN-SORTED."
(< (car a) (car b)))))))
nil)))
+(defun phps-mode-test--output-parse-productions (parse)
+ "Output productions by PARSE trail."
+ (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)))
+ (message
+ "%d: %S -> %S"
+ production-number
+ (car (car production))
+ (car (cdr production)))))
+ (message "\n"))
+
(transient-mark-mode t)
(electric-pair-mode t)
(setq phps-mode-async-process nil)
diff --git a/test/phps-mode-test-ast.el b/test/phps-mode-test-ast.el
index 7a55cc0e7e..716ddcdc96 100644
--- a/test/phps-mode-test-ast.el
+++ b/test/phps-mode-test-ast.el
@@ -24,17 +24,7 @@
name
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production))))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(phps-mode-ast--generate)
;; (message "symbol-table: \n%S\n"
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index b4ba6e51a1..b2d4abdcb9 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -11,7 +11,7 @@
;;; Code:
(require 'ert)
-(require 'phps-mode)
+(require 'phps-mode-test)
(require 'phps-mode-lex-analyzer)
(defun phps-mode-test-parser--buffer-contents (buffer-contents name logic)
@@ -75,17 +75,7 @@
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(84 198 202 443 297 330 328 327 442 446 81 443 243 91 274 262 258
280 444 140 323 444 300 302 296 330 328 327 442 446 81 443 243 91 274 262 258
280 444 140 323 444 300 302 296 330 328 327 442 446 81 443 243 91 274 262 258
280 444 140 323 444 300 302 296 185 103 108 83)
@@ -97,17 +87,7 @@
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(84 443 297 330 328 327 81 474 426 443 343 342 299 302 296 190 104
108 83 198 202 443 297 91 459 305 307 304 296 185 103 108 83)
@@ -121,17 +101,7 @@
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(84 472 479 426 347 346 157 107 83)
@@ -143,17 +113,7 @@
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(84 472 479 426 347 346 157 107 83)
@@ -165,17 +125,7 @@
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(84 472 479 426 347 346 157 107 83)
@@ -218,17 +168,7 @@
"Advanced echo test with 2 echo sections"
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(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)
@@ -239,17 +179,7 @@
"Simple function defintion"
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(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)
@@ -260,17 +190,7 @@
"Simple function defintion inside un-bracketed namespace"
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(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)
@@ -281,17 +201,7 @@
"Simple function defintion inside bracketed namespace"
(lambda()
(let ((parse (phps-mode-parser-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)))
- (message
- "%d: %S -> %S"
- production-number
- (car (car production))
- (car (cdr production)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(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)
@@ -302,17 +212,7 @@
"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 in reverse:\n%S\n"
parse)
- (dolist (production-number 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)))))
- (message "\n")
+ (phps-mode-test--output-parse-productions parse)
(should
(equal
'(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)
- [elpa] externals/phps-mode updated (5c0414fa94 -> 36fd241124), Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 925ed6881f 01/27: Updated grammar URL, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 7d2dea0517 04/27: Improved documentation about failed download, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode a9242bf8b9 03/27: Using parser-generator downloaded from GNU ELPA, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode ada66dc7f3 09/27: Updated lexer for PHP 8.2, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 1ac3e40e4d 13/27: Removed deletion of byte-compiled file when generating parser, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 3d1bb67d45 05/27: Removed memory limit on parser generation automation script, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 5f820bd073 02/27: Improved documentation about grammar generation, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 9fca589a4f 06/27: Updated parser to 8.2, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode ed8db6b5b7 08/27: Improved debug output,
Christian Johansson <=
- [elpa] externals/phps-mode f4a26e193d 16/27: Updated and parser tests to 8.2, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 9b6c89191b 12/27: Fixed typo, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 9cade60362 17/27: More notes on automation, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 2c39b1af73 20/27: Updated SDT to production 350, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 37fd682568 07/27: Added failing unit tests for PHP 8.2, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 4636d702ac 10/27: Improved tests for PHP 8.2, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 54fec9e358 15/27: Removed note about error occuring, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 2a296e0947 11/27: Updated output in parser generator automation, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode ebe8fb9a36 14/27: Removed debug-on-signal in automation scripts, Christian Johansson, 2023/03/04
- [elpa] externals/phps-mode 45d3898837 19/27: More work on SDT, Christian Johansson, 2023/03/04