Enum ess::parser::ParseError
source · pub enum ParseError<Loc = ByteSpan>where
Loc: Span,{
UnexpectedEof,
List(Box<ParseError>, Loc),
Sexp(Box<ParseError>, Loc),
Char(Box<ParseError>, Loc),
String(Box<ParseError>, Loc),
Symbol(Box<ParseError>, Loc),
Number(Box<ParseError>, Loc),
Unexpected(char, Loc::Begin),
}
Expand description
Indicates how parsing failed.
Most ParseError
variants contain a Box<ParseError>
that represents the
cause of that error. Using this, ParseError
variants can be chained to
produce a more complete picture of what exactly went wrong during parsing.
Variants§
UnexpectedEof
Parsing reached the end of input where not expecting to, usually this
will be contained inside another ParseError
like String(box UnexpectedEof, ...)
which indicates that the closing quote was never
found.
List(Box<ParseError>, Loc)
Some problem occurred while parsing a list, along with the cause of that error.
Sexp(Box<ParseError>, Loc)
Some problem occurred while parsing an s-expression. This will only be
generated if EOF is reached unexpectedly at the beginning of
parse_expression
, so it should probably be removed.
Char(Box<ParseError>, Loc)
Some problem occurred while parsing a character literal, along with the cause of the error.
String(Box<ParseError>, Loc)
Some problem occurred while parsing a string literal, along with the cause of the error.
Symbol(Box<ParseError>, Loc)
Some problem occurred while parsing a symbol, along with the cause of the error.
Number(Box<ParseError>, Loc)
Some problem occurred while parsing a number literal, along with the cause of the error.
Unexpected(char, Loc::Begin)
An unexpected character was found. This will usually be the root cause
in some chain of ParseError
s.
Trait Implementations§
source§impl<Loc: Clone> Clone for ParseError<Loc>where
Loc: Span,
Loc::Begin: Clone,
impl<Loc: Clone> Clone for ParseError<Loc>where
Loc: Span,
Loc::Begin: Clone,
source§fn clone(&self) -> ParseError<Loc>
fn clone(&self) -> ParseError<Loc>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more