Function chumsky::primitive::none_of[][src]

pub fn none_of<I: Clone + PartialEq, Iter: IntoIterator<Item = I>, E>(
    xs: Iter
) -> NoneOf<I, E>
Expand description

A parser that accepts any input that is not in a sequence of specific inputs.

Examples


let string = one_of::<_, _, Cheap<char>>("\"'".chars())
    .ignore_then(none_of("\"'".chars()).repeated())
    .then_ignore(one_of("\"'".chars()))
    .then_ignore(end())
    .collect::<String>();

assert_eq!(string.parse("'hello'"), Ok("hello".to_string()));
assert_eq!(string.parse("\"world\""), Ok("world".to_string()));
assert!(string.parse("\"421!53").is_err());