diff options
| author | John Turner <jturner.usa@gmail.com> | 2025-11-25 06:48:20 +0000 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2025-11-25 06:48:20 +0000 |
| commit | 8be071ab980c6080732daec565c35de242eaccf7 (patch) | |
| tree | 41b7caeb98121060f5cc5443079096aedda9c4fb | |
| parent | 8fae8ec266f1eef3c52cbc9ad114abc4950d19d9 (diff) | |
| download | mon-8be071ab980c6080732daec565c35de242eaccf7.tar.gz | |
assert that iterator makes progress in Many combinator, in debug mode
| -rw-r--r-- | src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -445,10 +445,16 @@ where while !it.is_finished() { it = match self.parser.next::<OM, EM>(it.clone(), &mut state) { Some(Ok((rest, output))) => { + debug_assert!( + rest.position() > it.position(), + "iterator failed to make progress" + ); + outputs = OM::combine(outputs, output, |mut acc, e| { acc.push(e); acc }); + rest } _ => break, |
