2020-01-21 11:15:28 +00:00
|
|
|
extern crate proc_macro;
|
|
|
|
|
2020-06-04 03:08:20 +00:00
|
|
|
mod app_plugin;
|
|
|
|
mod bytes;
|
2020-06-03 20:04:09 +00:00
|
|
|
mod entity_archetype;
|
2020-05-04 00:54:16 +00:00
|
|
|
mod modules;
|
2020-06-03 20:04:09 +00:00
|
|
|
mod resource;
|
2020-06-04 03:08:20 +00:00
|
|
|
mod uniforms;
|
2020-06-07 20:00:58 +00:00
|
|
|
mod as_vertex_buffer_descriptor;
|
2020-05-04 00:54:16 +00:00
|
|
|
|
2020-01-19 10:02:12 +00:00
|
|
|
use proc_macro::TokenStream;
|
2020-03-18 23:06:33 +00:00
|
|
|
|
2020-05-27 22:49:27 +00:00
|
|
|
#[proc_macro_derive(FromResources, attributes(module))]
|
2020-06-07 19:22:16 +00:00
|
|
|
pub fn derive_from_resources(input: TokenStream) -> TokenStream {
|
|
|
|
resource::derive_from_resources(input)
|
2020-04-30 20:26:01 +00:00
|
|
|
}
|
|
|
|
|
2020-06-01 21:33:00 +00:00
|
|
|
#[proc_macro_derive(Bytes, attributes(module))]
|
|
|
|
pub fn derive_bytes(input: TokenStream) -> TokenStream {
|
2020-06-03 20:04:09 +00:00
|
|
|
bytes::derive_bytes(input)
|
2020-06-01 21:33:00 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 00:54:16 +00:00
|
|
|
#[proc_macro_derive(Uniform, attributes(uniform, module))]
|
|
|
|
pub fn derive_uniform(input: TokenStream) -> TokenStream {
|
2020-06-03 20:04:09 +00:00
|
|
|
uniforms::derive_uniform(input)
|
2020-05-04 00:54:16 +00:00
|
|
|
}
|
|
|
|
|
2020-06-07 20:00:58 +00:00
|
|
|
#[proc_macro_derive(Uniforms, attributes(uniform, module))]
|
|
|
|
pub fn derive_uniforms(input: TokenStream) -> TokenStream {
|
|
|
|
uniforms::derive_uniforms(input)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[proc_macro_derive(AsVertexBufferDescriptor, attributes(vertex, module))]
|
|
|
|
pub fn derive_as_vertex_buffer_descriptor(input: TokenStream) -> TokenStream {
|
|
|
|
as_vertex_buffer_descriptor::derive_as_vertex_buffer_descriptor(input)
|
|
|
|
}
|
|
|
|
|
2020-04-06 21:20:53 +00:00
|
|
|
#[proc_macro_derive(EntityArchetype, attributes(tag, module))]
|
2020-01-19 10:02:12 +00:00
|
|
|
pub fn derive_entity_archetype(input: TokenStream) -> TokenStream {
|
2020-06-03 20:04:09 +00:00
|
|
|
entity_archetype::derive_entity_archetype(input)
|
2020-02-10 05:41:51 +00:00
|
|
|
}
|
2020-02-10 02:04:18 +00:00
|
|
|
|
2020-01-21 04:10:40 +00:00
|
|
|
|
2020-04-05 21:12:14 +00:00
|
|
|
#[proc_macro_derive(DynamicAppPlugin)]
|
2020-01-21 04:10:40 +00:00
|
|
|
pub fn derive_app_plugin(input: TokenStream) -> TokenStream {
|
2020-06-07 19:22:16 +00:00
|
|
|
app_plugin::derive_dynamic_app_plugin(input)
|
2020-01-21 04:10:40 +00:00
|
|
|
}
|