pub trait Strategy<I: Clone, O, E: Error<I>> {
    // Required method
    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§

source

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.

Implementors§

source§

impl<I: Clone + PartialEq, O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipThenRetryUntil<I, N>

source§

impl<I: Clone + PartialEq, O, F: Fn(E::Span) -> O, E: Error<I>, const N: usize> Strategy<I, O, E> for NestedDelimiters<I, F, N>

source§

impl<I: Clone + PartialEq, O, F: Fn(E::Span) -> O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipUntil<I, F, N>

source§

impl<I: Clone + PartialEq, O, R: Parser<I, O, Error = E>, E: Error<I>> Strategy<I, O, E> for SkipParser<R>