Only print last evaluated result

This commit is contained in:
greg 2017-02-20 20:14:59 -08:00
parent e0f5f01e69
commit 9dd8f90e3c

View File

@ -124,8 +124,8 @@ fn run_noninteractive<'a, T: ProgrammingLanguage>(filename: &str, _language: &T,
evaluator.set_option("trace_evaluation", true); evaluator.set_option("trace_evaluation", true);
} }
let results = T::evaluate(ast, &mut evaluator); let results = T::evaluate(ast, &mut evaluator);
for result in results.iter() { if let Some(r) = results.iter().last() {
println!("{}", result); println!("{}", r);
} }
} }
} }