lalrpop_util::state_machine

Type Alias ParseError

source
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

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

Fields

§location: <D as ParserDefinition>::Location
§

UnrecognizedEof

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

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.

§

UnrecognizedToken

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

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.

§

ExtraToken

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

§

User

Custom error type.

Fields

§error: <D as ParserDefinition>::Error