J-F-Liu / pom

PEG parser combinators using operator overloading without macros.
MIT License
500 stars 31 forks source link

Make the list combinator fails early when one of the items does not parse. #38

Closed ivanceras closed 4 years ago

ivanceras commented 4 years ago

Hi @J-F-Liu ,

I have a use-case where any item of a list doesn't parse and it should fail the whole thing rather than ignoring it and return an empty list. Is the list combinator should behave this way? or should this be a separate combinator, something called list_fail_early.


This change is Reviewable

J-F-Liu commented 4 years ago

Should not change existing behavior. list_fail_early is not a common pattern, you may define it in your own project.