[−][src]Trait nom_supreme::final_parser::ExtractContext
Trait for recombining error information with the original input.
This trait is used to take the context information attached to nom errors- specifically, the tail of the input indicating the location of the input- and recombine it with the original input to produce an error with something more useful for error reporting.
Typically, it looks like ExtractContext<I, E<T>> for E<I>
. This
indicates that some error type E
, which is generic over the input type,
can be converted into another variant of that error, using T
instead of
I
to hold the result context. Often this context conversion can happen
with RecreateContext
.
Required methods
pub fn extract_context(self, original_input: I) -> T
[src]
Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information.
For example, for a string, 1 possible context extraction would be the Location (line and column number) in the original input where the error indicated by self occurred.
Implementations on Foreign Types
impl<I, T> ExtractContext<I, (T, ErrorKind)> for (I, ErrorKind) where
T: RecreateContext<I>,
[src]
T: RecreateContext<I>,
pub fn extract_context(self, original_input: I) -> (T, ErrorKind)
[src]
impl<I, T> ExtractContext<I, Error<T>> for Error<I> where
T: RecreateContext<I>,
[src]
T: RecreateContext<I>,
pub fn extract_context(self, original_input: I) -> Error<T>
[src]
impl<I, T> ExtractContext<I, VerboseError<T>> for VerboseError<I> where
T: RecreateContext<I>,
I: Clone,
[src]
T: RecreateContext<I>,
I: Clone,
pub fn extract_context(self, original_input: I) -> VerboseError<T>
[src]
Implementors
impl<I, T> ExtractContext<I, ErrorTree<T>> for ErrorTree<I> where
I: Clone,
T: RecreateContext<I>,
[src]
I: Clone,
T: RecreateContext<I>,