Skip to main content

tergo_tokenizer/
lib.rs

1pub mod tokenizer;
2pub mod tokens;
3pub use tokenizer::Tokenizer;
4pub use tokens::Token;
5
6#[derive(Debug)]
7pub enum Error {
8    UnexpectedCharacter(String),
9}
10
11impl std::fmt::Display for Error {
12    fn fmt(&self, out: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13        match self {
14            Self::UnexpectedCharacter(context) => out.write_fmt(format_args!("{context})")),
15        }
16    }
17}
18
19impl std::error::Error for Error {}