Add async host functions

This commit is contained in:
Isaac Clayton 2022-06-13 16:06:39 +02:00
parent a5a0abb895
commit 4565f1a976
6 changed files with 96 additions and 91 deletions

View file

@ -115,11 +115,8 @@ pub fn import(args: TokenStream, function: TokenStream) -> TokenStream {
})
.unzip();
dbg!("hello");
let body = TokenStream::from(quote! {
{
// dbg!("executing imported function");
// setup
let data: (#( #tys ),*) = (#( #args ),*);
let data = ::plugin::bincode::serialize(&data).unwrap();
@ -137,12 +134,8 @@ pub fn import(args: TokenStream, function: TokenStream) -> TokenStream {
}
});
dbg!("hello2");
let block = parse_macro_input!(body as Block);
dbg!("hello {:?}", &block);
let inner_fn = ItemFn {
attrs: fn_declare.attrs,
vis: fn_declare.vis,