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