parcon
parcon copied to clipboard
Introduce NonConsumingExact which doesn't consume whitespace at the beginning of the string
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.