emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/parser-generator f449039 346/434: More debugging


From: ELPA Syncer
Subject: [elpa] externals/parser-generator f449039 346/434: More debugging
Date: Mon, 29 Nov 2021 16:00:12 -0500 (EST)

branch: externals/parser-generator
commit f449039a21797a572e2a64ef097051bd7b7a0db6
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    More debugging
---
 test/parser-generator-lr-test.el | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/test/parser-generator-lr-test.el b/test/parser-generator-lr-test.el
index 57f7381..638137e 100644
--- a/test/parser-generator-lr-test.el
+++ b/test/parser-generator-lr-test.el
@@ -1011,7 +1011,7 @@
 
     (should
      (equal
-      '(("begin" "test" "end"))
+      '("begin" "test" "end")
       (parser-generator-lr-translate)))
 
     (message "Passed translation k=2")
@@ -1236,7 +1236,21 @@
     (insert "1+1")
 
     (parser-generator-set-grammar
-     '((S E B) ("*" "+" "0" "1") ((S (E $)) (E (E "*" B (lambda(args) (let 
((ret (list (nth 0 args)))) (when (nth 2 args) (setq ret (append ret `(" x " 
,(nth 2 args))))) ret))) (E "+" B (lambda(args) (let ((ret (list (nth 0 
args)))) (when (nth 2 args) (setq ret (append ret `(" . " ,(nth 2 args))))) 
ret))) (B)) (B ("0") ("1"))) S))
+     '(
+       (S E B)
+       ("*" "+" "0" "1")
+       (
+        (S (E $))
+        (E
+         (E "*" B (lambda(args) (let ((ret (nth 0 args))) (when (nth 2 args) 
(setq ret (append ret `(" x " ,(nth 2 args))))) ret)))
+         (E "+" B (lambda(args) (let ((ret (nth 0 args))) (when (nth 2 args) 
(setq ret (append ret `(" . " ,(nth 2 args))))) ret)))
+         (B)
+         )
+        (B
+         ("0")
+         ("1"))
+        )
+       S))
     (parser-generator-set-look-ahead-number 0)
     (parser-generator-process-grammar)
     (parser-generator-lr-generate-parser-tables)
@@ -1246,7 +1260,7 @@
      parser-generator-lex-analyzer--function
      (lambda (index)
        (with-current-buffer buffer
-         (when (<= (+ index 1) (point-max))
+         (when (< index (point-max))
            (let ((start index)
                  (end (+ index 1)))
              (let ((token (buffer-substring-no-properties start end)))
@@ -1260,6 +1274,7 @@
            (when (<= end (point-max))
              (buffer-substring-no-properties start end))))))
 
+    (parser-generator-lr-translate)
     (should
      (equal
       '((("1")) " . " ("1"))
@@ -1308,7 +1323,7 @@
 
     (should
      (equal
-      "bbaaba"
+      "bbaa"
       (parser-generator-lr-translate)))
 
     (kill-buffer buffer))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]