use crate::function_parser::{CreationError, EvalError, LexerError, ParseError};

use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error("io error found")]
    Io(#[from] std::io::Error),
    #[error("parse float error")]
    ParseFloat(#[from] std::num::ParseFloatError),
    #[error("error generated while evaluating")]
    Eval(#[from] EvalError),
    #[error("error generated while creating: {0}")]
    Creation(#[from] CreationError),
    #[error("failed to tokenize due to {0:?}: {0}")]
    Lexer(LexerError),
    #[error("failed to parse function due to {0:?}: {0}")]
    FunctionParse(#[from] ParseError),
}
