diff --git a/src/operator/mod.rs b/src/operator/mod.rs index d5e8833..1f71c08 100644 --- a/src/operator/mod.rs +++ b/src/operator/mod.rs @@ -1,5 +1,6 @@ use std::fmt::{Debug, Display}; +use ::{ContextMut, ValueType}; use function::builtin::builtin_function; use crate::{context::Context, error::*, value::Value}; @@ -30,6 +31,11 @@ pub trait Operator: Debug + Display { /// Evaluates the operator with the given arguments and context. fn eval(&self, arguments: &[Value], context: &Context) -> EvalexprResult; + + /// Evaluates the operator with the given arguments and mutable context. + fn eval_mut(&self, arguments: &[Value], context: &mut ContextMut) -> EvalexprResult { + self.eval(arguments, context) + } } #[derive(Debug)]