diff --git a/src/errors.rs b/src/errors.rs index fcbcec6..1b715b1 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -9,6 +9,8 @@ pub enum DaisyError { EmptyGroup, Syntax, BadNumber, + BadVariable, + BadFunction, // Evaluation errors BadMath, @@ -46,8 +48,19 @@ impl DaisyError { return FormattedText::new( "[e]Syntax Error:[n] Invalid number".to_string() ); + }, + DaisyError::BadVariable => { + return FormattedText::new( + "[e]Syntax Error:[n] Bad variable name".to_string() + ); + }, + DaisyError::BadFunction => { + return FormattedText::new( + "[e]Syntax Error:[n] Bad function name".to_string() + ); } + DaisyError::BadMath => { return FormattedText::new( "[e]Evaluation Error:[n] Failed to evaluate expression".to_string() @@ -57,7 +70,6 @@ impl DaisyError { return FormattedText::new( "[e]Evaluation Error:[n] Number too big".to_string() ); - }, DaisyError::ZeroDivision => { return FormattedText::new(