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

request: ignore_until primitive #189

Closed
Lokathor opened this issue Aug 13, 2022 · 2 comments
Closed

request: ignore_until primitive #189

Lokathor opened this issue Aug 13, 2022 · 2 comments

Comments

@Lokathor
Copy link

It looks like if you use take_until( ).ignored() the actual taking still makes a vec internally, it just throws it away after filling it up.

but heck maybe this is already done in zero-copy i dunno

@zesterer
Copy link
Owner

An idea I had recently was to generalise a lot of these "pull tokens until x" patterns with an and_is and not combinator. In such a formulation, you'd just do:

x.not().ignored().repeated().then(x)

It's a bit wordier, but it IMO it generalises to more cases and the common ones can always be wrapped up in a more ergonomic combinator. I will take this onboard and do a bit of thinking read for zero-copy.

@zesterer
Copy link
Owner

zesterer commented Feb 8, 2023

not has now been implemented.

@zesterer zesterer closed this as completed Feb 8, 2023
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

2 participants