diff options
Diffstat (limited to 'base.lisp')
-rw-r--r-- | base.lisp | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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)))) |