J-F-Liu / pom

PEG parser combinators using operator overloading without macros.
MIT License
496 stars 30 forks source link

Amend RangeArgument such that repeat accepts RangeToInclusive and RangeInclusive #64

Closed nigeleke closed 7 months ago

nigeleke commented 7 months ago

The range.rs file is amended so that both RangeToInclusive and RangeInclusive can be accepted as arguments to the Parser::repeat method.

This implementation no longer requires the range.rs implementation of Bound. Given that Bound was public this may be considered a breaking change and the version bumped up accordlingly. Note: I did not update the version in Cargo.toml.

Also - I can see from https://github.com/J-F-Liu/pom/issues/58 that Range may not always be applicable as usize only. I've taken it as a "private" implementation, only to be used in repeat() calls, so we may need further discussion before this PR can be completed...