mirror of https://github.com/rm-dr/daisy
Added more errors
parent
7a1e4bd725
commit
0538b1e547
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue