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. --- main.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main.lisp') diff --git a/main.lisp b/main.lisp index c0fd49c..197f1b2 100644 --- a/main.lisp +++ b/main.lisp @@ -6,9 +6,9 @@ :data data)))) (if (parsing-p result) (let ((finished? (not (has-data? (parsing-left result))))) - (values (parsing-tree result) finished?)) - (error (format nil "~a" result))))) + (values result finished?)) + result))) (defmethod print-object ((obj failure) stream) (multiple-value-bind (line column) (line-and-column (failure-place obj)) - (format stream "~a:~a: ~a" line column (failure-message obj)))) + (format stream "~a:~a: ~a~&~a" line column (failure-message obj) (failure-place obj)))) -- cgit v1.2.3