Home
last modified time | relevance | path

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

12

/linux/rust/macros/
H A Dpaste.rs3 use proc_macro2::{Delimiter, Group, Ident, Spacing, Span, TokenTree};
5 fn concat_helper(tokens: &[TokenTree]) -> Vec<(String, Span)> { in concat_helper()
12 Some(TokenTree::Literal(lit)) => { in concat_helper()
21 Some(TokenTree::Ident(ident)) => { in concat_helper()
28 Some(TokenTree::Punct(p)) if p.as_char() == ':' => { in concat_helper()
29 let Some(TokenTree::Ident(ident)) = tokens.next() else { in concat_helper()
49 Some(TokenTree::Group(group)) if group.delimiter() == Delimiter::None => { in concat_helper()
50 let tokens = group.stream().into_iter().collect::<Vec<TokenTree>>(); in concat_helper()
60 fn concat(tokens: &[TokenTree], group_span: Span) -> TokenTree { in concat() argument
66 expand(tokens: &mut Vec<TokenTree>) expand() argument
[all...]
H A Dpin_data.rs
H A Dquote.rs
H A Dvtable.rs
H A Dpinned_drop.rs
H A Dhelpers.rs
H A Dzeroable.rs
H A Dconcat_idents.rs6 TokenTree, //
35 TokenStream::from_iter([TokenTree::Ident(res)])
H A Dfmt.rs5 use proc_macro2::{Ident, TokenStream, TokenTree};
17 Some(TokenTree::Literal(first_lit)) => { in fmt()
62 if matches!(&tt, TokenTree::Punct(p) if p.as_char() == '=') { in fmt()
79 TokenTree::Punct(p) if p.as_char() == ',' => { in fmt()
H A Dmodule.rs
/linux/rust/syn/
H A Dtt.rs3 use proc_macro2::{Delimiter, TokenStream, TokenTree};
6 pub(crate) struct TokenTreeHelper<'a>(pub &'a TokenTree);
13 (TokenTree::Group(g1), TokenTree::Group(g2)) => { in eq()
36 (TokenTree::Punct(o1), TokenTree::Punct(o2)) => { in eq()
43 (TokenTree::Literal(l1), TokenTree::Literal(l2)) => l1.to_string() == l2.to_string(), in eq()
44 (TokenTree::Ident(s1), TokenTree::Ident(s2)) => s1 == s2, in eq()
55 TokenTree::Group(g) => { in hash()
69 TokenTree::Punct(op) => { in hash()
77 TokenTree::Literal(lit) => (2u8, lit.to_string()).hash(h), in hash()
78 TokenTree::Ident(word) => (3u8, word).hash(h), in hash()
H A Derror.rs7 Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
286 TokenTree::Punct({ in to_compile_error()
291 TokenTree::Punct({ in to_compile_error()
296 TokenTree::Ident(Ident::new("core", start)), in to_compile_error()
297 TokenTree::Punct({ in to_compile_error()
302 TokenTree::Punct({ in to_compile_error()
307 TokenTree::Ident(Ident::new("compile_error", start)), in to_compile_error()
308 TokenTree::Punct({ in to_compile_error()
313 TokenTree::Group({ in to_compile_error()
315 TokenStream::from_iter([TokenTree::Literal({ in to_compile_error()
H A Dbuffer.rs12 use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
44 TokenTree::Ident(ident) => entries.push(Entry::Ident(ident)), in recursive_new()
45 TokenTree::Punct(punct) => entries.push(Entry::Punct(punct)), in recursive_new()
46 TokenTree::Literal(literal) => entries.push(Entry::Literal(literal)), in recursive_new()
47 TokenTree::Group(group) => { in recursive_new()
306 pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> { in token_tree() argument
H A Dmac.rs14 use proc_macro2::TokenTree;
157 if let Some((TokenTree::Group(g), rest)) = cursor.token_tree() { in parse_delimiter()
H A Dscan_expr.rs4 use proc_macro2::{Delimiter, Ident, Spacing, TokenTree};
222 Input::ConsumeAny => input.parse::<Option<TokenTree>>()?.is_some(), in scan_expr()
H A Dclassify.rs14 use proc_macro2::{Delimiter, TokenStream, TokenTree};
307 if let Some(TokenTree::Group(last)) = tokens.clone().into_iter().last() { in expr_trailing_brace()
/linux/rust/pin-init/internal/src/
H A Dzeroable.rs12 parse_zeroable_derive_input( input: TokenStream, ) -> ( Vec<TokenTree>, Vec<TokenTree>, Vec<TokenTree>, Option<TokenTree>, ) parse_zeroable_derive_input() argument
15 parse_zeroable_derive_input( input: TokenStream, ) -> ( Vec<TokenTree>, Vec<TokenTree>, Vec<TokenTree>, Option<TokenTree>, ) parse_zeroable_derive_input() argument
H A Dpinned_drop.rs
/linux/rust/proc-macro2/
H A Dlib.rs281 impl From<TokenTree> for TokenStream {
282 fn from(token: TokenTree) -> Self { in from()
287 impl Extend<TokenTree> for TokenStream {
288 fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) { in extend()
301 impl FromIterator<TokenTree> for TokenStream {
302 fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self { in from_iter()
539 pub enum TokenTree { enum
550 impl TokenTree { impl
555 TokenTree::Group(t) => t.span(), in span()
556 TokenTree::Ident(t) => t.span(), in span()
[all …]
H A Dwrapper.rs13 use crate::{Delimiter, Punct, Spacing, TokenTree};
35 extra: Vec<proc_macro::TokenTree>,
163 fn into_compiler_token(token: TokenTree) -> proc_macro::TokenTree { in into_compiler_token() argument
165 TokenTree::Group(tt) => proc_macro::TokenTree::Group(tt.inner.unwrap_nightly()), in into_compiler_token()
166 TokenTree::Punct(tt) => { in into_compiler_token()
173 proc_macro::TokenTree::Punct(punct) in into_compiler_token()
175 TokenTree::Ident(tt) => proc_macro::TokenTree::Ident(tt.inner.unwrap_nightly()), in into_compiler_token()
176 TokenTree::Literal(tt) => proc_macro::TokenTree::Literal(tt.inner.unwrap_nightly()), in into_compiler_token()
180 impl From<TokenTree> for TokenStream {
181 fn from(token: TokenTree) -> Self { in from()
[all …]
H A Dfallback.rs9 use crate::{Delimiter, Spacing, TokenTree};
49 inner: RcVec<TokenTree>,
98 fn take_inner(self) -> RcVecBuilder<TokenTree> { in take_inner() argument
104 fn push_token_from_proc_macro(mut vec: RcVecMut<TokenTree>, token: TokenTree) { in push_token_from_proc_macro() argument
107 TokenTree::Literal(crate::Literal { in push_token_from_proc_macro()
120 fn push_negative_literal(mut vec: RcVecMut<TokenTree>, mut literal: Literal) { in push_token_from_proc_macro() argument
124 vec.push(TokenTree::Punct(punct)); in push_token_from_proc_macro()
125 vec.push(TokenTree::Literal(crate::Literal::_new_fallback(literal))); in push_token_from_proc_macro()
140 TokenTree::Group(group) => group.inner, in drop()
163 inner: RcVecBuilder<TokenTree>,
[all …]
H A Dparse.rs7 use crate::{Delimiter, Punct, Spacing, TokenTree};
237 trees.push_token_from_parser(TokenTree::Group(crate::Group::_new_fallback(g))); in token_stream()
268 fn leaf_token(input: Cursor) -> PResult<TokenTree> { in leaf_token() argument
271 Ok((input, TokenTree::Literal(crate::Literal::_new_fallback(l)))) in leaf_token()
273 Ok((input, TokenTree::Punct(p))) in leaf_token()
275 Ok((input, TokenTree::Ident(i))) in leaf_token()
279 Ok((rest, TokenTree::Literal(repr))) in leaf_token()
937 trees.push_token_from_parser(TokenTree::Punct(pound)); in doc_comment()
942 trees.push_token_from_parser(TokenTree::Punct(bang)); in doc_comment()
951 bracketed.push_token_from_parser(TokenTree::Ident(doc_ident)); in doc_comment()
[all …]
/linux/rust/quote/
H A Dext.rs5 use proc_macro2::{TokenStream, TokenTree};
16 U: Into<TokenTree>; in append() argument
64 U: Into<TokenTree>, in append() argument
H A Druntime.rs8 use proc_macro2::{Group, Ident, Punct, Spacing, TokenTree};
281 fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree { in respan_token_tree() argument
283 TokenTree::Group(g) => { in respan_token_tree()
311 TokenTree::Punct(Punct::new('\'', Spacing::Joint)), in push_lifetime()
312 TokenTree::Ident(Ident::new(&lifetime[1..], Span::call_site())), in push_lifetime()
319 TokenTree::Punct({ in push_lifetime_spanned()
324 TokenTree::Ident(Ident::new(&lifetime[1..], span)), in push_lifetime_spanned()
H A Dto_tokens.rs7 use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
259 impl ToTokens for TokenTree { implementation

12