Add next_instruction helper and bump version
This commit is contained in:
@@ -15,16 +15,14 @@ fn main() {
|
||||
let ijvmfile = &args[1];
|
||||
|
||||
let mut machine = Machine::new_from_file(ijvmfile).unwrap();
|
||||
while machine.has_step() {
|
||||
match machine.step() {
|
||||
Ok(_) => (),
|
||||
Err(str) => {
|
||||
println!("\n\nERROR: pc=0x{:x} fp=0x{:x}: {}\nProgram exit",
|
||||
machine.get_program_counter(),
|
||||
machine.frame.len() - 1,
|
||||
str);
|
||||
return;
|
||||
}
|
||||
match machine.run() {
|
||||
Ok(_) => (),
|
||||
Err(str) => {
|
||||
println!("\n\nERROR: pc=0x{:x} fp=0x{:x}: {}\nProgram exit",
|
||||
machine.get_program_counter(),
|
||||
machine.frame.len() - 1,
|
||||
str);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user