Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

fix: separated_by crashes with an error when it shouldn't (#799)#830

Closed
Hedgehogo wants to merge 4 commits into
zesterer:mainfrom
Hedgehogo:fix_separated_by
Closed

fix: separated_by crashes with an error when it shouldn't (#799)#830
Hedgehogo wants to merge 4 commits into
zesterer:mainfrom
Hedgehogo:fix_separated_by

Conversation

@Hedgehogo

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread src/combinator.rs
Comment on lines +2025 to +2033
if !first_loop {
debug_assert!(
before != inp.cursor(),
"found SeparatedBy combinator making no progress at {}",
self.location,
);
} else {
first_loop = false;
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Maybe this logic should be moved to the IterParser implementation so it works for .separated_by(...).collect() too? What do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Maybe this logic should be moved to the IterParser implementation so it works for .separated_by(...).collect() too? What do you think?

I've been thinking, I think we need the ability to call next by telling it whether to respond to a lack of progress.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants