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

Introduce NonConsumingExact which doesn't consume whitespace at the beginning of the string #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dsalisbury
Copy link

parcon.Exact doesn't play nicely out-of-the-box when trying to match whitespace at the start of a string. I've added some tests for the existing behaviour, including using thing.parse_string(s, whitespace=parcon.Invalid()), but I also wanted something which didn't require explicitly passing in the whitespace argument, hence creating parcon.NonConsumingExact. The only difference is that it doesn't bother to do space.consume(...) (which parcon.Exact.parse does do).

Also, naming things is hard; I don't really like this name, but it's 11pm and I couldn't come up with anything better.

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.

1 participant