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

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, 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, usize)

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

§

User

Fields

Custom error type.