Marwes / combine

A parser combinator library for Rust
https://docs.rs/combine/*/combine/
MIT License
1.29k stars 92 forks source link

feat: Rename Consumed to Commit and Empty to Peek #275

Closed Marwes closed 4 years ago

Marwes commented 4 years ago

This more accurately explains what these cases mean. Either a parser has committed to its parse, so if it fails it should not attempt other parsers or it just peeked on its input and it is ok to attempt another one.

Consumed and Empty were only accurate in what they did in simple cases but as soon as attempt or a partial input failed they would not be true any more. Also this is just a better explanation of how other parsers should act when a parser returns one of these.

BREAKING CHANGE

Rename any use of Consumed to Commit and Empty to Peek