From 29a9b3878dd08f289741352c954e1a525faf2c22 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 17 Dec 2021 16:32:34 +0800 Subject: [PATCH] Fix builds. --- src/ast/mod.rs | 5 ++++- src/packages/iter_basic.rs | 8 -------- tests/custom_syntax.rs | 1 + 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/ast/mod.rs b/src/ast/mod.rs index 0bb45b1e..3b269a71 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -8,12 +8,15 @@ pub mod script_fn; pub mod stmt; pub use ast::{ASTNode, AST}; -pub use expr::{BinaryExpr, CustomExpr, Expr, FloatWrapper, FnCallExpr, FnCallHashes}; +pub use expr::{BinaryExpr, CustomExpr, Expr, FnCallExpr, FnCallHashes}; pub use flags::{FnAccess, OptionFlags, AST_OPTION_FLAGS}; pub use ident::Ident; #[cfg(not(feature = "no_function"))] pub use script_fn::{ScriptFnDef, ScriptFnMetadata}; pub use stmt::{OpAssignment, Stmt, StmtBlock}; +#[cfg(not(feature = "no_float"))] +pub use expr::FloatWrapper; + #[cfg(feature = "no_function")] pub struct ScriptFnDef; diff --git a/src/packages/iter_basic.rs b/src/packages/iter_basic.rs index 75538f63..36268851 100644 --- a/src/packages/iter_basic.rs +++ b/src/packages/iter_basic.rs @@ -551,10 +551,6 @@ mod range_functions { let _range = range; true } - #[rhai_fn(get = "is_empty", name = "is_empty", pure)] - pub fn is_empty(range: &mut ExclusiveRange) -> bool { - range.is_empty() - } #[rhai_fn(get = "start", name = "start", pure)] pub fn start_inclusive(range: &mut InclusiveRange) -> INT { *range.start() @@ -567,10 +563,6 @@ mod range_functions { pub fn contains_inclusive(range: &mut InclusiveRange, value: INT) -> bool { range.contains(&value) } - #[rhai_fn(get = "is_empty", name = "is_empty", pure)] - pub fn is_empty_inclusive(range: &mut InclusiveRange) -> bool { - range.is_empty() - } #[rhai_fn(get = "is_inclusive", name = "is_inclusive", pure)] pub fn is_inclusive_inclusive(range: &mut InclusiveRange) -> bool { let _range = range; diff --git a/tests/custom_syntax.rs b/tests/custom_syntax.rs index ba4c433a..efaf1675 100644 --- a/tests/custom_syntax.rs +++ b/tests/custom_syntax.rs @@ -267,6 +267,7 @@ fn test_custom_syntax_raw2() -> Result<(), Box> { assert_eq!(engine.eval::("#-1")?, -1); assert_eq!(engine.eval::("let x = 41; x + #1")?, 42); + #[cfg(not(feature = "no_object"))] assert_eq!(engine.eval::("#-42.abs()")?, 42); assert_eq!(engine.eval::("#42/2")?, 21); assert_eq!(engine.eval::("sign(#1)")?, 1);