pub fn greediest<'a, O>(choices: impl AsRef<[Parser<O>]> + 'static) -> Parser<O> where
O: 'static + Clone,
Expand description
Applies all the given parsers and picks the one which consumes the most input. Doesn’t consume any input on partial failure.
use memoir::*;
let p = greediest([string("he"), string("hello")]);
assert_eq!(p.parse("hello").ok(), Some(("hello".to_owned(), "")));
assert_eq!(p.parse("he").ok(), Some(("he".to_owned(), "")));