initial macos porting work
This commit is contained in:
@@ -60,10 +60,7 @@ fn expand_component(mut function: ItemFn) -> Result<proc_macro2::TokenStream> {
|
||||
Some(prop) if prop.ident == "children" => {
|
||||
let prop = inputs.pop().expect("last input should exist");
|
||||
let kind = parse_children_contract_kind(&prop.ty)?;
|
||||
Some(ChildContract {
|
||||
ty: prop.ty,
|
||||
kind,
|
||||
})
|
||||
Some(ChildContract { ty: prop.ty, kind })
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
@@ -87,7 +84,8 @@ fn expand_component(mut function: ItemFn) -> Result<proc_macro2::TokenStream> {
|
||||
}
|
||||
Some(contract) => {
|
||||
let child_arg_ty = child_builder_arg_type_tokens(contract.kind);
|
||||
let child_value = wrap_special_value_tokens(contract.kind, &format_ident!("children"));
|
||||
let child_value =
|
||||
wrap_special_value_tokens(contract.kind, &format_ident!("children"));
|
||||
let child_field_ident = child_field_ident
|
||||
.as_ref()
|
||||
.expect("child field ident should exist");
|
||||
@@ -574,10 +572,7 @@ fn child_builder_arg_type_tokens(kind: SpecialValueKind) -> proc_macro2::TokenSt
|
||||
}
|
||||
}
|
||||
|
||||
fn wrap_special_value_tokens(
|
||||
kind: SpecialValueKind,
|
||||
ident: &Ident,
|
||||
) -> proc_macro2::TokenStream {
|
||||
fn wrap_special_value_tokens(kind: SpecialValueKind, ident: &Ident) -> proc_macro2::TokenStream {
|
||||
match kind {
|
||||
SpecialValueKind::Plain => quote! { #ident },
|
||||
SpecialValueKind::ChildViews => quote! { ::ruin_app::ChildViews::from_children(#ident) },
|
||||
|
||||
Reference in New Issue
Block a user