Skip to main content

Crate harn_opcode_macros

Crate harn_opcode_macros 

Source
Expand description

define_opcodes! function-like proc-macro.

Single source of truth for the VM’s opcode set. One invocation in harn-vm/src/chunk.rs emits the Op enum, the byte-to-variant mapping, the sync and async dispatch tables, the disassembly renderer, and the classification helpers (op_reads_outer_name, is_adaptive_binary_op). Adding or renaming an opcode is a one-line edit; coverage drift across the previously hand-maintained tables is now impossible.

Macros§

define_opcodes
Emit the VM opcode definitions from a centralized declarative table.