branch: externals/parser-generator
commit 356720c2bb3c969015865cbaaf0f0ba7ca264b1c
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Passing all unit tests using new data structure
---
parser.el | 2 +-
test/parser-test.el | 16 +++++-----------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/parser.el b/parser.el
index 60eb3ab..1208d27 100644
--- a/parser.el
+++ b/parser.el
@@ -11,7 +11,7 @@
(defvar parser--debug
- t
+ nil
"Whether to print debug messages or not.")
(defvar parser--table-terminal-p
diff --git a/test/parser-test.el b/test/parser-test.el
index 80d81b4..b66379a 100644
--- a/test/parser-test.el
+++ b/test/parser-test.el
@@ -120,11 +120,10 @@
(parser--first 'S)))
(message "Passed first 2 with complex grammar")
- (parser--set-grammar '((S A B C) (a b c) ((S A B) (A (B a) e) (B (C b) C) (C
c e)) S) 3)
- (message "FIRST = %s" (parser--first 'S))
+ (parser--set-grammar '((S A B C) (a b c) ((S (A B)) (A (B a) e) (B (C b) C)
(C c e)) S) 3)
(should
(equal
- '((a) (a b) (a c) (a c b) (b) (b a) (b a b) (b a c) c (c a) (c a b) (c a
c) (c b) (c b a) (e))
+ '((a c b) (a) (a c) (a b) (c a) (c a c) (c a b) (b a) (b a c) (b a b) (c
b) (e) (c) (b) (c b a))
(parser--first 'S)))
(message "Passed first 3 with complex grammar")
@@ -136,16 +135,11 @@
(message "Starting tests for (parser--e-free-first)")
;; Example 5.28 p 402
+ (parser--set-grammar '((S A B C) (a b c) ((S (A B)) (A (B a) e) (B (C b) C)
(C c e)) S) 2)
(should
(equal
- '(("c" "a") ("c" "b"))
- (parser--e-free-first
- 2
- 'S
- '((S (A B))
- (A (B "a") e)
- (B (C "b") C)
- (C "c" e)))))
+ '((c b) (c a))
+ (parser--e-free-first 'S)))
(message "Passed empty-free-first 2 with complex grammar")
(message "Passed tests for (parser--empty-free-first)"))