diff options
Diffstat (limited to 'parser.lisp')
-rw-r--r-- | parser.lisp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/parser.lisp b/parser.lisp index 7567b1f..c07120d 100644 --- a/parser.lisp +++ b/parser.lisp @@ -29,11 +29,11 @@ (funcall (funcall f (parsing-tree r)) (parsing-left r)) r)))) -(defun discarding-bind (p q) +(defun discarding-bind (p f) (lambda (input) (let ((r (funcall p input))) (if (parsing-p r) - (funcall q (parsing-left r)) + (funcall (funcall f) (parsing-left r)) r)))) (defmacro comp (bindings &body body) @@ -42,7 +42,7 @@ (let ((v (first (car bindings))) (p (second (car bindings)))) (if (string= (symbol-name v) "_") - `(discarding-bind ,p (comp ,(cdr bindings) ,@body)) + `(discarding-bind ,p (lambda () (comp ,(cdr bindings) ,@body))) `(bind ,p (lambda (,v) (comp ,(cdr bindings) ,@body))))))) (defun fail (&optional (message "Unknown error.")) |