rust-bakery / nom

Rust parser combinator framework
MIT License
9.18k stars 792 forks source link

For `many` and `fold`, consider `..0` an invalid range, just as `0..0` is #1632

Open cky opened 1 year ago

cky commented 1 year ago

nom::multi::many and nom::many::fold consider empty ranges, as checked by NomRange::is_inverted, to be invalid. Unfortunately, that method is incorrectly implemented for RangeTo, meaning that ..0 is not considered invalid when it should be.

While I'm here, I also fixed up off-by-one errors in RangeFrom::bounded_iter and RangeFull::bounded_iter.

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4050233552


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/traits.rs 6 9 66.67%
<!-- Total: 6 9 66.67% -->
Files with Coverage Reduction New Missed Lines %
src/character/streaming.rs 1 78.38%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 3981619336: 0.3%
Covered Lines: 1560
Relevant Lines: 2494

💛 - Coveralls