Register test
functions in repl.
This commit is contained in:
parent
16c03cc864
commit
58e1094b79
@ -155,6 +155,13 @@ fn main() {
|
||||
engine.set_module_resolver(resolver);
|
||||
}
|
||||
|
||||
engine
|
||||
.register_fn("test", |x: rhai::INT, y: rhai::INT| format!("{} {}", x, y))
|
||||
.register_fn("test", |x: &mut rhai::INT, y: rhai::INT, z: &str| {
|
||||
*x += y;
|
||||
println!("{} {} {}", x, y, z);
|
||||
});
|
||||
|
||||
// Make Engine immutable
|
||||
let engine = engine;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user