summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2025-06-06 02:12:34 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2025-06-06 02:12:34 -0300
commit35c3281a9ad02c9c345f4315fba36dd6d16549aa (patch)
tree06fdafe260f766258e203aa2ac9a9d9ebb23c01a
parent66e85e52ec8ef84275e2051a5ed2ab0e7c6cbea3 (diff)
downloadmonparser-35c3281a9ad02c9c345f4315fba36dd6d16549aa.tar.gz
monparser-35c3281a9ad02c9c345f4315fba36dd6d16549aa.zip
Make unit more generic and remove unused variable in comp
-rw-r--r--core.lisp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core.lisp b/core.lisp
index 9bda418..2cd0120 100644
--- a/core.lisp
+++ b/core.lisp
@@ -6,7 +6,7 @@
(defmacro unit (&optional predicate)
(cond ((null predicate)
- (setf predicate '(characterp it)))
+ (setf predicate 't))
((symbolp predicate)
(setf predicate `(,predicate it)))
((characterp predicate)
@@ -59,12 +59,12 @@
(declare (ignore lazy))
(lazily-select-parser input (list ,first-parser ,second-parser ,@other-parsers))))
+;;; TODO: Find a way to be able to use the input without needing to define a name for it.
(defmacro comp (bindings &body body)
(if (null bindings)
`(new (progn ,@body))
(let ((var (first (car bindings)))
(parser (second (car bindings)))
- (lazy (third (car bindings)))
(unused (gensym)))
(if (symbolp var)
(if (string= (symbol-name var) "_")