fix(defs): compile errors

This commit is contained in:
tamasfe
2022-07-26 14:28:54 +02:00
parent d350462cf8
commit ade818b043
2 changed files with 24 additions and 17 deletions

View File

@@ -18,11 +18,15 @@ fn main() {
// since it will be part of the scope.
scope.push("hello_there", "hello there");
#[cfg(not(feature = "no_module"))]
engine.register_static_module("general_kenobi", exported_module!(general_kenobi).into());
// Custom operators also show up in definitions.
engine.register_custom_operator("minus", 100).unwrap();
engine.register_fn("minus", |a: i64, b: i64| a - b);
#[cfg(not(feature = "no_custom_syntax"))]
{
engine.register_custom_operator("minus", 100).unwrap();
engine.register_fn("minus", |a: i64, b: i64| a - b);
}
engine
.eval_with_scope::<()>(