1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![crate_type = "proc-macro"]
#![allow(broken_intra_doc_links)]
use proc_macro::TokenStream;
use proc_macro_error::proc_macro_error;
use syn::{parse_macro_input, DeriveInput};
mod error_category;
mod str_placeholder;
#[proc_macro_error]
#[proc_macro_derive(ErrorCategory, attributes(error_category, error))]
pub fn error_category(input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as DeriveInput);
error_category::derive_error_category(input).into()
}