Skip to main content

eval

Function eval 

Source
pub fn eval(source: &str, context: &MiraContext) -> Result<MiraAny>
Expand description

Compile and execute source once with default RunOptions.

ยงExamples

use mirascript_vm::{MiraAny, MiraContext, eval};

assert_eq!(eval("6 * 7", &MiraContext::new())?, MiraAny::Number(42.0));