Current section
Files
Jump to
Current section
Files
src/gwr@spec.erl
-module(gwr@spec).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/gwr/spec.gleam").
-export_type([block_type/0, instruction/0, module_/0, function_/0, table/0, memory/0, global/0, element_segment_mode/0, element_segment/0, data_segment_mode/0, data_segment/0, start_function/0, import_descriptor/0, import/0, export_descriptor/0, export/0, number_type/0, vector_type/0, reference_type/0, value_type/0, function_type/0, limits/0, table_type/0, mutability/0, global_type/0, external_type/0, reference_value_type/0, float_value/0, sign/0, value/0, execution_result/0, label/0, frame/0, frame_state/0, address/0, module_instance/0, function_instance/0, table_instance/0, memory_instance/0, global_instance/0, element_instance/0, data_instance/0, export_instance/0, external_value/0, store/0, binary_/0, section/0, section_content/0, code/0, function_code/0, locals_declaration/0]).
-type block_type() :: {type_index_block, integer()} |
{value_type_block, gleam@option:option(value_type())}.
-type instruction() :: unreachable |
no_op |
{block, block_type(), list(instruction())} |
{loop, block_type(), list(instruction())} |
{'if',
block_type(),
list(instruction()),
gleam@option:option(instruction())} |
{'else', list(instruction())} |
{br, integer()} |
{br_if, integer()} |
{br_table, integer()} |
return |
{call, integer()} |
{call_indirect, integer(), integer()} |
{local_get, integer()} |
{local_set, integer()} |
{local_tee, integer()} |
{i32_const, integer()} |
{i64_const, integer()} |
{f32_const, ieee_float:i_e_e_e_float()} |
{f64_const, ieee_float:i_e_e_e_float()} |
i32_eqz |
i32_eq |
i32_ne |
i32_lt_s |
i32_lt_u |
i32_gt_s |
i32_gt_u |
i32_le_s |
i32_le_u |
i32_ge_s |
i32_ge_u |
i64_eqz |
i64_eq |
i64_ne |
i64_lt_s |
i64_lt_u |
i64_gt_s |
i64_gt_u |
i64_le_s |
i64_le_u |
i64_ge_s |
i64_ge_u |
f32_eq |
f32_ne |
f32_lt |
f32_gt |
f32_le |
f32_ge |
f64_eq |
f64_ne |
f64_lt |
f64_gt |
f64_le |
f64_ge |
i32_clz |
i32_ctz |
i32_popcnt |
i32_add |
i32_sub |
i32_mul |
i32_div_s |
i32_div_u |
i32_rem_s |
i32_rem_u |
i32_and |
i32_or |
i32_xor |
i32_shl |
i32_shr_s |
i32_shr_u |
i32_rotl |
i32_rotr |
i64_clz |
i64_ctz |
i64_popcnt |
i64_add |
i64_sub |
i64_mul |
i64_div_s |
i64_div_u |
i64_rem_s |
i64_rem_u |
i64_and |
i64_or |
i64_xor |
i64_shl |
i64_shr_s |
i64_shr_u |
i64_rotl |
i64_rotr |
f32_abs |
f32_neg |
f32_ceil |
f32_floor |
f32_trunc |
f32_nearest |
f32_sqrt |
f32_add |
f32_sub |
f32_mul |
f32_div |
f32_min |
f32_max |
f32_copysign |
f64_abs |
f64_neg |
f64_ceil |
f64_floor |
f64_trunc |
f64_nearest |
f64_sqrt |
f64_add |
f64_sub |
f64_mul |
f64_div |
f64_min |
f64_max |
f64_copysign |
i32_wrap_i64 |
i32_trunc_f32_s |
i32_trunc_f32_u |
i32_trunc_f64_s |
i32_trunc_f64_u |
i64_extend_i32_s |
i64_extend_i32_u |
i64_trunc_f32_s |
i64_trunc_f32_u |
i64_trunc_f64_s |
i64_trunc_f64_u |
f32_convert_i32_s |
f32_convert_i32_u |
f32_convert_i64_s |
f32_convert_i64_u |
f32_demote_f64 |
f64_convert_i32_s |
f64_convert_i32_u |
f64_convert_i64_s |
f64_convert_i64_u |
f64_promote_f32 |
i32_reinterpret_f32 |
i64_reinterpret_f64 |
f32_reinterpret_i32 |
f64_reinterpret_i64 |
i32_extend8_s |
i32_extend16_s |
i64_extend8_s |
i64_extend16_s |
i64_extend32_s |
i32_trunc_sat_f32_s |
i32_trunc_sat_f32_u |
i32_trunc_sat_f64_s |
i32_trunc_sat_f64_u |
i64_trunc_sat_f32_s |
i64_trunc_sat_f32_u |
i64_trunc_sat_f64_s |
i64_trunc_sat_f64_u |
'end'.
-type module_() :: {module,
list(function_type()),
list(function_()),
list(table()),
list(memory()),
list(global()),
list(element_segment()),
list(data_segment()),
gleam@option:option(start_function()),
list(import()),
list(export())}.
-type function_() :: {function,
integer(),
list(value_type()),
list(instruction())}.
-type table() :: {table, table_type()}.
-type memory() :: {memory, limits()}.
-type global() :: {global, global_type(), list(instruction())}.
-type element_segment_mode() :: passive_element_segment |
{active_element_segment, integer(), list(instruction())} |
declarative_element_segment.
-type element_segment() :: {element_segment,
reference_type(),
list(list(instruction())),
element_segment_mode()}.
-type data_segment_mode() :: passive_data_segment |
{active_data_segment, integer(), list(instruction())}.
-type data_segment() :: {data_segment, bitstring(), data_segment_mode()}.
-type start_function() :: {start_function, integer()}.
-type import_descriptor() :: {function_import, integer()} |
{table_import, table_type()} |
{memory_import, limits()} |
{global_import, global_type()}.
-type import() :: {import, binary(), binary(), import_descriptor()}.
-type export_descriptor() :: {function_export, integer()} |
{table_export, integer()} |
{memory_export, integer()} |
{global_export, integer()}.
-type export() :: {export, binary(), export_descriptor()}.
-type number_type() :: integer32 | integer64 | float32 | float64.
-type vector_type() :: vector128.
-type reference_type() :: function_reference | extern_reference.
-type value_type() :: {number, number_type()} |
{vector, vector_type()} |
{reference, reference_type()}.
-type function_type() :: {function_type, list(value_type()), list(value_type())}.
-type limits() :: {limits, integer(), gleam@option:option(integer())}.
-type table_type() :: {table_type, limits(), reference_type()}.
-type mutability() :: constant | variable.
-type global_type() :: {global_type, mutability(), value_type()}.
-type external_type() :: {external_function, function_type()} |
{external_table, table_type()} |
{external_memory, limits()} |
{external_global, global_type()}.
-type reference_value_type() :: null_reference |
{to_function_address, address()} |
{to_extern_address, address()}.
-type float_value() :: {finite, float()} | {infinite, sign()} | na_n.
-type sign() :: positive | negative.
-type value() :: {integer32_value, integer()} |
{integer64_value, integer()} |
{float32_value, float_value()} |
{float64_value, float_value()} |
{vector_value, integer()} |
{reference_value, reference_value_type()}.
-type execution_result() :: {success, list(value())} | trap.
-type label() :: {label, integer(), list(instruction())}.
-type frame() :: {frame, integer(), frame_state()}.
-type frame_state() :: {frame_state,
gleam@dict:dict(integer(), value()),
module_instance()}.
-type address() :: {function_address, integer()} |
{table_address, integer()} |
{memory_address, integer()} |
{global_address, integer()} |
{element_address, integer()} |
{data_address, integer()} |
{extern_address, integer()}.
-type module_instance() :: {module_instance,
list(function_type()),
gleam@dict:dict(integer(), address()),
list(address()),
list(address()),
list(address()),
list(address()),
list(address()),
list(export_instance())}.
-type function_instance() :: {web_assembly_function_instance,
function_type(),
module_instance(),
function_()} |
{host_function_instance,
function_type(),
fun((list(gleam@dynamic:dynamic_())) -> list(gleam@dynamic:dynamic_()))}.
-type table_instance() :: {table_instance, table_type(), list(value())}.
-type memory_instance() :: {memory_instance, limits(), bitstring()}.
-type global_instance() :: {global_instance, global_type(), value()}.
-type element_instance() :: {element_instance, reference_type(), list(value())}.
-type data_instance() :: {data_instance, bitstring()}.
-type export_instance() :: {export_instance, binary(), external_value()}.
-type external_value() :: {function_external_value, address()} |
{table_external_value, address()} |
{memory_external_value, address()} |
{global_external_value, address()}.
-type store() :: {store,
gleam@dict:dict(address(), function_instance()),
list(table_instance()),
list(memory_instance()),
list(global_instance()),
list(element_instance()),
list(data_instance())}.
-type binary_() :: {binary, integer(), integer(), module_()}.
-type section() :: {section,
integer(),
integer(),
gleam@option:option(section_content())}.
-type section_content() :: {custom_section,
binary(),
gleam@option:option(bitstring())} |
{type_section, list(function_type())} |
import_section |
{function_section, list(integer())} |
table_section |
{memory_section, list(memory())} |
{global_section, list(global())} |
{export_section, list(export())} |
{start_section, start_function()} |
element_section |
{code_section, list(code())} |
data_section |
data_count_section.
-type code() :: {code, integer(), function_code()}.
-type function_code() :: {function_code,
list(locals_declaration()),
list(instruction())}.
-type locals_declaration() :: {locals_declaration, integer(), value_type()}.