Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Add recognize_till #541

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

9999years
Copy link
Contributor

@9999years 9999years commented Jun 14, 2024

This is a variant of repeat_till that recognizes the repeated portion of the input instead of accumulating it.

See: “Recognizing repeat_till0 to () without the suffix”.

I have found this combinator useful in my own code for recognizing ambiguous delimiters.

This code needs to be cleaned up before being merged (we'd probably want a Range argument and an infinite loop check, for example), so consider this a proof of concept. If you're on board with the idea, let me know what the next steps are. Otherwise, feel free to close this PR. Thanks!

This is a variant of `repeat_till` that recognizes the repeated portion
of the input instead of accumulating it.

See: [“Recognizing `repeat_till0` to `()` without the suffix”][1]

[1]: winnow-rs#336 (reply in thread)
@coveralls
Copy link

coveralls commented Jun 14, 2024

Pull Request Test Coverage Report for Build 9523540454

Details

  • 0 of 17 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 41.848%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/combinator/multi.rs 0 17 0.0%
Files with Coverage Reduction New Missed Lines %
src/macros/seq.rs 2 85.71%
Totals Coverage Status
Change from base Build 9407425121: 0.2%
Covered Lines: 1309
Relevant Lines: 3128

💛 - Coveralls

9999years added a commit to MercuryTechnologies/ghciwatch that referenced this pull request Jun 21, 2024
9999years added a commit to MercuryTechnologies/ghciwatch that referenced this pull request Jun 21, 2024
9999years added a commit to MercuryTechnologies/ghciwatch that referenced this pull request Jun 21, 2024
@epage epage marked this pull request as draft June 21, 2024 21:23
@epage
Copy link
Collaborator

epage commented Jun 21, 2024

Moved to draft as I take a fairly strict policy to close (or move to draft) PRs that have not formerly been accepted

  • This keeps the solution discussion centralized in the Issue and the implementation discussion in the PR
  • This focuses us on the solution discussion without getting distracted by the implementation discussion
  • I have found that PRs put (intended or not) social pressure on maintainers to "move things forward" because someone has already invested time into this. I tend to see maintainers either give in and burn out or become apathetic to contributions.

9999years added a commit to MercuryTechnologies/ghciwatch that referenced this pull request Jun 21, 2024
@9999years
Copy link
Contributor Author

@epage That's OK by me. Would you like me to open an issue for recognizing the repeated part of a repeat_till invocation?

@epage
Copy link
Collaborator

epage commented Jun 22, 2024

You are welcome to create an issue from that discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants