From da008e637b5bff56fed8dfbacc2adabc4bca18b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Tue, 10 Jun 2025 13:57:22 -0300 Subject: Add better reporting and new features Units report expected results on end of input. Opposite parser helps with the complexity explosion on unit parsers. Input and error printing has context. --- extra.lisp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'extra.lisp') diff --git a/extra.lisp b/extra.lisp index b738da7..9451ce8 100644 --- a/extra.lisp +++ b/extra.lisp @@ -21,10 +21,8 @@ (defun many (p) (comp ((x p) - (xs (if x - (optional (many p)) - (fail "Parsing result is empty.")))) - (cons x xs))) + (xs (optional (many p)))) + (if x (cons x xs) xs))) (defun repeat (p min &optional (max 0)) (if (> min 0) -- cgit v1.2.3