Closed osa1 closed 2 years ago
This commit changes LexerError type from:
#[derive(Debug, Clone, PartialEq, Eq)] pub enum LexerError<E> { InvalidToken { location: Loc, }, /// Custom error, raised by a semantic action Custom(E), }
to:
#[derive(Debug, Clone, PartialEq, Eq)] pub struct LexerError<E> { pub location: Loc, pub kind: LexerErrorKind<E>, } #[derive(Debug, Clone, PartialEq, Eq)] pub enum LexerErrorKind<E> { /// Lexer error, raised by lexgen-generated code InvalidToken, /// Custom error, raised by a semantic action Custom(E), }
So we annotate all errors with location info now.
This commit changes LexerError type from:
to:
So we annotate all errors with location info now.