[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator 32e2c15 024/434: Fixed bug with e-prod
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator 32e2c15 024/434: Fixed bug with e-production |
Date: |
Mon, 29 Nov 2021 15:59:01 -0500 (EST) |
branch: externals/parser-generator
commit 32e2c157563a352b21a5aaa903406a556271f63a
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Fixed bug with e-production
---
parser.el | 13 +++++++------
test/parser-test.el | 2 +-
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/parser.el b/parser.el
index be01ce3..34b3ae7 100644
--- a/parser.el
+++ b/parser.el
@@ -383,16 +383,17 @@
;; Should branch off here, each unique
permutation should be included in set
;; Follow first alternative in this scope
but follow the rest in separate scopes
(let ((sub-terminal-index 0))
- (dolist (sub-terminal-set
sub-terminal-sets)
+ (dolist (sub-terminal-alternative-set
sub-terminal-sets)
(unless (= sub-terminal-index 0)
+ (parser--debug (message
"Sub-terminal-alternative-set: %s" sub-terminal-alternative-set))
;; When we have a leading terminal and
sub-terminal set is empty, don't append it
(when (and
- (> leading-terminals-count 0)
- (parser--valid-e-p
sub-terminal-set))
- (setq sub-terminal-set nil))
+ (< input-tape-index (1-
input-tape-length))
+ (parser--valid-e-p (car
sub-terminal-alternative-set)))
+ (setq sub-terminal-alternative-set
nil))
- (let ((sub-rhs-leading-terminals
(append leading-terminals sub-terminal-set)))
+ (let ((sub-rhs-leading-terminals
(append leading-terminals sub-terminal-alternative-set)))
(when (> (length
sub-rhs-leading-terminals) k)
(setq sub-rhs-leading-terminals
(butlast sub-rhs-leading-terminals (- (length sub-rhs-leading-terminals) k))))
(push `(,sub-rhs-leading-terminals
,all-leading-terminals-p ,(1+ input-tape-index)) stack)))
@@ -400,7 +401,7 @@
(parser--debug (message "Sub-terminal-set: %s"
sub-terminal-set))
(when (or
- (not (parser--valid-e-p
sub-terminal-set))
+ (not (parser--valid-e-p (car
sub-terminal-set)))
(= input-tape-index (1-
input-tape-length)))
(setq leading-terminals (append
leading-terminals sub-terminal-set))
(setq leading-terminals-count (+
leading-terminals-count (length sub-terminal-set)))
diff --git a/test/parser-test.el b/test/parser-test.el
index 2004fa3..2d82ea1 100644
--- a/test/parser-test.el
+++ b/test/parser-test.el
@@ -94,7 +94,7 @@
(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) 1)
(should
(equal
- '((a) (b) (c) (e))
+ '((e) (c) (b) (a))
(parser--first 'S)))
(message "Passed first 1 with complex grammar")
- [elpa] externals/parser-generator 0aed7b0 339/434: More work on global precedence in LR(k) parser, (continued)
- [elpa] externals/parser-generator 0aed7b0 339/434: More work on global precedence in LR(k) parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator b84ed5e 342/434: Fixed issue with infix calculator translation test, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator f449039 346/434: More debugging, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 34f95b3 351/434: More debugging infix calculator, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator bb82646 356/434: More debugging, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator b040d9b 357/434: Tests for infix calculator working, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 4404424 367/434: Added test for parsing context-sensitive attributes, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 2ad866c 371/434: Context-sensitive attribute are now tested through specified comparison function, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 9d5df0e 375/434: More working on trying to get the Infix example working, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 8fb8676 376/434: More work on Infix math example, passing another test, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 32e2c15 024/434: Fixed bug with e-production,
ELPA Syncer <=
- [elpa] externals/parser-generator 26bf153 037/434: Setting look-ahead-number is now separated from setting grammar, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator a54061c 055/434: Debugging of new algorithm, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 62d06a0 063/434: Passing unit test for V(Sa), ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 186d7bb 065/434: Renamed function lr-items to lr-items-for-prefix, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 9792eeb 069/434: Added TODO items, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 08b40cd 071/434: Updated header levels in README, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 5da1b28 079/434: Added TODO item, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 79565f4 089/434: Fixed sorting of columns in GOTO-table, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 043e375 095/434: Refactored LR-parser into stand-alone file, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 4f81d98 107/434: Sorting each row in action-table, ELPA Syncer, 2021/11/29