From 83f83307ca869a76375513ffcc8e3a4253ffaa5b Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 21 Oct 2021 19:30:58 +0800 Subject: [PATCH] Fix builds. --- src/packages/math_basic.rs | 2 +- src/parse.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/packages/math_basic.rs b/src/packages/math_basic.rs index eddb2036..d008b8e4 100644 --- a/src/packages/math_basic.rs +++ b/src/packages/math_basic.rs @@ -322,7 +322,7 @@ mod decimal_functions { #[cfg(feature = "no_float")] #[rhai_fn(return_raw)] pub fn parse_float(s: &str) -> Result> { - super::parse_decimal(s) + parse_decimal(s) } pub fn sin(x: Decimal) -> Decimal { diff --git a/src/parse.rs b/src/parse.rs index 6818bd62..438da716 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -3332,18 +3332,19 @@ impl Engine { #[cfg(not(feature = "no_optimize"))] optimization_level: crate::OptimizationLevel, ) -> Result { let _scope = scope; - let (statements, lib) = self.parse_global_level(input, state)?; + let (statements, _lib) = self.parse_global_level(input, state)?; #[cfg(not(feature = "no_optimize"))] return Ok(crate::optimize::optimize_into_ast( self, _scope, statements, - lib, + _lib, optimization_level, )); #[cfg(feature = "no_optimize")] + #[cfg(not(feature = "no_function"))] { let mut m = crate::Module::new(); @@ -3353,5 +3354,9 @@ impl Engine { return Ok(AST::new(statements, m)); } + + #[cfg(feature = "no_optimize")] + #[cfg(feature = "no_function")] + return Ok(AST::new(statements, crate::Module::new())); } }