diff --git a/src/error.rs b/src/error.rs index b1da312..8d430f5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -18,7 +18,6 @@ pub enum ErrorKind { MeloVariable(String), TypeError(String), TopLevelBreak, - ArithmeticError, BfInterpretError(InterpretError), MissingLhs, } diff --git a/src/interpret.rs b/src/interpret.rs index eb6bb2e..27dd2b1 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -19,7 +19,7 @@ use rand::random; use crate::{ ast::{Expr, Iden, Stmt, StmtKind}, - base_55, + base_55, consts, error::{Error, ErrorKind}, variables::{Functio, Value, Variable}, }; @@ -134,10 +134,7 @@ impl ExecEnv { Divide => lhs.checked_div(rhs), _ => unreachable!(), } - .ok_or(Error { - kind: ErrorKind::ArithmeticError, - span: expr.span.clone(), - })?; + .unwrap_or(consts::ANSWER); Int(res) }