MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / convert_valtype

Function convert_valtype

crates/parser/src/conversion.rs:217–226  ·  view source on GitHub ↗
(valtype: &wasmparser::ValType)

Source from the content-addressed store, hash-verified

215}
216
217pub(crate) fn convert_valtype(valtype: &wasmparser::ValType) -> Result<WasmType> {
218 match valtype {
219 wasmparser::ValType::I32 => Ok(WasmType::I32),
220 wasmparser::ValType::I64 => Ok(WasmType::I64),
221 wasmparser::ValType::F32 => Ok(WasmType::F32),
222 wasmparser::ValType::F64 => Ok(WasmType::F64),
223 wasmparser::ValType::V128 => Ok(WasmType::V128),
224 wasmparser::ValType::Ref(r) => convert_reftype(*r),
225 }
226}
227
228pub(crate) fn process_const_operators(ops: OperatorsReader<'_>) -> Result<Box<[ConstInstruction]>> {
229 let ops = ops.into_iter().collect::<wasmparser::Result<Vec<_>>>()?;

Callers 2

convert_module_importFunction · 0.85
convert_module_globalsFunction · 0.85

Calls 1

convert_reftypeFunction · 0.85

Tested by

no test coverage detected