improve bytecode readability by reporting patterns

This commit is contained in:
Scott Richmond 2025-06-22 14:39:52 -04:00
parent f58a5f14b5
commit 0b27944d11

View File

@ -134,20 +134,20 @@ pub fn run(src: &'static str) {
println!("\n\n")
}
// if DEBUG_SCRIPT_RUN {
// println!("=== vm run: test ===");
// }
if DEBUG_SCRIPT_RUN {
println!("=== vm run: test ===");
}
// let vm_chunk = compiler.chunk;
let vm_chunk = compiler.chunk;
// let mut vm = Vm::new(vm_chunk, DEBUG_SCRIPT_RUN);
// let result = vm.run();
// let output = match result {
// Ok(val) => val.show(),
// Err(panic) => format!("Ludus panicked! {panic}"),
// };
// vm.print_stack();
// println!("{output}");
let mut vm = Vm::new(vm_chunk, DEBUG_SCRIPT_RUN);
let result = vm.run();
let output = match result {
Ok(val) => val.show(),
Err(panic) => format!("Ludus panicked! {panic}"),
};
vm.print_stack();
println!("{output}");
}
pub fn ld_fmt(src: &'static str) -> Result<String, String> {