improve bytecode readability by reporting patterns
This commit is contained in:
parent
f58a5f14b5
commit
0b27944d11
24
src/main.rs
24
src/main.rs
|
@ -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> {
|
||||
|
|
Loading…
Reference in New Issue
Block a user