shiv_macro_impl/
component.rs

1use quote::quote;
2use syn::{DeriveInput, Path};
3
4pub fn derive_component(input: DeriveInput, shiv: Path) -> proc_macro2::TokenStream {
5    let name = input.ident;
6    let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
7
8    quote! {
9        impl #impl_generics #shiv::world::Component for #name #ty_generics #where_clause {
10            type Storage = #shiv::storage::DenseStorage;
11        }
12    }
13}