pub type ParseError<'a> = ParseError<usize, Token<'a>, ParserError>;

Aliased Type§

enum ParseError<'a> {
    InvalidToken {
        location: usize,
    },
    UnrecognizedEof {
        location: usize,
        expected: Vec<String>,
    },
    UnrecognizedToken {
        token: (usize, Token<'a>, usize),
        expected: Vec<String>,
    },
    ExtraToken {
        token: (usize, Token<'a>, usize),
    },
    User {
        error: ParserError,
    },
}

Variants§

§

InvalidToken

Fields

§location: usize

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

§

UnrecognizedEof

Fields

§location: usize

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: (usize, Token<'a>, usize)

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

Fields

§token: (usize, Token<'a>, usize)

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

§

User

Fields

Custom error type.