From 032d2cdd590c1cdd30490384742a90dc0c759176 Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Sat, 20 Jan 2024 17:53:59 +0100 Subject: chore: progress towards host functions Signed-off-by: Henry Gressmann --- crates/parser/src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'crates/parser/src/lib.rs') diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 561d5c6..3667f1d 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -23,7 +23,7 @@ mod module; use alloc::vec::Vec; pub use error::*; use module::ModuleReader; -use tinywasm_types::Function; +use tinywasm_types::{Function, WasmFunction}; use wasmparser::Validator; pub use tinywasm_types::TinyWasmModule; @@ -108,10 +108,12 @@ impl TryFrom for TinyWasmModule { .code .into_iter() .zip(func_types) - .map(|(f, ty)| Function { - instructions: f.body, - locals: f.locals, - ty, + .map(|(f, ty)| { + Function::WasmFunction(WasmFunction { + instructions: f.body, + locals: f.locals, + ty, + }) }) .collect::>(); -- cgit v1.3.1