unplugged-system/external/rust/crates/combine/examples
2025-10-06 13:59:42 +00:00
..
async.rs Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
date.rs Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
ini.rs Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
number.rs Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00
readme.rs Initial commit: AOSP 14 with modifications for Unplugged OS 2025-10-06 13:59:42 +00:00

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()), "!")));
}