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

Feature Request: Add branching parser combinator for exclude() and depend() #1734

Open
evan0greenup opened this issue Mar 23, 2024 · 1 comment

Comments

@evan0greenup
Copy link

Currently, there is alt().

For a parser a and another parser b, If we need logic which is: using applying parser b to the input, only if parser a success or in other case not success. (parser a does not consume input).

Adding this feature would be good.

@epage
Copy link
Contributor

epage commented Mar 24, 2024

If I'm understanding, you want a parser(a, b) that does one of

tuple((peek(a), b))
tuple((not(a), b))

I can't think of a time that I've needed them. I'd be interested to know more about your case that this is common that having this in a library would be helpful.

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