F2TD63MB77RLDLPHPNCOYEMW7QSWV6BXXR27SC2Y2OY42CGUQIKAC
table_vec(chunk)
end
defp table_vec(chunk) do
{length, rest} = u32(chunk)
do_table_vec(length, rest)
end
defp do_table_vec(length, chunk) do
do_table_vec(length, chunk, [])
end
defp do_table_vec(0, chunk, acc) do
{acc |> Enum.reverse(), chunk}
vec(&tabletype/1).(chunk)
end
defp typeidx_vec(chunk) do
{length, rest} = u32(chunk)
do_typeidx_vec(length, rest)
end
defp do_typeidx_vec(length, chunk) do
do_typeidx_vec(length, chunk, [])
end
defp do_typeidx_vec(0, chunk, acc) do
{acc |> Enum.reverse(), chunk}
defp do_typeidx_vec(length, chunk, acc) do
{index, rest} = u32(chunk)
do_typeidx_vec(length - 1, rest, [index | acc])
end
defp functype_vec(chunk) do
{length, rest} = u32(chunk)
do_functype_vec(length, rest)
defp vec(type) do
fn chunk ->
{length, rest} = u32(chunk)
do_vec(type, length, rest)
end