initial macos porting work

This commit is contained in:
Will Temple
2026-03-23 15:16:20 -04:00
parent 4193457fc4
commit 861bf63621
40 changed files with 4575 additions and 233 deletions

View File

@@ -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) },