Struct chumsky::recovery::SkipThenRetryUntil
source · pub struct SkipThenRetryUntil<I, const N: usize>(_, _, _);
Expand description
Implementations§
source§impl<I, const N: usize> SkipThenRetryUntil<I, N>
impl<I, const N: usize> SkipThenRetryUntil<I, N>
sourcepub fn skip_start(self) -> Self
pub fn skip_start(self) -> Self
Alters this recovery strategy so that the first token will always be skipped.
This is useful when the input being searched for also appears at the beginning of the pattern that failed to parse.
sourcepub fn consume_end(self) -> Self
pub fn consume_end(self) -> Self
Alters this recovery strategy so that the synchronisation token will be consumed during recovery.
This is useful when the input being searched for is a delimiter of a prior pattern rather than the start of a new pattern and hence is no longer important once recovery has occurred.
Trait Implementations§
source§impl<I: Clone, const N: usize> Clone for SkipThenRetryUntil<I, N>
impl<I: Clone, const N: usize> Clone for SkipThenRetryUntil<I, N>
source§fn clone(&self) -> SkipThenRetryUntil<I, N>
fn clone(&self) -> SkipThenRetryUntil<I, N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<I: Clone + PartialEq, O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipThenRetryUntil<I, N>
impl<I: Clone + PartialEq, O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipThenRetryUntil<I, N>
source§fn recover<D: Debugger, P: Parser<I, O, Error = E>>(
&self,
a_errors: Vec<Located<I, P::Error>>,
a_err: 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,
a_errors: Vec<Located<I, P::Error>>,
a_err: 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.