feat(vm): threaded VM

This commit is contained in:
2026-04-11 10:30:03 +08:00
parent 8e67f9f636
commit 9983458b31
9 changed files with 1253 additions and 1264 deletions
+5 -5
View File
@@ -40,7 +40,7 @@ struct ExprSource {
file: Option<PathBuf>,
}
fn run_compile(eval: &mut Evaluator, src: ExprSource, _silent: bool) -> Result<()> {
fn run_compile(eval: &mut Evaluator, src: ExprSource, silent: bool) -> Result<()> {
let src = if let Some(expr) = src.expr {
Source::new_eval(expr)?
} else if let Some(file) = src.file {
@@ -49,10 +49,10 @@ fn run_compile(eval: &mut Evaluator, src: ExprSource, _silent: bool) -> Result<(
unreachable!()
};
match eval.compile_bytecode(src) {
Ok(_ip) => {
// if !silent {
// println!("{}", eval.disassemble_colored(ip));
// }
Ok(ip) => {
if !silent {
println!("{}", eval.disassemble_colored(ip));
}
}
Err(err) => {
eprintln!("{:?}", miette::Report::new(*err));