From 35c3281a9ad02c9c345f4315fba36dd6d16549aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Fri, 6 Jun 2025 02:12:34 -0300 Subject: Make unit more generic and remove unused variable in comp --- core.lisp | 4 ++-- 1 file 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) "_") -- cgit v1.2.3