combine 4.3.0

Fast parser combinators on arbitrary streams with zero-copy support.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use combine::{
    many1,
    parser::char::{letter, space},
    sep_by, Parser,
};

#[test]
fn readme() {
    main();
}

fn main() {
    let word = many1(letter());

    let mut parser = sep_by(word, space()).map(|mut words: Vec<String>| words.pop());
    let result = parser.parse("Pick up that word!");
    assert_eq!(result, Ok((Some("word".to_string()), "!")));
}