Kwasm.validation.instruction.control
package kwasm.validation.instruction.control
Classes
Name | Description |
---|---|
object BlockValidator
|
Validator of kwasm.ast.instruction.BlockInstruction nodes. For specific validation requirements, see the docs for the |
object ControlInstructionValidator
|
Validator of ControlInstruction nodes. See: PlainValidator and BlockValidator for more information. |
object PlainValidator
|
Validator of "plain" (non-kwasm.ast.instruction.BlockInstruction) ControlInstruction nodes. From the docs:
For the other types, see the |
Methods
validateBlock
fun Block.validateBlock(context: FunctionBody): FunctionBody
Receiver
Name | Description |
---|---|
Block
|
Parameters
Name | Description |
---|---|
context: FunctionBody
|
ReturnValue
Name | Description |
---|---|
FunctionBody
|
validateLoop
fun Loop.validateLoop(context: FunctionBody): FunctionBody
From the docs:
block [t?] instr* end
- Let
C′
be the same context asC
, but with the result type[t?]
prepended to thelabels
vector. - Under context
C′
, the instruction sequenceinstr*
must be valid with type[] => [t?]
. - Then the compound instruction is valid with type
[] => [t?]
.
Receiver
Name | Description |
---|---|
Loop
|
Parameters
Name | Description |
---|---|
context: FunctionBody
|
ReturnValue
Name | Description |
---|---|
FunctionBody
|
validateIf
fun If.validateIf(context: FunctionBody): FunctionBody
From the docs:
if [t?] instr*^1 else instr*^2 end
- Let
C′
be the same context asC
, but with the result type[t?]
prepended to thelabels
vector. - Under context
C′
, the instruction sequenceinstr*^1
must be valid with type[] => [t?]
. - Under context
C′
, the instruction sequenceinstr*^2
must be valid with type[] =>
t?`. - Then the compound instruction is valid with type
\[i32] =>
t?`.
Receiver
Name | Description |
---|---|
If
|
Parameters
Name | Description |
---|---|
context: FunctionBody
|
ReturnValue
Name | Description |
---|---|
FunctionBody
|
From the docs:
C′
be the same context asC
, but with the result type[t?]
prepended to thelabels
vector.C′
, the instruction sequenceinstr*
must be valid with type[] => [t?]
.[] => [t?]
.