Add if else if chains

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-09 12:51:49 +01:00
parent ef02e94591
commit ff308649b9
10 changed files with 241 additions and 115 deletions

View file

@ -67,6 +67,16 @@ pub fn execute(
}
}
}
Instruction::Jump { jump } => {
let (new_ip, overflow) = ip.overflowing_add_signed(*jump);
if overflow {
return Err(EvaluationError::InstructionPointerOverflow);
} else {
ip = new_ip;
continue;
}
}
}
ip += 1;