#![doc = include_str!("../README.md")]
use proc_macro::{Group, TokenStream, TokenTree};
#[doc = include_str!("../README.md")]
#[proc_macro]
pub fn identity(stream: TokenStream) -> TokenStream {
stream.into_iter().map(|tt| match tt {
TokenTree::Group(g) => {
let mut new_g = Group::new(g.delimiter(), identity(g.stream()));
new_g.set_span(g.span());
new_g.into()
},
_ => tt,
}).collect()
}
#[proc_macro]
pub fn identity_inner(stream: TokenStream) -> TokenStream {
proc_macro_tool::pfunc_lossless(stream, false, ["identity"], |_, param| {
identity(param.stream())
})
}