Result of evaluation is only printed when it's not nil

This commit is contained in:
Robert Bendun 2022-05-25 04:36:16 +02:00
parent e2142d9dbd
commit 741eb7f576

View File

@ -66,7 +66,9 @@ struct Runner
dump(ast);
return {};
}
std::cout << Try(interpreter.eval(std::move(ast))) << std::endl;
if (auto result = Try(interpreter.eval(std::move(ast))); result.type != Value::Type::Nil) {
std::cout << result << std::endl;
}
return {};
}
};