1
0

Clean up disassembler output

This commit is contained in:
Jeff 2024-10-01 20:27:28 -04:00
parent 9d1996c9ec
commit ba904fdcd8

View File

@ -342,7 +342,7 @@ impl<'a> ChunkDisassembler<'a> {
"Instructions", "Instructions",
"------------", "------------",
"INDEX BYTECODE OPERATION INFO JUMP POSITION", "INDEX BYTECODE OPERATION INFO JUMP POSITION",
"----- -------- --------------- ------------------------- -------------- --------", "----- -------- --------------- ------------------------- -------- --------",
]; ];
const CONSTANT_HEADER: [&'static str; 5] = [ const CONSTANT_HEADER: [&'static str; 5] = [
@ -445,7 +445,7 @@ impl<'a> ChunkDisassembler<'a> {
}; };
let bytecode = u32::from(instruction); let bytecode = u32::from(instruction);
let instruction_display = format!( let instruction_display = format!(
"{index:<5} {bytecode:<08X} {operation:15} {info:25} {jump_offset:14} {position:8}" "{index:<5} {bytecode:<08X} {operation:15} {info:25} {jump_offset:8} {position:8}"
); );
disassembly.push_str(&center(&instruction_display)); disassembly.push_str(&center(&instruction_display));