gcg_parser/gcg/token/
error.rs

1use displaydoc::Display;
2use thiserror::Error;
3
4#[derive(Display, Error, Debug)]
5pub enum Error {
6	/// Missing token {token:?} in position {token_index:?}: {text:?}
7	MissingToken {
8		token: String,
9		/// 1 indexed
10		token_index: usize,
11		text: String,
12	},
13	/// Invalid token {token:?}: {text:?}
14	InvalidToken { token: String, text: String },
15}
16
17pub type Result<T> = core::result::Result<T, Error>;