diff --git a/src/engine.rs b/src/engine.rs index 8071b9de..0afadf75 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -239,8 +239,10 @@ impl Engine { engine.print = Box::new(|s| println!("{s}")); engine.debug = Box::new(|s, source, pos| match (source, pos) { (Some(source), crate::Position::NONE) => println!("{source} | {s}"), + #[cfg(not(feature = "no_position"))] (Some(source), pos) => println!("{source} @ {pos:?} | {s}"), (None, crate::Position::NONE) => println!("{s}"), + #[cfg(not(feature = "no_position"))] (None, pos) => println!("{pos:?} | {s}"), }); } diff --git a/tests/for.rs b/tests/for.rs index af2eed86..63c8ae92 100644 --- a/tests/for.rs +++ b/tests/for.rs @@ -231,10 +231,12 @@ fn test_for_loop() -> Result<(), Box> { ); } + #[cfg(not(feature = "no_index"))] + #[cfg(not(feature = "no_object"))] assert_eq!( engine.eval::( r#" - let a = [123, 999, 42, 0, true, "hello", "world!", 987.6543]; + let a = [123, 999, 42, 0, true, "hello", "world!"]; for (item, count) in a { switch item.type_of() {