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

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

[elpa] externals/parser-generator 72796d0 408/434: Fixed bug with FIRST


From: ELPA Syncer
Subject: [elpa] externals/parser-generator 72796d0 408/434: Fixed bug with FIRST calculation with multiple symbols and e-identifiers
Date: Mon, 29 Nov 2021 16:00:26 -0500 (EST)

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

    Fixed bug with FIRST calculation with multiple symbols and e-identifiers
---
 parser-generator.el | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/parser-generator.el b/parser-generator.el
index 317cc72..37cd085 100644
--- a/parser-generator.el
+++ b/parser-generator.el
@@ -17,7 +17,7 @@
 
 (defvar
   parser-generator--debug
-  nil
+  t
   "Whether to print debug messages or not.")
 
 (defvar
@@ -1690,12 +1690,26 @@
                       (cond
 
                        ((parser-generator--valid-e-p symbol)
+
+                        ;; When there a symbols left on stack, make 
alternative trail by skipping this symbol
+                        (unless (or
+                                 disallow-e-first
+                                 (= input-tape-index (1- input-tape-length)))
+                          (parser-generator--debug
+                           (message
+                            "Pushed alternative trail to stack since symbol is 
e-identifier: %s"
+                            `(,(1+ input-tape-index) ,first-length ,first)))
+                          (push
+                           `(,(1+ input-tape-index) ,first-length ,first)
+                           stack))
+
                         (if disallow-e-first
                             (when (> first-length 0)
                               (setq first (append first (list symbol)))
                               (setq first-length (1+ first-length)))
                           (setq first (append first (list symbol)))
                           (setq first-length (1+ first-length)))
+
                         (setq keep-looking nil))
 
                        ((parser-generator--valid-eof-p symbol)



reply via email to

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