Function combine::look_ahead[][src]

pub fn look_ahead<Input, P>(p: P) -> LookAhead<P> where
    Input: Stream,
    P: Parser<Input>, 
Expand description

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());