Rewrite Rhai function dispatching

This commit is contained in:
torkleyy
2017-12-20 12:16:14 +01:00
parent ecf143b649
commit f09545921f
11 changed files with 610 additions and 1351 deletions

View File

@@ -5,10 +5,14 @@ fn main() {
let mut engine = Engine::new();
let mut scope: Scope = Vec::new();
if !engine.eval_with_scope::<()>(&mut scope, "let x = 4 + 5").is_ok() { assert!(false); }
if !engine
.eval_with_scope::<()>(&mut scope, "let x = 4 + 5")
.is_ok()
{
assert!(false);
}
if let Ok(result) = engine.eval_with_scope::<i64>(&mut scope, "x") {
println!("result: {}", result);
println!("result: {}", result);
}
}