Type Alias kodept_parse::ParseError
source · pub type ParseError<'t> = GenericErrorTree<TokenStream<'t>, &'static str, &'static str, TokenVerificationError>;
Aliased Type§
enum ParseError<'t> {
Base {
location: TokenStream<'t>,
kind: BaseErrorKind<&'static str, TokenVerificationError>,
},
Stack {
base: Box<GenericErrorTree<TokenStream<'t>, &'static str, &'static str, TokenVerificationError>>,
contexts: Vec<(TokenStream<'t>, StackContext<&'static str>)>,
},
Alt(Vec<GenericErrorTree<TokenStream<'t>, &'static str, &'static str, TokenVerificationError>>),
}
Variants§
Base
A specific error event at a specific location. Often this will indicate that something like a tag or character was expected at that location.
Fields
§
location: TokenStream<'t>
The location of this error in the input
§
kind: BaseErrorKind<&'static str, TokenVerificationError>
The specific error that occurred
Stack
A stack indicates a chain of error contexts was provided. The stack
should be read “backwards”; that is, errors earlier in the Vec
occurred “sooner” (deeper in the call stack).
Fields
§
base: Box<GenericErrorTree<TokenStream<'t>, &'static str, &'static str, TokenVerificationError>>
The original error
§
contexts: Vec<(TokenStream<'t>, StackContext<&'static str>)>
The stack of contexts attached to that error
Alt(Vec<GenericErrorTree<TokenStream<'t>, &'static str, &'static str, TokenVerificationError>>)
A series of parsers were tried at the same location (for instance, via
the alt
combinator) and all of them failed. All
of the errors in this set are “siblings”.