Files
LLeMbas-TTY/config/derive/src/lib.rs
T
Wez Furlong 8508860136 config: derive some metadata about the config
This isn't used by anything yet, but will enable some runtime
config editing functions that I have planeed for the future.
2022-09-22 06:09:31 -07:00

14 lines
359 B
Rust

use proc_macro::TokenStream;
use syn::{parse_macro_input, DeriveInput};
mod attr;
mod bound;
mod configmeta;
#[proc_macro_derive(ConfigMeta, attributes(config))]
pub fn derive_config(input: TokenStream) -> TokenStream {
configmeta::derive(parse_macro_input!(input as DeriveInput))
.unwrap_or_else(|err| err.to_compile_error())
.into()
}