pub struct SkipUntil<I, F, const N: usize>(_, _, _, _);
Expand description
See skip_until
.
Implementations§
source§impl<I, F, const N: usize> SkipUntil<I, F, N>
impl<I, F, const N: usize> SkipUntil<I, F, 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 + PartialEq, O, F: Fn(E::Span) -> O, E: Error<I>, const N: usize> Strategy<I, O, E> for SkipUntil<I, F, N>
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§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.