summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base.lisp8
1 files changed, 5 insertions, 3 deletions
diff --git a/base.lisp b/base.lisp
index 2a80086..a5d8b9d 100644
--- a/base.lisp
+++ b/base.lisp
@@ -26,9 +26,11 @@
(let ((next-parser (funcall f nil input))
(inner-limit -1))
(do ((sweep-input input (advance sweep-input)))
- ((or (not (has-data? sweep-input))
- (and limit (> (cursor-distance sweep-input input) limit))
- (> inner-limit -1)) nil)
+ ((or (if limit
+ (> (cursor-distance sweep-input input) limit)
+ (not (has-data? sweep-input)))
+ (> inner-limit -1))
+ nil)
(when (lazy-parsing-p (funcall next-parser sweep-input :lazy t))
(setf inner-limit (cursor-distance sweep-input input))
(when limit (decf limit inner-limit))))