Add next_instruction helper and bump version

This commit is contained in:
2018-06-02 16:26:21 +02:00
parent 6ee88325c5
commit c6f4a23174
3 changed files with 49 additions and 12 deletions

View File

@@ -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;
}
}
}