mirror of
https://github.com/OMGeeky/confique.git
synced 2026-01-17 08:59:34 +01:00
18 lines
369 B
Rust
18 lines
369 B
Rust
use proc_macro::TokenStream as TokenStream1;
|
|
|
|
|
|
mod gen;
|
|
mod ir;
|
|
mod parse;
|
|
mod util;
|
|
|
|
|
|
#[proc_macro_derive(Config, attributes(config))]
|
|
pub fn config(input: TokenStream1) -> TokenStream1 {
|
|
syn::parse2::<syn::DeriveInput>(input.into())
|
|
.and_then(ir::Input::from_ast)
|
|
.map(gen::gen)
|
|
.unwrap_or_else(|e| e.to_compile_error())
|
|
.into()
|
|
}
|