BlockInstruction

BlockInstruction

interface BlockInstruction

Base for all instruction AstNode implementations which are "block" instructions.

Fields

Name Description
abstract result: ResultType
open isPlain: Boolean

Methods

flatten

abstract 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>

Extensions

validate

fun Instruction.validate(context: FunctionBody): FunctionBody

Validates the Instruction.

Receiver

Name Description
Instruction

Parameters

Name Description
context: FunctionBody

ReturnValue

Name Description
FunctionBody