Make sure all features compile correctly.

This commit is contained in:
Stephen Chung
2020-05-06 19:45:17 +08:00
parent 88fec57394
commit d75a8bc6cd
11 changed files with 640 additions and 179 deletions

View File

@@ -711,11 +711,16 @@ pub fn optimize_into_ast(
#[cfg(feature = "no_optimize")]
const level: OptimizationLevel = OptimizationLevel::None;
#[cfg(not(feature = "no_function"))]
let fn_lib: Vec<_> = functions
.iter()
.map(|fn_def| (fn_def.name.as_str(), fn_def.params.len()))
.collect();
#[cfg(feature = "no_function")]
const fn_lib: &[(&str, usize)] = &[];
#[cfg(not(feature = "no_function"))]
let lib = FunctionsLib::from_vec(
functions
.iter()
@@ -745,6 +750,9 @@ pub fn optimize_into_ast(
.collect(),
);
#[cfg(feature = "no_function")]
let lib: FunctionsLib = Default::default();
AST::new(
match level {
OptimizationLevel::None => statements,