zen_expression/lexer/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, PartialEq, Eq, Clone, Error)]
4pub enum LexerError {
5    #[error("Unexpected symbol: {symbol} at ({}, {})", span.0, span.1)]
6    UnexpectedSymbol { symbol: String, span: (u32, u32) },
7
8    #[error("Unmatched symbol: {symbol} at {position}")]
9    UnmatchedSymbol { symbol: char, position: u32 },
10
11    #[error("Unexpected EOF: {symbol} at {position}")]
12    UnexpectedEof { symbol: char, position: u32 },
13}
14
15pub(crate) type LexerResult<T> = Result<T, LexerError>;