mini_builder_rs/tokenizer/
tokenizer_error.rs

1#[derive(Debug)]
2pub enum TokenizerError {
3	UnexpectedCharacter(usize),
4	MustHaveFilePathAfterAt(usize, String),
5	UnclosedString(usize),
6}
7
8impl std::fmt::Display for TokenizerError {
9	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10		match self {
11			Self::UnexpectedCharacter(i) => write!(f, "Unexpected character at index {i}."),
12			Self::MustHaveFilePathAfterAt(i, at) => write!(
13				f,
14				"A file path must follow the `At`({at}) symbol. Error at index {i}."
15			),
16			Self::UnclosedString(i) => write!(f, "Unclosed string at index {i}."),
17		}
18	}
19}
20
21impl std::error::Error for TokenizerError {}