pub trait Strategy<I: Clone, O, E: Error<I>> {
fn recover<D: Debugger, P: Parser<I, O, Error = E>>(
&self,
recovered_errors: Vec<Located<I, P::Error>>,
fatal_error: Located<I, P::Error>,
parser: P,
debugger: &mut D,
stream: &mut Stream<'_, I, <P::Error as Error<I>>::Span>
) -> (Vec<Located<I, P::Error>>, Result<(O, Option<Located<I, P::Error>>), Located<I, P::Error>>);
}
Expand description
A trait implemented by error recovery strategies.
Required Methods
fn recover<D: Debugger, P: Parser<I, O, Error = E>>(
&self,
recovered_errors: Vec<Located<I, P::Error>>,
fatal_error: Located<I, P::Error>,
parser: P,
debugger: &mut D,
stream: &mut Stream<'_, I, <P::Error as Error<I>>::Span>
) -> (Vec<Located<I, P::Error>>, Result<(O, Option<Located<I, P::Error>>), Located<I, P::Error>>)
fn recover<D: Debugger, P: Parser<I, O, Error = E>>(
&self,
recovered_errors: Vec<Located<I, P::Error>>,
fatal_error: Located<I, P::Error>,
parser: P,
debugger: &mut D,
stream: &mut Stream<'_, I, <P::Error as Error<I>>::Span>
) -> (Vec<Located<I, P::Error>>, Result<(O, Option<Located<I, P::Error>>), Located<I, P::Error>>)
Recover from a parsing failure.