summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2022-11-03 03:37:49 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2022-11-03 03:37:49 -0300
commit94dda7a8e56d6db537e307b1ec3cf59b8d70a629 (patch)
tree4b00811c9b5393a23ae34ef320965d39bb32453b
parentfc47efcfc2ac497b4e013e68ea0984232b5c3e71 (diff)
downloadmonparser-94dda7a8e56d6db537e307b1ec3cf59b8d70a629.tar.gz
monparser-94dda7a8e56d6db537e307b1ec3cf59b8d70a629.zip
Add empty value feature to comp
-rw-r--r--parser.lisp4
1 files changed, 3 insertions, 1 deletions
diff --git a/parser.lisp b/parser.lisp
index 37abb75..30c68fd 100644
--- a/parser.lisp
+++ b/parser.lisp
@@ -54,7 +54,9 @@
`(new (progn ,@body))
(let ((v (first (car bindings)))
(p (second (car bindings))))
- `(bind ,p (lambda (,v) (comp ,(cdr bindings) ,@body))))))
+ (if (eq v '_)
+ `(bind ,p (lambda () (comp ,(cdr bindings) ,@body)))
+ `(bind ,p (lambda (,v) (comp ,(cdr bindings) ,@body)))))))
(defparameter nothing
(new nil))