pub type ParseError<D> = ParseError<Location<D>, Token<D>, Error<D>>;

Aliased Type§

enum ParseError<D> {
    InvalidToken {
        location: <D as ParserDefinition>::Location,
    },
    UnrecognizedEof {
        location: <D as ParserDefinition>::Location,
        expected: Vec<String>,
    },
    UnrecognizedToken {
        token: (<D as ParserDefinition>::Location, <D as ParserDefinition>::Token, <D as ParserDefinition>::Location),
        expected: Vec<String>,
    },
    ExtraToken {
        token: (<D as ParserDefinition>::Location, <D as ParserDefinition>::Token, <D as ParserDefinition>::Location),
    },
    User {
        error: <D as ParserDefinition>::Error,
    },
}

Variants§

§

InvalidToken

Fields

§location: <D as ParserDefinition>::Location

Generated by the parser when it encounters a token (or EOF) it did not expect.

§

UnrecognizedEof

Fields

§location: <D as ParserDefinition>::Location

The end of the final token

§expected: Vec<String>

The set of expected tokens: these names are taken from the grammar and hence may not necessarily be suitable for presenting to the user.

Generated by the parser when it encounters an EOF it did not expect.

§

UnrecognizedToken

Fields

§token: (<D as ParserDefinition>::Location, <D as ParserDefinition>::Token, <D as ParserDefinition>::Location)

The unexpected token of type T with a span given by the two L values.

§expected: Vec<String>

The set of expected tokens: these names are taken from the grammar and hence may not necessarily be suitable for presenting to the user.

Generated by the parser when it encounters a token it did not expect.

§

ExtraToken

Generated by the parser when it encounters additional, unexpected tokens.

§

User

Fields

§error: <D as ParserDefinition>::Error

Custom error type.