/// Apply a parser and if it fails, recover to one of a list of tokens. This
/// turns reported into recovered errors.
Apply a parser and if it fails, recover to one of a list of tokens. This
turns reported into recovered errors.
Apply a parser and if it fails recover to one of a list of tokens . This turns reported into recovered errors .
pub fn recovered<P: Parser, R, F>(
    p: &mut P,
    term: &[Token],
    eat_term: bool,
    mut parse: F,
) -> RecoveredResult<R>
where
    F: FnMut(&mut P) -> Result<R, Reported>,
{
    match parse(p) {
        Ok(x) => Ok(x),
        Err(Reported) => {
            recover(p, term, eat_term);
            Err(Recovered)
        }
    }
}
pub fn recovered < P : Parser , R , F > ( p : & mut P , term : & [ Token ] , eat_term : bool , mut parse : F , ) -> RecoveredResult < R > where F : FnMut ( & mut P ) -> Result < R , Reported > , { match parse ( p ) { Ok ( x ) => Ok ( x ) , Err ( Reported ) => { recover ( p , term , eat_term ) ; Err ( Recovered ) } } }
Apply a parser and if it fails, recover to one of a list of tokens.
Apply a parser and if it fails recover to one of a list of tokens .
p
&mut P
term
&[Token]
eat_term
bool
parse
F