diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-02-25 17:51:41 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-02-25 17:51:41 +0100 |
| commit | 062515c39154b29bb0406b207e3c67bae399a449 (patch) | |
| tree | 722520f15d62714c003f8dad36651d30ffba4e47 /crates/parser/src/lib.rs | |
| parent | a0368bc39ac620b867a105ca0c9bc12824abcd9d (diff) | |
feat: new parser architecture
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/lib.rs')
| -rw-r--r-- | crates/parser/src/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 72b3f81..dd4b931 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -7,6 +7,7 @@ #![forbid(unsafe_code)] #![cfg_attr(not(feature = "std"), feature(error_in_core))] //! See [`tinywasm`](https://docs.rs/tinywasm) for documentation. +#![recursion_limit = "1028"] mod std; extern crate alloc; @@ -28,6 +29,7 @@ mod log { mod conversion; mod error; mod module; +mod visit; use alloc::{string::ToString, vec::Vec}; pub use error::*; use module::ModuleReader; @@ -155,11 +157,11 @@ impl TryFrom<ModuleReader> for TinyWasmModule { .code .into_iter() .zip(code_type_addrs) - .map(|(f, ty_idx)| TypedWasmFunction { + .map(|((instructions, locals), ty_idx)| TypedWasmFunction { type_addr: ty_idx, wasm_function: WasmFunction { - instructions: f.body, - locals: f.locals, + instructions, + locals, ty: reader.func_types.get(ty_idx as usize).expect("No func type for func, this is a bug").clone(), }, }) |
