[][src]Function combine::look_ahead

pub fn look_ahead<P>(p: P) -> LookAhead<P> where
    P: Parser

look_ahead(p) acts as p but doesn't consume input on success.

let mut p = look_ahead(string("test"));

let result = p.parse("test str");
assert_eq!(result, Ok(("test", "test str")));

let result = p.parse("aet");
assert!(result.is_err());