diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-05-01 17:35:52 +0200 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-05-01 17:35:52 +0200 |
| commit | 81dc6e7062ed86945a6253c6edaffe62ddabc631 (patch) | |
| tree | 190673702389585a9b90ffe1764761a42c15fd76 /crates/parser/src/visit.rs | |
| parent | 704a8da24bb9e85e712fbb745ff4d4e1b54b6914 (diff) | |
feat: switch back to upstream wasmparser
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/visit.rs')
| -rw-r--r-- | crates/parser/src/visit.rs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/crates/parser/src/visit.rs b/crates/parser/src/visit.rs index c5743b8..80dc789 100644 --- a/crates/parser/src/visit.rs +++ b/crates/parser/src/visit.rs @@ -117,12 +117,26 @@ impl FunctionBuilder { } } +macro_rules! impl_visit_operator { + ($(@$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident)*) => { + $(impl_visit_operator!(@@$proposal $op $({ $($arg: $argty),* })? => $visit);)* + }; + + (@@mvp $($rest:tt)* ) => {}; + (@@reference_types $($rest:tt)* ) => {}; + (@@sign_extension $($rest:tt)* ) => {}; + (@@saturating_float_to_int $($rest:tt)* ) => {}; + (@@bulk_memory $($rest:tt)* ) => {}; + (@@$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident) => { + fn $visit(&mut self $($(,$arg: $argty)*)?) -> Result<()>{ + self.unsupported(stringify!($visit)) + } + }; +} + impl<'a> wasmparser::VisitOperator<'a> for FunctionBuilder { type Output = Result<()>; - - fn visit_default(&mut self, op: &str) -> Self::Output { - self.unsupported(op) - } + wasmparser::for_each_operator!(impl_visit_operator); define_primitive_operands! { visit_br, Instruction::Br, u32, |
