we can handle one layer of pointers!

This commit is contained in:
Pat Hickey
2020-01-24 18:08:37 -08:00
parent e789033651
commit 020778b7da
9 changed files with 155 additions and 86 deletions

View File

@@ -50,6 +50,14 @@ impl Names {
}
TypeRef::Value(ty) => match &**ty {
witx::Type::Builtin(builtin) => self.builtin_type(*builtin),
witx::Type::Pointer(pointee) => {
let pointee_type = self.type_ref(&pointee);
quote!(::memory::GuestPtrMut<#pointee_type>)
}
witx::Type::ConstPointer(pointee) => {
let pointee_type = self.type_ref(&pointee);
quote!(::memory::GuestPtr<#pointee_type>)
}
_ => unimplemented!("anonymous type ref"),
},
}