diff options
author | Boutade <thegoofist@protonmail.com> | 2019-04-26 12:16:57 -0500 |
---|---|---|
committer | Boutade <thegoofist@protonmail.com> | 2019-04-26 12:16:57 -0500 |
commit | dfdf3d98e204dc40186b5d7e9df07bbdb5b386b0 (patch) | |
tree | c7b1a25b5ed6a804c93f073ce0bbd94c6cef9ac3 | |
parent | de00f09d48e3eff27d27078a134e8b30eb7494bc (diff) |
fixed semantics in <~item<, dunno what I was smokin
-rw-r--r-- | parzival.lisp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/parzival.lisp b/parzival.lisp index a88f52e..d17be0e 100644 --- a/parzival.lisp +++ b/parzival.lisp @@ -41,7 +41,10 @@ (<<def <~item< - (lambda (stream) (values (peek-char nil stream nil nil) t stream)) + (lambda (stream) + (if (peek-char nil stream nil nil) + (funcall <item< stream) + (funcall <fail< stream))) "Results in next item from the input without consuming it.") @@ -170,7 +173,7 @@ is the result of PN." "(<<~SAT PRED) is like (<<SAT PRED) but doesn't consume the item if (FUNCALL PRED ITEM) is false." (<<bind <~item< (lambda (c) (if (funcall pred c) - <item< + (<<result c) <fail<)))) |