♻️ Main loop now panics on error
This commit is contained in:
parent
e77e125f96
commit
8ba63d38a3
@ -208,9 +208,13 @@ impl Machine {
|
|||||||
/// ### Parameters
|
/// ### Parameters
|
||||||
///
|
///
|
||||||
/// - **machine** which contains a table of instructions
|
/// - **machine** which contains a table of instructions
|
||||||
pub fn run(&mut self){
|
pub fn run(&mut self) {
|
||||||
while let Ok(()) = Machine::one_instruction(self) {}
|
loop {
|
||||||
println!("trace : \n{}", self.registers_trace);
|
match Machine::one_instruction(self) {
|
||||||
|
Ok(()) => (),
|
||||||
|
Err(e) => panic!("FATAL at pc {} -> {}", self.pc, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Execute the current instruction
|
/// Execute the current instruction
|
||||||
|
Loading…
Reference in New Issue
Block a user