feat: init Rust VM
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use fix::context::Context;
|
||||
use fix::error::{Result, Source};
|
||||
use fix::runtime::Runtime;
|
||||
use fix::value::Value;
|
||||
|
||||
pub fn eval(expr: &str) -> Value {
|
||||
Context::new()
|
||||
Runtime::new()
|
||||
.unwrap()
|
||||
.eval(Source::new_eval(expr.into()).unwrap())
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn eval_result(expr: &str) -> Result<Value> {
|
||||
Context::new()
|
||||
Runtime::new()
|
||||
.unwrap()
|
||||
.eval(Source::new_eval(expr.into()).unwrap())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user