MCPcopy Create free account
hub / github.com/QuipNetwork/xquad / Program

Class Program

xqvm_py/program.py:47–66  ·  view source on GitHub ↗

A complete XQVM program. Attributes: instructions: List of instructions to execute name: Optional program name for debugging jump_targets: Maps sequential TARGET id to instruction index; pre-built at construction time so the executor skips the per-run pr

Source from the content-addressed store, hash-verified

45
46@dataclass
47class Program:
48 """
49 A complete XQVM program.
50
51 Attributes:
52 instructions: List of instructions to execute
53 name: Optional program name for debugging
54 jump_targets: Maps sequential TARGET id to instruction index; pre-built
55 at construction time so the executor skips the per-run pre-scan.
56 """
57
58 instructions: list[Instruction] = field(default_factory=list)
59 name: str = ""
60 jump_targets: dict[int, int] = field(default_factory=dict)
61
62 def __len__(self) -> int:
63 return len(self.instructions)
64
65 def __getitem__(self, index: int) -> Instruction:
66 return self.instructions[index]
67
68
69def _build_jump_targets(instructions: list[Instruction]) -> dict[int, int]:

Callers 4

simple_programFunction · 0.90
make_programFunction · 0.70
program_from_bytecodeFunction · 0.70
program_from_xqasmFunction · 0.70

Calls

no outgoing calls

Tested by 1

simple_programFunction · 0.72