New metadata functions.

This commit is contained in:
Stephen Chung
2022-01-20 08:16:38 +08:00
parent 0b3250a262
commit 3d4abeed0e
2 changed files with 73 additions and 23 deletions

View File

@@ -62,6 +62,8 @@ def_package! {
reg_functions!(lib += float; f64);
combine_with_exported_module!(lib, "f64", f64_functions);
}
combine_with_exported_module!(lib, "logic", logic_functions);
}
}
@@ -83,6 +85,14 @@ gen_cmp_functions!(float => f32);
#[cfg(feature = "f32_float")]
gen_cmp_functions!(float => f64);
#[export_module]
mod logic_functions {
#[rhai_fn(name = "!")]
pub fn not(x: bool) -> bool {
!x
}
}
#[cfg(not(feature = "no_float"))]
#[export_module]
mod f32_functions {