Type Alias edlang_parser::error::Error

source ·
pub type Error = ParseError<usize, Token, LexicalError>;

Aliased Type§

enum Error {
    InvalidToken {
        location: usize,
    },
    UnrecognizedEof {
        location: usize,
        expected: Vec<String>,
    },
    UnrecognizedToken {
        token: (usize, Token, usize),
        expected: Vec<String>,
    },
    ExtraToken {
        token: (usize, Token, usize),
    },
    User {
        error: LexicalError,
    },
}

Variants§

§

InvalidToken

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

Fields

§location: usize
§

UnrecognizedEof

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

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.

§

UnrecognizedToken

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

Fields

§token: (usize, Token, 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.

§

ExtraToken

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

Fields

§token: (usize, Token, usize)
§

User

Custom error type.

Fields