VariableInstructionValidator
object VariableInstructionValidator
Methods
visit
fun visit(node: VariableInstruction, context: FunctionBody): FunctionBody
Validates the given node, and if necessary: its children (recursively, using other ValidationVisitor instances).
Parameters
Name | Description |
---|---|
node: VariableInstruction
|
|
context: FunctionBody
|
ReturnValue
Name | Description |
---|---|
FunctionBody
|
Validator of VariableInstruction nodes.
From
the docs:VariableInstruction.LocalGet
C.locals\[x]
must be defined in the context.t
be the value typeC.locals\[x]
.[] => \[t]
.VariableInstruction.LocalSet
C.locals\[x]
must be defined in the context.t
be the value typeC.locals\[x]
.\[t] => []
.VariableInstruction.LocalTee
C.locals\[x]
must be defined in the context.t
be the value typeC.locals\[x]
.\[t] => \[t]
.VariableInstruction.GlobalGet
C.globals\[x]
must be defined in the context.mut t
be the global typeC.globals\[x]
.[] => \[t]
.VariableInstruction.GlobalSet
C.globals\[x]
must be defined in the context.mut t
be the global typeC.globals\[x]
.mut
must bevar
.\[t] => []
.