oxide_eval 0.1.2

Oxide Eval is a simple Javascript Evaluator based on oxc.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[derive(Debug)]
pub enum EvaluatorError {
    VariableNotFound(String),
    PropertyNotFound(String, String),
}

impl std::fmt::Display for EvaluatorError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            EvaluatorError::VariableNotFound(var) => write!(f, "Variable not found: {}", var),
            EvaluatorError::PropertyNotFound(obj, prop) => {
                write!(f, "Property '{}' not found in object '{}'", prop, obj)
            }
        }
    }
}