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 ParseErrors.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.