diff options
| author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2024-10-15 12:23:57 -0300 |
|---|---|---|
| committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2024-10-15 12:23:57 -0300 |
| commit | fd376f92536a7a1d8016292f5dbbab9e5af964e3 (patch) | |
| tree | fd16e32a0193b58898f241ce7ff3beb179f32da1 | |
| parent | c28d61423b1217190271dfcaba7211ded76f5e3d (diff) | |
| download | monparser-fd376f92536a7a1d8016292f5dbbab9e5af964e3.tar.gz monparser-fd376f92536a7a1d8016292f5dbbab9e5af964e3.zip | |
Simplify sweep condition
| -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)))) |
