Add no_function feature to disable script-defined functions.

This commit is contained in:
Stephen Chung
2020-03-11 13:28:12 +08:00
parent 047f064cd1
commit 7c4d22d98a
10 changed files with 140 additions and 86 deletions

View File

@@ -9,6 +9,7 @@ fn test_not() -> Result<(), EvalAltResult> {
false
);
#[cfg(not(feature = "no_function"))]
assert_eq!(engine.eval::<bool>("fn not(x) { !x } not(false)")?, true);
// TODO - do we allow stacking unary operators directly? e.g '!!!!!!!true'