[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/parser-generator c1cdf20 197/434: Fixed issue with lex
From: |
ELPA Syncer |
Subject: |
[elpa] externals/parser-generator c1cdf20 197/434: Fixed issue with lex analyzer reached end of input |
Date: |
Mon, 29 Nov 2021 15:59:40 -0500 (EST) |
branch: externals/parser-generator
commit c1cdf20b1e7525f4de02ec3ddb924caf66e5a1e7
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Fixed issue with lex analyzer reached end of input
---
parser-generator-lex-analyzer.el | 20 +++++++++++---------
test/parser-generator-lex-analyzer-test.el | 2 +-
test/parser-generator-lr-test.el | 5 ++---
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/parser-generator-lex-analyzer.el b/parser-generator-lex-analyzer.el
index e2aa7e4..be98fbe 100644
--- a/parser-generator-lex-analyzer.el
+++ b/parser-generator-lex-analyzer.el
@@ -40,9 +40,10 @@
(let ((meta-information))
(condition-case error
(progn
- (setq meta-information (funcall
- parser-generator-lex-analyzer--get-function
- token)))
+ (setq meta-information
+ (funcall
+ parser-generator-lex-analyzer--get-function
+ token)))
(error (error
"Lex-analyze failed to get token meta-data of %s, error: %s"
token
@@ -108,12 +109,13 @@
(funcall
parser-generator-lex-analyzer--function
parser-generator-lex-analyzer--index)))
- (unless (listp (car token))
- (setq token (list token)))
- (let ((first-token (car token)))
- (setq parser-generator-lex-analyzer--index
- (cdr (cdr first-token)))
- (push first-token tokens))))
+ (when token
+ (unless (listp (car token))
+ (setq token (list token)))
+ (let ((first-token (car token)))
+ (setq parser-generator-lex-analyzer--index
+ (cdr (cdr first-token)))
+ (push first-token tokens)))))
(error (error
"Lex-analyze failed to pop token at %s, error: %s"
parser-generator-lex-analyzer--index
diff --git a/test/parser-generator-lex-analyzer-test.el
b/test/parser-generator-lex-analyzer-test.el
index 5cee3f0..e86f8f8 100644
--- a/test/parser-generator-lex-analyzer-test.el
+++ b/test/parser-generator-lex-analyzer-test.el
@@ -125,7 +125,7 @@
(parser-generator-lex-analyzer--pop-token)))
(should
(equal
- '(nil)
+ nil
(parser-generator-lex-analyzer--pop-token)))
(message "Ended tests for (parser-generator-lex-analyzer--pop-token)"))
diff --git a/test/parser-generator-lr-test.el b/test/parser-generator-lr-test.el
index 554f801..75c5fef 100644
--- a/test/parser-generator-lr-test.el
+++ b/test/parser-generator-lr-test.el
@@ -363,7 +363,6 @@
(nreverse tokens))))
(parser-generator-lr-test--parse-incremental-vs-regular)
-
(message "Passed incremental-tests")
;; (parser-generator-set-grammar '((Sp S) ("a" "b") ((Sp S) (S (S "a" S
"b")) (S e)) Sp))
@@ -374,7 +373,7 @@
;; (setq
;; parser-generator-lex-analyzer--function
;; (lambda (index)
- ;; (let* ((string '(("a" 1 . 2) ("a" 2 . 3) ("b" 3 . 4) ("b" 4 . 5)))
+ ;; (let* ((string '(("a" 1 . 2) ("a" 2 . 3) ("b" 3 . 4)))
;; (string-length (length string))
;; (max-index index)
;; (tokens))
@@ -552,7 +551,7 @@
(defun parser-generator-lr-test ()
"Run test."
- ;; (setq debug-on-error t)
+ (setq debug-on-error t)
(parser-generator-lr-test--items-for-prefix)
(parser-generator-lr-test--items-valid-p)
- [elpa] externals/parser-generator 796b41b 192/434: Passed unit tests for follow function, (continued)
- [elpa] externals/parser-generator 796b41b 192/434: Passed unit tests for follow function, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 33634dd 193/434: Passing all tests after refactor, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator ba8e501 194/434: Added failing first test with complex case, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 71d213b 201/434: More work on Canonical LR(k) Parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d7ad86c 200/434: Added TODO item for LRk Canonical Parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 7a175a8 205/434: Passed first unit test for grammar prefixes, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 517ed12 212/434: Passing some more unit tests after refactor, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator f4ba363 031/434: Improved README.md, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 744fdf6 174/434: Added TODO item, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator d360e8a 176/434: Added failing unit test for FIRST function with starting e-identifier, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator c1cdf20 197/434: Fixed issue with lex analyzer reached end of input,
ELPA Syncer <=
- [elpa] externals/parser-generator 446cbe9 217/434: Refactored unit tests and separated k=2 case, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 1818b9d 199/434: Added error in action-tables generation if no accept action is found, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 54857e4 220/434: Added failing unit test for translation via LRk, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator a96ab3a 222/434: More debugging LR k > 1, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 783ea61 227/434: Added translation-symbol-table to incremental parser and translater, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 439d894 228/434: Passed all LR k=1 tests with more work on generalized solution, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 47fb35e 229/434: More work on a more generalized LR Parser, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 9b6e076 231/434: Using lowercase epsilon for e-identifier comment, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator 01173e2 230/434: Added EOF identifier, passing all unit tests, ELPA Syncer, 2021/11/29
- [elpa] externals/parser-generator a76bb98 240/434: Added comments, ELPA Syncer, 2021/11/29