diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-01-26 01:26:09 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-01-26 01:26:09 +0100 |
| commit | 461126ce309f99e4ad2a6ddcbc175ea01c5e8fee (patch) | |
| tree | 30de8bcfec97f87d468191fb9959f90e7ee91100 /crates/parser | |
| parent | b9a4e8788f374dac94e4f3f5b062dbe2a1d2a10c (diff) | |
feat: full no_std support
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser')
| -rw-r--r-- | crates/parser/src/conversion.rs | 6 | ||||
| -rw-r--r-- | crates/parser/src/lib.rs | 2 | ||||
| -rw-r--r-- | crates/parser/src/module.rs | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs index 90dde8c..835842f 100644 --- a/crates/parser/src/conversion.rs +++ b/crates/parser/src/conversion.rs @@ -1,5 +1,5 @@ +use crate::log; use alloc::{boxed::Box, format, string::ToString, vec::Vec}; -use log::debug; use tinywasm_types::*; use wasmparser::{FuncValidator, OperatorsReader, ValidatorResources}; @@ -239,7 +239,7 @@ pub fn process_operators<'a>( let mut labels_ptrs = Vec::new(); // indexes into the instructions array for op in ops { - debug!("op: {:?}", op); + log::debug!("op: {:?}", op); let op = op?; validator.op(offset, &op)?; @@ -274,7 +274,7 @@ pub fn process_operators<'a>( } End => { if let Some(label_pointer) = labels_ptrs.pop() { - debug!("ending block: {:?}", instructions[label_pointer]); + log::debug!("ending block: {:?}", instructions[label_pointer]); let current_instr_ptr = instructions.len(); diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index aa76ea3..edcd280 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -14,7 +14,9 @@ use log; #[cfg(not(feature = "logging"))] mod log { macro_rules! debug ( ($($tt:tt)*) => {{}} ); + macro_rules! error ( ($($tt:tt)*) => {{}} ); pub(crate) use debug; + pub(crate) use error; } mod conversion; diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs index 811c51f..e0fb0cc 100644 --- a/crates/parser/src/module.rs +++ b/crates/parser/src/module.rs @@ -181,9 +181,9 @@ impl ModuleReader { validator.end(offset)?; self.end_reached = true; } - CustomSection(reader) => { + CustomSection(_reader) => { debug!("Found custom section"); - debug!("Skipping custom section: {:?}", reader.name()); + debug!("Skipping custom section: {:?}", _reader.name()); } // TagSection(tag) => { // debug!("Found tag section"); |
