1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! This crate implements the macro for `qname` and should not be used directly.

extern crate proc_macro;

use proc_macro::TokenStream;
use syn::parse_macro_input;

#[proc_macro]
/// Document your macro here.
pub fn qname(item: TokenStream) -> TokenStream {
    let item = parse_macro_input!(item as proc_macro2::TokenStream);

    match qname_impl::qname(item) {
        Ok(tokens) => tokens.into(),
        Err(err) => TokenStream::from(err.to_compile_error()),
    }
}