combine Build Status

(Previously parser-combinators)

An implementation of parser combinators for Rust, inspired by the Haskell library Parsec. As in Parsec the parsers are LL(1) by default but they can opt-in to arbitrary lookahed using the try combinator.

A parser combinators is, broadly speaking, a function which takes several parsers as arguments and returns a new parser, created by combining those parsers. For instance, the many parser takes one parser, p, as input and returns a new parser which applies p zero or more times.

The library is mostly stable but a few parts of the internals may still change. If you end up trying it I welcome any feedback from your experience with it.

Example

```rust extern crate combine; use combine::{many, Parser}; use combine::char::letter;

let result = many(letter()).parse("hello world"); asserteq!(result, Ok(("hello".tostring(), " world"))); ```

Links

Documentation and examples

crates.io

Extra

There is an additional crate which has parsers to lex and parse programming languages in combine-language.

Breaking changes

Here is a list containing most of the breaking changes in older versions of combine (parser-combinators).

0.7.0

0.6.0

0.5.0

0.4.0

0.3.2 / 0.3.0

0.2.6

If you have trouble updating to a newer version feel free to open an issue and I can take a look.