Loop

Loop

data class Loop

Fields

Name Description
val label: Label?
val result: ResultType
val instructions: List<Instruction>

Constructors

<init>

constructor(label: Label?, result: ResultType, instructions: List<Instruction>)

Parameters

Name Description
label: Label?
result: ResultType
instructions: List<Instruction>

Methods

flatten

fun flatten(expressionIndex: Int): List<Instruction>

Flattens the instruction such that none of the Instructions returned contain nested instructions. May result in block-type instructions being converted to start/end variants, wrapping their block contents.

Parameters

Name Description
expressionIndex: Int

The index of this Instruction within a parent's flattened list. Used to configure start/end instructions and allow breaks/jumps to calculate instruction pointer offsets.

ReturnValue

Name Description
List<Instruction>