#![recursion_limit = "128"] #![allow(unused_imports)] extern crate proc_macro; #[macro_use] extern crate quote; use darling::{FromDeriveInput, FromField, FromMeta}; use proc_macro2::TokenStream; mod uniforms; #[proc_macro_derive(Uniforms)] pub fn derive_uniforms(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input: syn::DeriveInput = syn::parse_macro_input!(input); match uniforms::DeriveInput::from_derive_input(&input) { Ok(input) => input.derive().into(), Err(e) => e.write_errors().into(), } } mod vertex; #[proc_macro_derive(Vertex)] pub fn derive_vertex(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input: syn::DeriveInput = syn::parse_macro_input!(input); match vertex::DeriveInput::from_derive_input(&input) { Ok(input) => input.derive().into(), Err(e) => e.write_errors().into(), } }