From 2ebab36f8c689fa3e6f88cfc25cecd83848ca129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Mon, 24 Nov 2025 07:01:47 -0300 Subject: Big update --- main.lisp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'main.lisp') diff --git a/main.lisp b/main.lisp index 6cc0007..6d6ef8e 100644 --- a/main.lisp +++ b/main.lisp @@ -1,17 +1,16 @@ (in-package #:monparser) (defun parse (parser data) - (let* ((result (funcall parser - (make-instance 'cursed:text - :data data)))) - (if (parsing-p result) - (let ((finished? (not (cursed:has-data? (parsing-end result))))) - (values (parsing-tree result) finished?)) - result))) + (if (typep data 'string) + (funcall parser + (make-instance 'text :data data) + (make-instance 'text :data data)) + (error "Only string parsing is allowed."))) (defun append-on-failure (p message) - (lambda (input) - (let ((result (funcall p input))) + (lambda (start input) + (declare (ignore start)) + (let ((result (funcall p input input))) (if (failure-p result) (make-failure :place (failure-place result) :message (concatenate 'string message (failure-message result)) -- cgit v1.2.3