[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator 7584880 298/434: Added failing unit te
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator 7584880 298/434: Added failing unit test for calculating FIRST in grammar with cycles |
Date: |
Mon, 29 Nov 2021 16:00:02 -0500 (EST) |
branch: externals/parser-generator
commit 75848809cc49efc0f3e6acb1a97b6c408e7aee90
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added failing unit test for calculating FIRST in grammar with cycles
---
parser-generator.el | 15 ++++++++++-----
test/parser-generator-test.el | 19 +++++++++++++++++++
2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/parser-generator.el b/parser-generator.el
index ad5c190..33c48c9 100644
--- a/parser-generator.el
+++ b/parser-generator.el
@@ -824,7 +824,7 @@
(setq
expanded-all-second
t))
- (when (> i 1000)
+ (when (> i 100)
(error "Endless loop!"))
(parser-generator--debug (message "i = %s" i))
(setq
@@ -915,12 +915,13 @@
production-lhs
f-set)))
- ;; If another set has not been fully expanded
+ ;; If another RHS has not been fully expanded
;; mark LHS as not fully expanded
(unless (nth 0 existing-f-set)
(parser-generator--debug
(message
- "Expanded-all negative set because a sub-set
'%s' is not fully expanded"
+ "Expanded-all negative set for LHS '%s' because
a alternative RHS '%s' is not fully expanded"
+ production-lhs
existing-f-set))
(setq
expanded-all
@@ -1137,7 +1138,9 @@
(not (equal lhs (list rhs-element))))
(parser-generator--debug
(message
- "Expanded-all negative set because sub-terminals
of '%s' has not been fully expanded" rhs-element))
+ "Expanded-all negative set for '%s' because
sub-terminals of '%s' has not been fully expanded"
+ lhs
+ rhs-element))
(setq
expanded-all
nil))
@@ -1305,7 +1308,9 @@
(parser-generator--debug
(message
- "Expanded-all negative set because symbol '%s' is a
non-terminal and i is zero" rhs-element))
+ "Expanded-all negative set for '%s' because symbol '%s'
is a non-terminal and i is zero"
+ lhs
+ rhs-element))
(setq
expanded-all
nil)
diff --git a/test/parser-generator-test.el b/test/parser-generator-test.el
index 6d23e5e..16165ea 100644
--- a/test/parser-generator-test.el
+++ b/test/parser-generator-test.el
@@ -383,6 +383,25 @@
(parser-generator--first 'S)))
(message "Passed first 9 with complex grammar with starting e-identifier
variant 2")
+ (parser-generator-set-grammar
+ '(
+ (Sp S A B)
+ (a b c)
+ (
+ (Sp S)
+ (S A B)
+ (A (a b A) (B c))
+ (B S c)
+ )
+ Sp))
+ (parser-generator-set-look-ahead-number 1)
+ (parser-generator-process-grammar)
+ (should
+ (equal
+ '((a) (c))
+ (parser-generator--first 'Sp)))
+ (message "Passed first 10 with complex grammar that contains cyclic loops")
+
(message "Passed tests for (parser-generator--first)"))
(defun parser-generator-test--e-free-first ()
- [elpa] externals/parser-generator 08b696f 267/434: Fixed typo in doc about token, (continued)
- [elpa] externals/parser-generator 08b696f 267/434: Fixed typo in doc about token, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator b80fc6e 264/434: Updated README, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1b9d8db 268/434: Improved wording about lexical analysis, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 3615fad 276/434: Fixed issue with lex-analyzer in LR(0) Parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 732cd78 282/434: Constants and variables are exported correctly, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator cbf9e07 278/434: Added documentation about LR(0) Parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator af71d8b 285/434: Lex-analyzer is now exported, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 500d082 284/434: Added Lex-Analyzer Rest Function to export, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator cf42e67 288/434: Exported parser passes test, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1e0418d 295/434: Incremental parse and translate of exported parser passes tests, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 7584880 298/434: Added failing unit test for calculating FIRST in grammar with cycles,
ELPA Syncer <=
- [elpa] externals/parser-generator f338734 303/434: Improved output of progress, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 98c9d94 213/434: Debugging parse with look-ahead > 1, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 2b0d5b8 215/434: More debugging, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 640feed 216/434: Passing all tests for canonical LRk Parser with k = 1, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator e5aa179 218/434: Some fixes for LRk parser k > 1, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 2a9a23e 219/434: More debugging, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator ddd5967 221/434: Passed test for nested translations, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator bc817d1 224/434: Passing all tests for k=1 again, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator b2f1d7a 236/434: More debugging k > 1, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 16f6586 242/434: Fixed bug in lr-item generation were look-ahead was disregarded, ELPA Syncer, 2021/11/29