Files
OverComplicatedCalculator/src/lexer/errors.rs
2021-11-28 23:08:27 +01:00

14 lines
329 B
Rust

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,
}