diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-01-20 17:53:59 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-01-20 17:53:59 +0100 |
| commit | 032d2cdd590c1cdd30490384742a90dc0c759176 (patch) | |
| tree | 8143f664e815a3f50abd30d1da8c16baba738b91 /crates/parser/src | |
| parent | be396125fe5a3643a91caa35a228ec0390ae1d5f (diff) | |
chore: progress towards host functions
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src')
| -rw-r--r-- | crates/parser/src/lib.rs | 12 |
1 files changed, 7 insertions, 5 deletions
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<ModuleReader> 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::<Vec<_>>(); |
