[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator 1ae36fc 029/434: Added support for cal
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator 1ae36fc 029/434: Added support for calculating first of a sentential form |
Date: |
Mon, 29 Nov 2021 15:59:02 -0500 (EST) |
branch: externals/parser-generator
commit 1ae36fc70b4f8a6aae9f7a694bc567899178beca
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Added support for calculating first of a sentential form
---
parser.el | 3 +--
test/parser-test.el | 18 +++++++++++++-----
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/parser.el b/parser.el
index b153d84..60eb3ab 100644
--- a/parser.el
+++ b/parser.el
@@ -498,8 +498,7 @@
;; Iterate each symbol in β using a PDA algorithm
(let ((input-tape β)
(input-tape-length (length β))
- (stack '((0 0 nil)))
- (first-list nil))
+ (stack '((0 0 nil))))
(while stack
(let ((stack-topmost (pop stack)))
(parser--debug
diff --git a/test/parser-test.el b/test/parser-test.el
index 1a2b2fc..80d81b4 100644
--- a/test/parser-test.el
+++ b/test/parser-test.el
@@ -35,11 +35,19 @@
(parser--first 'S)))
(message "Passed first 1 with rudimentary grammar")
- ;; (should
- ;; (equal
- ;; '((a a))
- ;; (parser--first '(S a))))
- ;; (message "Passed first 1b with rudimentary grammar")
+ (parser--set-grammar '((S) (a) ((S a)) S) 1)
+ (should
+ (equal
+ '((a))
+ (parser--first '(S a))))
+ (message "Passed first 1b with rudimentary grammar")
+
+ (parser--set-grammar '((S) (a) ((S a)) S) 2)
+ (should
+ (equal
+ '((a a))
+ (parser--first '(S a))))
+ (message "Passed first 1c with rudimentary grammar")
(parser--set-grammar '((S) ("a" "b" "c") ((S ("a" "b" "c"))) S) 2)
(should
- [elpa] externals/parser-generator f213255 348/434: Passed all old unit tests again after translation refactor, (continued)
- [elpa] externals/parser-generator f213255 348/434: Passed all old unit tests again after translation refactor, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 886af5c 349/434: Uncommented export tests until refactor is ok, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 99aa5b6 350/434: Added more unit tests for calculator, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d8fb2da 354/434: Just white-space fixes, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 3964649 359/434: Added more failing unit tests, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 6e0e781 360/434: More debugging, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 2c262a4 362/434: Added new error when there is grammar conflict in action-table generation and no precedence comparison function is defined, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator a7a9506 366/434: Refactored structure of context-sensitive attributes, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 98ab0e4 377/434: More work on precedence logic in unit tests, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1b8f025 016/434: More work on validating a grammar structure, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1ae36fc 029/434: Added support for calculating first of a sentential form,
ELPA Syncer <=
- [elpa] externals/parser-generator 38c2040 032/434: Improved markdown code examples, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator e463bae 041/434: Passing tests for sorting lists, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 840c418 044/434: Improved comment about follow function, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 2a3a02d 083/434: Removed cache for LR-items for prefixes, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 3ba5250 090/434: Removed debugging stuff, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 83298fe 099/434: Passing test for function that generates possible look-ahead permutations, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator e9697ea 100/434: Added function that tests if a look-ahead is valid or not, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 53c09f7 119/434: Added hash-table for productions indexed by production-number, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 58e5806 129/434: Renamed plugin from parser to parser-generator, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 0695275 143/434: More updates to docs, ELPA Syncer, 2021/11/29