(in-package #:monparser) (defun parse (parser data) (let* ((result (funcall parser (make-instance 'parser-input :cursor 0 :data data)))) (if (parsing-p result) (let ((finished? (not (has-data? (parsing-left result))))) (values (parsing-tree result) finished?)) (error (format nil "~a" 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))))