Home
last modified time | relevance | path

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

12

/third_party/rust/crates/syn/tests/
Dtest_ty.rs6 use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};
25 TokenTree::Group(Group::new(Delimiter::None, quote! { ty })), in test_macro_variable_type()
26 TokenTree::Punct(Punct::new('<', Spacing::Alone)), in test_macro_variable_type()
27 TokenTree::Ident(Ident::new("T", Span::call_site())), in test_macro_variable_type()
28 TokenTree::Punct(Punct::new('>', Spacing::Alone)), in test_macro_variable_type()
58 TokenTree::Group(Group::new(Delimiter::None, quote! { ty })), in test_macro_variable_type()
59 TokenTree::Punct(Punct::new(':', Spacing::Joint)), in test_macro_variable_type()
60 TokenTree::Punct(Punct::new(':', Spacing::Alone)), in test_macro_variable_type()
61 TokenTree::Punct(Punct::new('<', Spacing::Alone)), in test_macro_variable_type()
62 TokenTree::Ident(Ident::new("T", Span::call_site())), in test_macro_variable_type()
[all …]
Dtest_grouping.rs6 use proc_macro2::{Delimiter, Group, Literal, Punct, Spacing, TokenStream, TokenTree};
12 TokenTree::Literal(Literal::i32_suffixed(1)), in test_grouping()
13 TokenTree::Punct(Punct::new('+', Spacing::Alone)), in test_grouping()
14 TokenTree::Group(Group::new( in test_grouping()
17 TokenTree::Literal(Literal::i32_suffixed(2)), in test_grouping()
18 TokenTree::Punct(Punct::new('+', Spacing::Alone)), in test_grouping()
19 TokenTree::Literal(Literal::i32_suffixed(3)), in test_grouping()
22 TokenTree::Punct(Punct::new('*', Spacing::Alone)), in test_grouping()
23 TokenTree::Literal(Literal::i32_suffixed(4)), in test_grouping()
Dtest_item.rs6 use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};
14 TokenTree::Group(Group::new(Delimiter::None, quote! { #[test] })), in test_macro_variable_attr()
15 TokenTree::Ident(Ident::new("fn", Span::call_site())), in test_macro_variable_attr()
16 TokenTree::Ident(Ident::new("f", Span::call_site())), in test_macro_variable_attr()
17 TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())), in test_macro_variable_attr()
18 TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())), in test_macro_variable_attr()
125 TokenTree::Ident(Ident::new("impl", Span::call_site())), in test_macro_variable_impl()
126 TokenTree::Group(Group::new(Delimiter::None, quote!(Trait))), in test_macro_variable_impl()
127 TokenTree::Ident(Ident::new("for", Span::call_site())), in test_macro_variable_impl()
128 TokenTree::Group(Group::new(Delimiter::None, quote!(Type))), in test_macro_variable_impl()
[all …]
Dtest_visibility.rs6 use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};
106 TokenTree::Ident(Ident::new("struct", Span::call_site())), in test_empty_group_vis()
107 TokenTree::Ident(Ident::new("S", Span::call_site())), in test_empty_group_vis()
108 TokenTree::Group(Group::new( in test_empty_group_vis()
111 TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())), in test_empty_group_vis()
112 TokenTree::Group(Group::new( in test_empty_group_vis()
114 TokenStream::from_iter(vec![TokenTree::Ident(Ident::new( in test_empty_group_vis()
119 TokenTree::Punct(Punct::new(':', Spacing::Alone)), in test_empty_group_vis()
120 TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())), in test_empty_group_vis()
Dtest_parse_buffer.rs3 use proc_macro2::{Delimiter, Group, Punct, Spacing, TokenStream, TokenTree};
73 TokenTree::Punct(Punct::new('+', Spacing::Alone)), in trailing_empty_none_group()
74 TokenTree::Group(Group::new( in trailing_empty_none_group()
77 TokenTree::Punct(Punct::new('+', Spacing::Alone)), in trailing_empty_none_group()
78 TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())), in trailing_empty_none_group()
81 TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())), in trailing_empty_none_group()
82 TokenTree::Group(Group::new( in trailing_empty_none_group()
84 TokenStream::from_iter(vec![TokenTree::Group(Group::new( in trailing_empty_none_group()
Dtest_stmt.rs10 use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};
61 let tokens = TokenStream::from_iter(vec![TokenTree::Group(Group::new( in test_none_group()
64 TokenTree::Ident(Ident::new("async", Span::call_site())), in test_none_group()
65 TokenTree::Ident(Ident::new("fn", Span::call_site())), in test_none_group()
66 TokenTree::Ident(Ident::new("f", Span::call_site())), in test_none_group()
67 TokenTree::Group(Group::new(Delimiter::Parenthesis, TokenStream::new())), in test_none_group()
68 TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())), in test_none_group()
Dtest_path.rs6 use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};
14 TokenTree::Group(Group::new(Delimiter::None, quote! { first })), in parse_interpolated_leading_component()
15 TokenTree::Punct(Punct::new(':', Spacing::Joint)), in parse_interpolated_leading_component()
16 TokenTree::Punct(Punct::new(':', Spacing::Alone)), in parse_interpolated_leading_component()
17 TokenTree::Ident(Ident::new("rest", Span::call_site())), in parse_interpolated_leading_component()
Dtest_lit.rs11 use proc_macro2::{Delimiter, Group, Literal, Span, TokenStream, TokenTree};
19 TokenTree::Literal(lit) => { in lit()
255 let tokens = TokenStream::from_iter(vec![TokenTree::Group(Group::new( in test_deep_group_empty()
257 TokenStream::from_iter(vec![TokenTree::Group(Group::new( in test_deep_group_empty()
259 TokenStream::from_iter(vec![TokenTree::Literal(Literal::string("hi"))]), in test_deep_group_empty()
/third_party/rust/crates/proc-macro-error/proc-macro-error-attr/src/
Dparse.rs2 use proc_macro2::{Delimiter, Ident, Span, TokenStream, TokenTree};
8 ) -> Result<(Vec<Attribute>, Vec<TokenTree>, TokenTree)> { in parse_input() argument
28 input: &mut Peekable<impl Iterator<Item = TokenTree>>, in parse_next_attr()
31 Some(TokenTree::Punct(ref punct)) if punct.as_char() == '#' => input.next().unwrap(), in parse_next_attr()
36 Some(TokenTree::Group(ref group)) if group.delimiter() == Delimiter::Bracket => { in parse_next_attr()
48 Some(TokenTree::Ident(ident)) => Some(ident), in parse_next_attr()
54 group: TokenTree::Group(group), in parse_next_attr()
59 fn parse_signature(input: &mut Peekable<impl Iterator<Item = TokenTree>>) -> Vec<TokenTree> { in parse_signature()
63 Some(TokenTree::Group(ref group)) if group.delimiter() == Delimiter::Brace => { in parse_signature()
73 pub(crate) shebang: TokenTree,
[all …]
Dsettings.rs2 use proc_macro2::{Ident, Span, TokenStream, TokenTree};
41 Some(TokenTree::Ident(ident)) => { in parse_settings()
52 Some(TokenTree::Punct(ref punct)) if punct.as_char() == ',' => {} in parse_settings()
Dlib.rs9 use proc_macro2::{Literal, Span, TokenStream as TokenStream2, TokenTree};
87 fn gen_body(block: TokenTree, settings: Settings) -> proc_macro2::TokenStream { in gen_body() argument
103 fn gen_body(block: TokenTree, settings: Settings) -> proc_macro2::TokenStream { in gen_body() argument
/third_party/rust/crates/syn/src/
Dtt.rs1 use proc_macro2::{Delimiter, TokenStream, TokenTree};
4 pub(crate) struct TokenTreeHelper<'a>(pub &'a TokenTree);
11 (TokenTree::Group(g1), TokenTree::Group(g2)) => { in eq()
34 (TokenTree::Punct(o1), TokenTree::Punct(o2)) => { in eq()
41 (TokenTree::Literal(l1), TokenTree::Literal(l2)) => l1.to_string() == l2.to_string(), in eq()
42 (TokenTree::Ident(s1), TokenTree::Ident(s2)) => s1 == s2, in eq()
53 TokenTree::Group(g) => { in hash()
67 TokenTree::Punct(op) => { in hash()
75 TokenTree::Literal(lit) => (2u8, lit.to_string()).hash(h), in hash()
76 TokenTree::Ident(word) => (3u8, word).hash(h), in hash()
Derror.rs5 Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
284 TokenTree::Punct({ in to_compile_error()
289 TokenTree::Punct({ in to_compile_error()
294 TokenTree::Ident(Ident::new("core", start)), in to_compile_error()
295 TokenTree::Punct({ in to_compile_error()
300 TokenTree::Punct({ in to_compile_error()
305 TokenTree::Ident(Ident::new("compile_error", start)), in to_compile_error()
306 TokenTree::Punct({ in to_compile_error()
311 TokenTree::Group({ in to_compile_error()
313 TokenStream::from_iter(vec![TokenTree::Literal({ in to_compile_error()
Dbuffer.rs10 use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
40 TokenTree::Ident(ident) => entries.push(Entry::Ident(ident)), in recursive_new()
41 TokenTree::Punct(punct) => entries.push(Entry::Punct(punct)), in recursive_new()
42 TokenTree::Literal(literal) => entries.push(Entry::Literal(literal)), in recursive_new()
43 TokenTree::Group(group) => { in recursive_new()
297 pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> { in token_tree() argument
/third_party/rust/crates/proc-macro2/src/
Dlib.rs266 impl From<TokenTree> for TokenStream {
267 fn from(token: TokenTree) -> Self { in from()
272 impl Extend<TokenTree> for TokenStream {
273 fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) { in extend()
286 impl FromIterator<TokenTree> for TokenStream {
287 fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self { in from_iter()
548 pub enum TokenTree { enum
559 impl TokenTree { impl
564 TokenTree::Group(t) => t.span(), in span()
565 TokenTree::Ident(t) => t.span(), in span()
[all …]
Dfallback.rs5 use crate::{Delimiter, Spacing, TokenTree};
35 inner: RcVec<TokenTree>,
66 fn take_inner(self) -> RcVecBuilder<TokenTree> { in take_inner() argument
72 fn push_token_from_proc_macro(mut vec: RcVecMut<TokenTree>, token: TokenTree) { in push_token_from_proc_macro() argument
75 TokenTree::Literal(crate::Literal { in push_token_from_proc_macro()
88 fn push_negative_literal(mut vec: RcVecMut<TokenTree>, mut literal: Literal) { in push_token_from_proc_macro() argument
92 vec.push(TokenTree::Punct(punct)); in push_token_from_proc_macro()
93 vec.push(TokenTree::Literal(crate::Literal::_new_fallback(literal))); in push_token_from_proc_macro()
106 TokenTree::Group(group) => group.inner, in drop()
120 inner: RcVecBuilder<TokenTree>,
[all …]
Dwrapper.rs4 use crate::{fallback, Delimiter, Punct, Spacing, TokenTree};
25 extra: Vec<proc_macro::TokenTree>,
159 fn into_compiler_token(token: TokenTree) -> proc_macro::TokenTree { in into_compiler_token() argument
161 TokenTree::Group(tt) => tt.inner.unwrap_nightly().into(), in into_compiler_token()
162 TokenTree::Punct(tt) => { in into_compiler_token()
171 TokenTree::Ident(tt) => tt.inner.unwrap_nightly().into(), in into_compiler_token()
172 TokenTree::Literal(tt) => tt.inner.unwrap_nightly().into(), in into_compiler_token()
176 impl From<TokenTree> for TokenStream {
177 fn from(token: TokenTree) -> Self { in from()
186 impl FromIterator<TokenTree> for TokenStream {
[all …]
Dparse.rs5 use crate::{Delimiter, Punct, Spacing, TokenTree};
235 trees.push_token_from_parser(TokenTree::Group(crate::Group::_new_fallback(g))); in token_stream()
266 fn leaf_token(input: Cursor) -> PResult<TokenTree> { in leaf_token() argument
269 Ok((input, TokenTree::Literal(crate::Literal::_new_fallback(l)))) in leaf_token()
271 Ok((input, TokenTree::Punct(p))) in leaf_token()
273 Ok((input, TokenTree::Ident(i))) in leaf_token()
277 Ok((rest, TokenTree::Literal(repr))) in leaf_token()
936 trees.push_token_from_parser(TokenTree::Punct(pound)); in doc_comment()
941 trees.push_token_from_parser(TokenTree::Punct(bang)); in doc_comment()
950 bracketed.push_token_from_parser(TokenTree::Ident(doc_ident)); in doc_comment()
[all …]
/third_party/rust/crates/proc-macro2/tests/
Dcomments.rs3 use proc_macro2::{Delimiter, Literal, Spacing, TokenStream, TokenTree};
18 TokenTree::Punct(punct) => { in lit_of_doc_comment()
26 TokenTree::Punct(punct) => { in lit_of_doc_comment()
34 TokenTree::Group(group) => { in lit_of_doc_comment()
42 TokenTree::Ident(ident) => assert_eq!(ident.to_string(), "doc"), in lit_of_doc_comment()
46 TokenTree::Punct(punct) => { in lit_of_doc_comment()
53 TokenTree::Literal(literal) => { in lit_of_doc_comment()
Dtest.rs8 use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
171 TokenTree::Literal(literal) => { in literal_c_string()
265 let tokens = TokenStream::from(TokenTree::Literal(negative_literal)); in literal_iter_negative()
268 TokenTree::Punct(punct) => { in literal_iter_negative()
275 TokenTree::Literal(literal) => { in literal_iter_negative()
495 TokenTree::Punct(tt) => { in punct_before_comment()
511 let stream = TokenStream::from(TokenTree::Punct(joint_punct)); in joint_last_token()
513 TokenTree::Punct(punct) => punct, in joint_last_token()
523 TokenTree::Ident(raw) => assert_eq!("r#dyn", raw.to_string()), in raw_identifier()
729 if let TokenTree::Group(g) = i { in check_spans_internal()
[all …]
Dmarker.rs4 Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
54 assert_impl!(TokenTree is not Send or Sync);
67 Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
91 TokenTree
/third_party/rust/crates/serde/serde_derive/src/internals/
Drespan.rs1 use proc_macro2::{Group, Span, TokenStream, TokenTree};
10 fn respan_token(mut token: TokenTree, span: Span) -> TokenTree { in respan_token() argument
11 if let TokenTree::Group(g) = &mut token { in respan_token()
/third_party/rust/crates/quote/src/
Druntime.rs6 use proc_macro2::{Group, Ident, Punct, Spacing, TokenTree};
271 fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree { in respan_token_tree() argument
273 TokenTree::Group(g) => { in respan_token_tree()
306 type Item = TokenTree; in push_lifetime()
312 Some(TokenTree::Punct(Punct::new('\'', Spacing::Joint))) in push_lifetime()
316 Some(TokenTree::Ident(Ident::new(self.name, Span::call_site()))) in push_lifetime()
338 type Item = TokenTree; in push_lifetime_spanned()
346 Some(TokenTree::Punct(apostrophe)) in push_lifetime_spanned()
350 Some(TokenTree::Ident(Ident::new(self.name, self.span))) in push_lifetime_spanned()
Dext.rs3 use proc_macro2::{TokenStream, TokenTree};
14 U: Into<TokenTree>; in append() argument
62 U: Into<TokenTree>, in append() argument
/third_party/rust/crates/proc-macro-error/src/
Ddiagnostic.rs293 use proc_macro2::{Delimiter, TokenTree}; in from()
295 fn gut_error(ts: &mut impl Iterator<Item = TokenTree>) -> Option<(SpanRange, String)> { in from()
304 TokenTree::Group(group) => { in from()
321 TokenTree::Literal(lit) => lit, in from()

12