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

Followup: Candidates for range syntax #1613

Open
5 tasks
cenodis opened this issue Jan 7, 2023 · 4 comments
Open
5 tasks

Followup: Candidates for range syntax #1613

cenodis opened this issue Jan 7, 2023 · 4 comments

Comments

@cenodis
Copy link
Contributor

cenodis commented Jan 7, 2023

This is a followup to #1402 which was merged in #1608. The merged implementation only includes range variants for many and fold. More parsers were mentioned as candidates in #1402.

This issue tracks the status of those candidates for conversion to a range syntax.

Current candidates

  • take_till* (take_till, take_till1)
  • take_while* (take_while, take_while1, take_while_m_n)
  • take_until* (take_until, take_until1)
  • many_till
  • seperated_list* (seperated_list0, seperated_list1)
@Geal
Copy link
Collaborator

Geal commented Jan 7, 2023

I'm less sure about converting those right now, because they rely on specialized implementations (the split_at_position* methods) to make most parsers fast, but maybe those methods could be generalized

@epage
Copy link
Contributor

epage commented Jan 7, 2023

One way to handle this is to dispatch to different implementations like my complete/streaming work, hoping the compiler inlines enough to remove the overhead.

@Geal
Copy link
Collaborator

Geal commented Jan 17, 2023

separated_list could be a good target for this

@vwkd
Copy link

vwkd commented Feb 7, 2023

+1 for a separated_list that accepts an additional range argument like 2..10.

Currently, there is only separated_list0 and separated_list1. If you wanted say separated_list2 you'd have to add more stuff like wrapping it in a separated_pair, duplicating the parser and separator, and mapping to push the first item onto the Vec of the rest. If you wanted a separated_list21to42 you'd probably need to dive down and implement it yourself.

All multi parsers accepting a range argument would be very nice!

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

No branches or pull requests

4 participants