Function dust_lib::eval

source ·
pub fn eval(string: &str) -> Result<Value>
Expand description

Evaluate the given expression string.

Examples

assert_eq!(eval("1 + 2 + 3"), Ok(Value::from(6)));

See the crate doc for more examples and explanations of the expression format.