MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / jump_instruction

Method jump_instruction

aiscript-vm/src/chunk.rs:390–400  ·  view source on GitHub ↗
(&self, name: &str, sign: i8, offset: usize, jump: u16)

Source from the content-addressed store, hash-verified

388 }
389
390 fn jump_instruction(&self, name: &str, sign: i8, offset: usize, jump: u16) {
391 let name = format!("OP_{name}");
392 // let jump = u16::from_be_bytes([self.code[offset + 1], self.code[offset + 2]]);
393 let jump = if sign < 0 {
394 offset.saturating_sub(jump as usize)
395 } else {
396 offset.saturating_add(jump as usize)
397 };
398
399 println!("{:-16} {:4} -> {}", name, offset, jump);
400 }
401
402 fn invoke_instruction(&self, name: &str, constant: u8, arity: u8) {
403 let name = format!("OP_{name}");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected