Lines Matching refs:TokenTree
3 use proc_macro::{Delimiter, Group, Ident, Spacing, Span, TokenTree};
5 fn concat_helper(tokens: &[TokenTree]) -> Vec<(String, Span)> {
12 Some(TokenTree::Literal(lit)) => {
21 Some(TokenTree::Ident(ident)) => {
28 Some(TokenTree::Punct(p)) if p.as_char() == ':' => {
29 let Some(TokenTree::Ident(ident)) = tokens.next() else {
49 Some(TokenTree::Group(group)) if group.delimiter() == Delimiter::None => {
50 let tokens = group.stream().into_iter().collect::<Vec<TokenTree>>();
60 fn concat(tokens: &[TokenTree], group_span: Span) -> TokenTree {
63 TokenTree::Ident(Ident::new(&pasted, group_span))
66 pub(crate) fn expand(tokens: &mut Vec<TokenTree>) {
68 if let TokenTree::Group(group) = token {
75 && matches!(&stream[0], TokenTree::Punct(p) if p.as_char() == '<')
76 && matches!(&stream[stream.len() - 1], TokenTree::Punct(p) if p.as_char() == '>')
85 *token = TokenTree::Group(group);
95 (TokenTree::Punct(a), TokenTree::Punct(b))
99 TokenTree::Group(group) if group.delimiter() == Delimiter::None => {
106 TokenTree::Group(group) if group.delimiter() == Delimiter::None => {