carbon_core::transformers

Function nest_instructions

source
pub fn nest_instructions(
    instructions: Vec<(InstructionMetadata, Instruction)>,
) -> Vec<NestedInstruction>
Expand description

Nests instructions based on stack height, producing a hierarchy of NestedInstruction.

This function organizes instructions into a nested structure, enabling hierarchical transaction analysis. Instructions are nested according to their stack height, forming a tree-like structure.

§Parameters

  • instructions: A list of tuples containing InstructionMetadata and instructions.

§Returns

A vector of NestedInstruction, representing the instructions organized by stack depth.