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

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

[nongnu] elpa/parseclj 43f59dcb91 043/185: Avoid dropping whitespaces, h


From: ELPA Syncer
Subject: [nongnu] elpa/parseclj 43f59dcb91 043/185: Avoid dropping whitespaces, handling them while reducing
Date: Tue, 28 Dec 2021 14:05:13 -0500 (EST)

branch: elpa/parseclj
commit 43f59dcb91b6cd78bc9e753b1ad53abd0bef0fa8
Author: Daniel Barreto <dbarreto@talpor.com>
Commit: Daniel Barreto <dbarreto@talpor.com>

    Avoid dropping whitespaces, handling them while reducing
---
 clj-parse.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/clj-parse.el b/clj-parse.el
index 618d8f169b..bd2156f071 100644
--- a/clj-parse.el
+++ b/clj-parse.el
@@ -99,14 +99,10 @@
      ((eq first-char ?o) (string-to-number (substring c 2) 8))
      (t first-char))))
 
-(defun clj-parse--next ()
-  (setq next (clj-lex-next))
-  (while (eq (clj-lex-token-type next) :whitespace)
-    (setq next (clj-parse--next)))
-  next)
-
 (defun clj-parse--ast-reduce1 (stack leaf)
-  (push leaf stack))
+  (if (eq (clj-lex-token-type leaf) :whitespace)
+      stack
+    (push leaf stack)))
 
 (defun clj-parse--ast-reduceN (stack node subnodes)
   (push
@@ -142,7 +138,7 @@
 (defun clj-parse-reduce (reduce1 reduceN)
   (let ((stack nil))
 
-    (while (not (eq (clj-lex-token-type (setq token (clj-parse--next))) :eof))
+    (while (not (eq (clj-lex-token-type (setq token (clj-lex-next))) :eof))
       (message "STACK: %S" stack)
       (message "TOKEN: %S\n" token)
 



reply via email to

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