use thiserror::Error;
pub type Code = &'static str;
#[derive(Error, Debug)]
pub enum Error {
#[error("An error occured during lexical analysis. 1{0}: {1}")]
LexicalError(Code, &'static str),
#[error("An error occured during syntactical analysis. 2{0}: {1}")]
SyntacticalError(Code, &'static str),
#[error("An error occured during I/O. 3{0}: {1}")]
IOError(Code, &'static str),
#[error("An error occured during initialisation. 4{0}: {1}")]
InitialisationError(Code, &'static str),
}
impl<T> From<Error> for Result<T, Error> {
fn from(err: Error) -> Result<T, Error> {
Err(err)
}
}