Refactor: Replace optimization level with boolean flag

The optimizer now uses a simple boolean flag (`optimization`) instead of
an `optimization_level` (u32). This simplifies the optimizer's logic and
makes it easier to enable or disable optimizations.

The command-line interface and internal testing have been updated to
reflect this change.
This commit is contained in:
Michael Schimmel
2026-02-22 01:50:14 +01:00
parent d3cdafbb85
commit 7c997ca841
7 changed files with 52 additions and 49 deletions
+5 -5
View File
@@ -82,13 +82,13 @@ mod tests {
#[test]
fn test_examples() {
for level in 0..=2 {
let results = crate::utils::tester::run_functional_tests_with_level(level);
for opt in [false, true] {
let results = crate::utils::tester::run_functional_tests_with_optimization(opt);
for res in results {
assert!(
res.success,
"Example {} failed at level {}: {}",
res.name, level, res.message
"Example {} failed at opt {}: {}",
res.name, opt, res.message
);
}
}
@@ -97,7 +97,7 @@ mod tests {
#[test]
fn test_debug_mode_logging() {
let mut env = Environment::new();
env.optimization_level = 0;
env.optimization = false;
let source = "(+ 10 20)";
let result = env.run_debug(source).expect("Failed to run debug");