kwasm.validation.type

Kwasm.validation.type

package kwasm.validation.type

Classes

Name Description
object FunctionTypeValidator

Validator for a FunctionType node.

From the docs:

Function types may not specify more than one result.


[tn^1] => [tm^2]

  • The arity m must not be larger than 1.
  • Then the function type is valid.
object GlobalTypeValidator

Validator of GlobalType nodes.

From the docs:

  • The global type is valid.

class LimitsValidator

Validator of Limits nodes.

From the docs:

Limits must have meaningful bounds that are within a given range.


{min n, max m?}

  • The value of n must not be larger than k.
  • If the maximum m? is not empty, then:

    • Its value must not be larger than k.
    • Its value must not be smaller than n.
  • Then the limit is valid within range k.
object MemoryTypeValidator

Validator of MemoryType nodes.

From the docs:

  • The limits limits must be valid within range 2^16.
  • Then the memory type is valid.

object TableTypeValidator

Validator for TableType nodes.

From the docs:

  • The limits limits must be valid within range 2^32.
  • Then the table type is valid.

Methods

validate

fun FunctionType.validate(context: ValidationContext): ValidationContext

Validates a FunctionType node.

Receiver

Name Description
FunctionType

Parameters

Name Description
context: ValidationContext

ReturnValue

Name Description
ValidationContext

validate

fun GlobalType.validate(context: ValidationContext): ValidationContext

Validates a GlobalType node.

Receiver

Name Description
GlobalType

Parameters

Name Description
context: ValidationContext

ReturnValue

Name Description
ValidationContext

validate

fun Limits.validate(range: Long, context: ValidationContext): ValidationContext

Validates a Limits node.

Receiver

Name Description
Limits

Parameters

Name Description
range: Long
context: ValidationContext

ReturnValue

Name Description
ValidationContext

validate

fun MemoryType.validate(context: ValidationContext): ValidationContext

Validates a MemoryType node.

Receiver

Name Description
MemoryType

Parameters

Name Description
context: ValidationContext

ReturnValue

Name Description
ValidationContext

validate

fun TableType.validate(context: ValidationContext): ValidationContext

Validates a TableType node.

Receiver

Name Description
TableType

Parameters

Name Description
context: ValidationContext

ReturnValue

Name Description
ValidationContext