OverComplicatedCalculator/src/lexer/errors.rs

14 lines
329 B
Rust
Raw Normal View History

2021-11-28 23:08:27 +01:00
use thiserror::Error;
#[derive(Error, Debug)]
pub enum LexerErrors {
#[error("unexpected character {char} at position {pos} in context {context}")]
UnexpectedCharacter {
char: char,
pos: u32,
context: String,
},
#[error("cannot lex an empty text sequence")]
EmptyTextSequenceError,
}