Packages

An experimental work-in-progress (WIP) WebAssembly runtime written in Gleam.

Current section

Files

Jump to
gwr src gwr@binary.erl
Raw

src/gwr@binary.erl

-module(gwr@binary).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([binary_/0, section/0, section_content/0, code/0, function_code/0, locals_declaration/0]).
-type binary_() :: {binary, integer(), integer(), gwr@syntax@module:module_()}.
-type section() :: {section,
integer(),
integer(),
gleam@option:option(section_content())}.
-type section_content() :: {custom_section,
binary(),
gleam@option:option(bitstring())} |
{type_section, list(gwr@syntax@types:function_type())} |
import_section |
{function_section, list(integer())} |
table_section |
{memory_section, list(gwr@syntax@module:memory())} |
{global_section, list(gwr@syntax@module:global())} |
{export_section, list(gwr@syntax@module:export())} |
{start_section, gwr@syntax@module: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(gwr@syntax@instruction:instruction())}.
-type locals_declaration() :: {locals_declaration,
integer(),
gwr@syntax@types:value_type()}.