summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2024-10-15 12:23:57 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2024-10-15 12:23:57 -0300
commitfd376f92536a7a1d8016292f5dbbab9e5af964e3 (patch)
treefd16e32a0193b58898f241ce7ff3beb179f32da1
parentc28d61423b1217190271dfcaba7211ded76f5e3d (diff)
downloadmonparser-fd376f92536a7a1d8016292f5dbbab9e5af964e3.tar.gz
monparser-fd376f92536a7a1d8016292f5dbbab9e5af964e3.zip
Simplify sweep condition
-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))))