MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / patch

Method patch

compiler/src/modules/parser/mod.rs:382–386  ·  view source on GitHub ↗
(&mut self, pos: usize)

Source from the content-addressed store, hash-verified

380 }
381
382 pub(super) fn patch(&mut self, pos: usize) {
383 let target = self.chunk.instructions.len() as u16;
384 // Error recovery can leave a stale placeholder; skip if it was never emitted.
385 if let Some(ins) = self.chunk.instructions.get_mut(pos) { ins.operand = target; }
386 }
387
388 /* Patch a jump to an explicit target; bounds-safe so instruction overflow (`emit` freezes at MAX_INSTRUCTIONS) can't panic on a stale index. */
389 pub(super) fn patch_to(&mut self, pos: usize, target: u16) {

Callers 11

stmtMethod · 0.80
emit_yieldMethod · 0.80
comprehension_loopMethod · 0.80
if_bodyMethod · 0.80
match_stmtMethod · 0.80
parse_patternMethod · 0.80
while_stmtMethod · 0.80
for_stmt_innerMethod · 0.80
try_stmtMethod · 0.80
exprMethod · 0.80
infix_bpMethod · 0.80

Calls 2

get_mutMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected