1use proc_macro2::{
4 Ident,
5 TokenStream,
6 TokenTree, };
8use syn::{
9 parse::{
10 Parse,
11 ParseStream, },
13 Result,
14 Token, };
16
17pub(crate) struct Input {
18 a: Ident,
19 _comma: Token![,],
20 b: Ident,
21}
22
23impl Parse for Input {
24 fn parse(input: ParseStream<'_>) -> Result<Self> {
25 Ok(Self {
26 a: input.parse()?,
27 _comma: input.parse()?,
28 b: input.parse()?,
29 })
30 }
31}
32
33pub(crate) fn concat_idents(Input { a, b, .. }: Input) -> TokenStream {
34 let res = Ident::new(&format!("{a}{b}"), b.span());
35 TokenStream::from_iter([TokenTree::Ident(res)])
36}