From 9566e92321a1ed29a7f5903a3ba4ab16de3783b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 31 Dec 2025 16:14:31 -0300 Subject: Type check functions --- main.lisp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main.lisp') diff --git a/main.lisp b/main.lisp index 8938f14..3e6f255 100644 --- a/main.lisp +++ b/main.lisp @@ -1,12 +1,12 @@ (in-package #:monparser) +(declaim (ftype (function (parser string) result) parse)) (defun parse (parser data) - (if (typep data 'string) - (funcall parser - (make-instance 'text :data data) - (make-instance 'text :data data)) - (error "Only string parsing is allowed."))) + (funcall parser + (make-instance 'cursor :data data) + (make-instance 'cursor :data data))) +(declaim (ftype (function (parser string) parser) append-on-failure)) (defun append-on-failure (p message) (lambda (start input) (let ((result (funcall p start input))) -- cgit v1.2.3