rename output_type to output_types

This commit is contained in:
vms 2021-04-22 16:57:34 +03:00
parent 1cbe8c3bfa
commit 1570760879
2 changed files with 21 additions and 4 deletions

View File

@ -29,9 +29,7 @@ pub struct FnArgument {
pub struct FnSignature {
pub name: String,
pub arguments: Vec<FnArgument>,
// fce supports only one return value now,
// waiting for adding multi-value support in Wasmer.
pub output_type: Vec<ParsedType>,
pub output_types: Vec<ParsedType>,
}
#[derive(Clone, Serialize, Deserialize)]
@ -165,7 +163,7 @@ impl From<AstFnSignature> for FnSignature {
Self {
name: ast_fn_sig.name,
arguments,
output_type,
output_types: output_type,
}
}
}

View File

@ -25,6 +25,25 @@ use crate::new_ident;
use proc_macro2::TokenStream;
// vectors:
// before:
// Vec<u8>
// Vec<f32>
// Vec<u64>
// => Vec<u64> => (ptr, size) => IT
// Vec<Vec<u8>> => Vec<Vec<u64>> => Vec<(u32, u32)> => Vec<u64>
// after:
// Vec<bool> => Vec<u8>
// Vec<u8> => (ptr, size) => IT
// records
// before:
// Record A => Vec<u64> => IT
// after:
// Record A => Vec<u8> => IT
impl quote::ToTokens for ast_types::AstFnItem {
fn to_tokens(&self, tokens: &mut TokenStream) {
crate::prepare_global_data!(