/// }
/// }
/// }
+///
+/// pub struct InstanceConfigCommon {
+/// {
/// ```
#[proc_macro_derive(ResolveConfig, attributes(
limited, server, client, computed, special,
pub fn resolve(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input = parse_macro_input!(input as DeriveInput);
- let fields = match input.data {
- Data::Struct(DataStruct { fields: syn::Fields::Named(ref f),.. }) => f,
+ let (fields, top_ident) = match input {
+ DeriveInput {
+ ref ident,
+ data: Data::Struct(DataStruct {
+ fields: syn::Fields::Named(ref f),
+ ..
+ }),
+ ..
+ } => (f, ident),
_ => panic!(),
};
+dbg!(&top_ident);
let target = &input.ident;
}
//dbg!(&output);
+ let global = syn::Ident::new(&format!("{}Common", top_ident),
+ top_ident.span());
+
let output = quote! {
impl #target {
const FIELDS: &'static [(&'static str, SectionKindList)]
})
}
}
+
+ pub struct #global {
+ }
};
+
//eprintln!("{}", &output);
output.into()
}