Combine 2.5.0 and 3.0.0-alpha.1 released - Parser combinator library


#1

I am happy to announce combine 2.5.0 and 3.0.0-alpha.1 are released on crates.io. 2.5.0 features several new parser and a few bug fixes.

v2.5.0

The most important addition in 2.5.0 is a fix to the long standing issue of easily defining reusable parsers. This is made easy by the parser! macro. It has a few syntactical oddities to work around ambiguities but should otherwise prove to be the solution to tide combine over until impl Trait gets released (if you are a nightly user and ok with unstable features then you can of course use impl Trait right now without this workaround!).

Other notable additions include struct_parser! macro, regex parsers, &[u8] -> number parsers as well as a few other assorted parsers which can all be found in the CHANGELOG.

Documentation: https://docs.rs/combine/2.5.0/combine/

v3.0.0-alpha.1

While there are a lot of improvements in 2.5.0 not all of the changes I wanted to make could be done in a non-breaking way. That is why I am also releasing the first iteration of combine 3.0.0 which consists of several features which required some slight breaking changes to make.

Some more notable changes of those are a fix for parse errors being lacking in some cases (https://github.com/Marwes/combine/issues/95), a zero-copy version of recognize, simple conversion of ParseError to a std::fmt::Display type when tokens/ranges can’t be displayed https://github.com/Marwes/combine/issues/86 and a more general State type.

In addition to these already implemented changes I also plan to bring combine to #![no_std] environments. Currently the only thing that needs std is the Vec used to store errors. I plan to generalize the error handling so that users of combine can decide how much error information they need, potentially even omitting all error information, which can give a slight speedup in parsers looking to squeeze out all the performance they can (~10% speedup in the already fast http benchmark, ~40% in the more error/branch heavy json benchmark). The bulk of this addition is already implemented but is currently blocked on a rustc bug.

If you want to try out the changes in 3.0 even though more breaking changes are coming then I added a bit about how to upgrade to 3.0 (a good chance to propose more breaking additions as well! I hope that 3.0 will last a long time!)

Links

If you have any questions I am happy answer them here, on reddit, gitter or on the issue tracker.

Github
crates.io
docs.rs
gitter