Home
last modified time | relevance | path

Searched refs:TokenTree (Results 1 – 9 of 9) sorted by relevance

/rust/macros/
Dpin_data.rs4 use proc_macro::{Group, Punct, Spacing, TokenStream, TokenTree};
27 .skip_while(|tt| !matches!(tt, TokenTree::Ident(i) if i.to_string() == "struct")) in pin_data()
30 TokenTree::Ident(_) => { in pin_data()
36 res.push(TokenTree::Punct(Punct::new(':', Spacing::Joint))); in pin_data()
37 res.push(TokenTree::Punct(Punct::new(':', Spacing::Alone))); in pin_data()
38 res.push(TokenTree::Punct(Punct::new('<', Spacing::Alone))); in pin_data()
40 res.push(TokenTree::Punct(Punct::new('>', Spacing::Alone))); in pin_data()
64 if matches!(&tt, TokenTree::Ident(i) if i.to_string() == "struct") { in pin_data()
90 struct_name: &Vec<TokenTree>, in replace_self_and_deny_type_defs() argument
91 tt: TokenTree, in replace_self_and_deny_type_defs() argument
[all …]
Dpaste.rs3 use proc_macro::{Delimiter, Group, Ident, Spacing, Span, TokenTree};
5 fn concat(tokens: &[TokenTree], group_span: Span) -> TokenTree { in concat() argument
12 Some(TokenTree::Literal(lit)) => segments.push((lit.to_string(), lit.span())), in concat()
13 Some(TokenTree::Ident(ident)) => { in concat()
20 Some(TokenTree::Punct(p)) if p.as_char() == ':' => { in concat()
21 let Some(TokenTree::Ident(ident)) = tokens.next() else { in concat()
46 TokenTree::Ident(Ident::new(&pasted, span.unwrap_or(group_span))) in concat()
49 pub(crate) fn expand(tokens: &mut Vec<TokenTree>) { in expand() argument
51 if let TokenTree::Group(group) = token { in expand()
58 && matches!(&stream[0], TokenTree::Punct(p) if p.as_char() == '<') in expand()
[all …]
Dhelpers.rs3 use proc_macro::{token_stream, Group, Punct, Spacing, TokenStream, TokenTree};
6 if let Some(TokenTree::Ident(ident)) = it.next() { in try_ident()
14 if let Some(TokenTree::Literal(literal)) = it.next() { in try_literal()
42 if let TokenTree::Punct(punct) = it.next().expect("Reached end of token stream for Punct") { in expect_punct()
60 if let TokenTree::Group(group) = it.next().expect("Reached end of token stream for Group") { in expect_group()
74 pub(crate) impl_generics: Vec<TokenTree>,
75 pub(crate) ty_generics: Vec<TokenTree>,
81 pub(crate) fn parse_generics(input: TokenStream) -> (Generics, Vec<TokenTree>) { in parse_generics() argument
95 TokenTree::Punct(p) if p.as_char() == '<' => { in parse_generics()
102 TokenTree::Punct(p) if p.as_char() == '>' => { in parse_generics()
[all …]
Dvtable.rs3 use proc_macro::{Delimiter, Group, TokenStream, TokenTree};
14 TokenTree::Ident(ident) => match ident.to_string().as_str() { in vtable()
25 Some(TokenTree::Group(group)) if group.delimiter() == Delimiter::Brace => group, in vtable()
34 TokenTree::Ident(ident) if ident.to_string() == "fn" => { in vtable()
36 Some(TokenTree::Ident(ident)) => ident.to_string(), in vtable()
42 TokenTree::Ident(ident) if ident.to_string() == "const" => { in vtable()
44 Some(TokenTree::Ident(ident)) => ident.to_string(), in vtable()
94 tokens.push(TokenTree::Group(Group::new(Delimiter::Brace, new_body))); in vtable()
Dpinned_drop.rs3 use proc_macro::{TokenStream, TokenTree};
9 assert!(matches!(&toks[0], TokenTree::Ident(i) if i.to_string() == "impl")); in pinned_drop()
15 TokenTree::Punct(p) if p.as_char() == '<' => { in pinned_drop()
18 TokenTree::Punct(p) if p.as_char() == '>' => { in pinned_drop()
27 matches!(tt, TokenTree::Ident(i) if i.to_string() == "PinnedDrop"), in pinned_drop()
40 if let Some(TokenTree::Group(last)) = toks.pop() { in pinned_drop()
Dquote.rs3 use proc_macro::{TokenStream, TokenTree};
19 tokens.extend([TokenTree::from(self.clone())]); in to_tokens()
23 impl ToTokens for TokenTree { implementation
70 $v.push(::proc_macro::TokenTree::Group(::proc_macro::Group::new(
79 $v.push(::proc_macro::TokenTree::Group(::proc_macro::Group::new(
88 $v.push(::proc_macro::TokenTree::Group(::proc_macro::Group::new(
95 $v.push(::proc_macro::TokenTree::Punct(
98 $v.push(::proc_macro::TokenTree::Punct(
104 $v.push(::proc_macro::TokenTree::Punct(
110 $v.push(::proc_macro::TokenTree::Punct(
[all …]
Dzeroable.rs4 use proc_macro::{TokenStream, TokenTree};
27 TokenTree::Punct(p) if nested == 0 && p.as_char() == ',' => { in derive()
36 TokenTree::Punct(p) if nested == 0 && p.as_char() == '\'' => { in derive()
40 TokenTree::Punct(p) if nested == 0 && p.as_char() == ':' => { in derive()
47 TokenTree::Punct(p) if p.as_char() == '<' => { in derive()
51 TokenTree::Punct(p) if p.as_char() == '>' => { in derive()
Dconcat_idents.rs3 use proc_macro::{token_stream, Ident, TokenStream, TokenTree};
8 if let Some(TokenTree::Ident(ident)) = it.next() { in expect_ident()
22 TokenStream::from_iter([TokenTree::Ident(res)]) in concat_idents()
Dmodule.rs4 use proc_macro::{token_stream, Delimiter, Literal, TokenStream, TokenTree};
17 Some(TokenTree::Punct(punct)) => assert_eq!(punct.as_char(), ','), in expect_string_array()
113 Some(TokenTree::Ident(ident)) => ident.to_string(), in parse()