Home
last modified time | relevance | path

Searched refs:TokenStream (Results 1 – 25 of 167) sorted by relevance

1234567

/third_party/rust/crates/proc-macro-error/test-crate/
Dlib.rs5 use proc_macro2::{Span, TokenStream};
17 pub fn abort_from(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in abort_from() argument
27 pub fn abort_to_string(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in abort_to_string() argument
34 pub fn abort_format(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in abort_format() argument
41 pub fn abort_call_site_test(_: proc_macro::TokenStream) -> proc_macro::TokenStream { in abort_call_site_test() argument
47 pub fn direct_abort(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in direct_abort() argument
54 pub fn emit(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in emit() argument
86 pub fn abort_notes(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in abort_notes() argument
116 pub fn emit_notes(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in emit_notes() argument
148 pub fn option_ext(_input: proc_macro::TokenStream) -> proc_macro::TokenStream { in option_ext() argument
[all …]
/third_party/rust/crates/quote/src/
Dto_tokens.rs5 use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
53 fn to_tokens(&self, tokens: &mut TokenStream); in to_tokens() argument
59 fn to_token_stream(&self) -> TokenStream { in to_token_stream() argument
60 let mut tokens = TokenStream::new(); in to_token_stream()
69 fn into_token_stream(self) -> TokenStream in into_token_stream()
78 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
84 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
90 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
96 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
102 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
[all …]
Druntime.rs18 pub type TokenStream = proc_macro2::TokenStream; typedef
179 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
242 pub fn push_group(tokens: &mut TokenStream, delimiter: Delimiter, inner: TokenStream) { in push_group() argument
248 tokens: &mut TokenStream, in push_group_spanned() argument
251 inner: TokenStream, in push_group_spanned() argument
259 pub fn parse(tokens: &mut TokenStream, s: &str) { in parse() argument
260 let s: TokenStream = s.parse().expect("invalid token stream"); in parse()
265 pub fn parse_spanned(tokens: &mut TokenStream, span: Span, s: &str) { in parse_spanned() argument
266 let s: TokenStream = s.parse().expect("invalid token stream"); in parse_spanned()
288 pub fn push_ident(tokens: &mut TokenStream, s: &str) { in push_ident() argument
[all …]
/third_party/rust/crates/bindgen/bindgen/codegen/
Dhelpers.rs5 use proc_macro2::{Ident, Span, TokenStream};
9 use proc_macro2::{Ident, Span, TokenStream};
12 pub fn repr(which: &str) -> TokenStream { in repr() argument
19 pub fn repr_list(which_ones: &[&str]) -> TokenStream { in repr_list() argument
23 .map(|one| TokenStream::from_str(one).expect("repr to be valid")); in repr_list()
29 pub fn derives(which_ones: &[&str]) -> TokenStream { in derives() argument
33 .map(|one| TokenStream::from_str(one).expect("derive to be valid")); in derives()
39 pub fn inline() -> TokenStream { in inline()
45 pub fn must_use() -> TokenStream { in must_use()
51 pub fn non_exhaustive() -> TokenStream { in non_exhaustive()
[all …]
Ddyngen.rs17 struct_members: Vec<proc_macro2::TokenStream>,
29 struct_implementation: Vec<proc_macro2::TokenStream>,
48 constructor_inits: Vec<proc_macro2::TokenStream>,
68 init_fields: Vec<proc_macro2::TokenStream>,
80 ) -> proc_macro2::TokenStream { in get_tokens() argument
133 args: Vec<proc_macro2::TokenStream>, in push() argument
134 args_identifiers: Vec<proc_macro2::TokenStream>, in push() argument
135 ret: proc_macro2::TokenStream, in push() argument
136 ret_ty: proc_macro2::TokenStream, in push() argument
137 attributes: Vec<proc_macro2::TokenStream>, in push() argument
/third_party/rust/crates/proc-macro2/src/
Dwrapper.rs13 pub(crate) enum TokenStream { enum
15 Fallback(fallback::TokenStream),
24 stream: proc_macro::TokenStream,
51 fn new(stream: proc_macro::TokenStream) -> Self { in new()
71 fn into_token_stream(mut self) -> proc_macro::TokenStream { in into_token_stream() argument
77 impl TokenStream { implementation
80 TokenStream::Compiler(DeferredTokenStream::new(proc_macro::TokenStream::new())) in new()
82 TokenStream::Fallback(fallback::TokenStream::new()) in new()
88 TokenStream::Compiler(tts) => tts.is_empty(), in is_empty()
89 TokenStream::Fallback(tts) => tts.is_empty(), in is_empty()
[all …]
Dlib.rs185 pub struct TokenStream { struct
186 inner: imp::TokenStream, argument
196 impl TokenStream { implementation
197 fn _new(inner: imp::TokenStream) -> Self { in _new()
198 TokenStream { in _new()
204 fn _new_fallback(inner: fallback::TokenStream) -> Self { in _new_fallback()
205 TokenStream { in _new_fallback()
213 TokenStream::_new(imp::TokenStream::new()) in new()
224 impl Default for TokenStream { implementation
226 TokenStream::new() in default()
[all …]
Dfallback.rs34 pub(crate) struct TokenStream { struct
55 impl TokenStream { implementation
57 TokenStream { in new()
98 impl Drop for TokenStream { implementation
140 pub fn build(self) -> TokenStream { in build() argument
141 TokenStream { in build()
169 impl FromStr for TokenStream { implementation
172 fn from_str(src: &str) -> Result<TokenStream, LexError> { in from_str() argument
192 impl Display for TokenStream { implementation
215 impl Debug for TokenStream { implementation
[all …]
/third_party/rust/crates/proc-macro2/tests/
Dcomments.rs3 use proc_macro2::{Delimiter, Literal, Spacing, TokenStream, TokenTree};
6 fn lit_of_outer_doc_comment(tokens: &TokenStream) -> Literal { in lit_of_outer_doc_comment()
11 fn lit_of_inner_doc_comment(tokens: &TokenStream) -> Literal { in lit_of_inner_doc_comment()
15 fn lit_of_doc_comment(tokens: &TokenStream, inner: bool) -> Literal { in lit_of_doc_comment() argument
63 let stream = "/**/".parse::<TokenStream>().unwrap(); in closed_immediately()
70 assert!("/*/".parse::<TokenStream>().is_err()); in incomplete()
75 let stream = "/// doc".parse::<TokenStream>().unwrap(); in lit()
79 let stream = "//! doc".parse::<TokenStream>().unwrap(); in lit()
83 let stream = "/** doc */".parse::<TokenStream>().unwrap(); in lit()
87 let stream = "/*! doc */".parse::<TokenStream>().unwrap(); in lit()
[all …]
Dtest.rs8 use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
107 "\"\\\r\n x\"".parse::<TokenStream>().unwrap(); in literal_string()
108 "\"\\\r\n \rx\"".parse::<TokenStream>().unwrap_err(); in literal_string()
113 "r\"\r\n\"".parse::<TokenStream>().unwrap(); in literal_raw_string()
126 .parse::<TokenStream>() in literal_raw_string()
131 .parse::<TokenStream>() in literal_raw_string()
147 "b\"\\\r\n x\"".parse::<TokenStream>().unwrap(); in literal_byte_string()
148 "b\"\\\r\n \rx\"".parse::<TokenStream>().unwrap_err(); in literal_byte_string()
149 "b\"\\\r\n \u{a0}x\"".parse::<TokenStream>().unwrap_err(); in literal_byte_string()
150 "br\"\u{a0}\"".parse::<TokenStream>().unwrap_err(); in literal_byte_string()
[all …]
Dtest_fmt.rs3 use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};
9 let inner = TokenStream::from_iter(iter::once(TokenTree::Ident(ident))); in test_fmt_group()
10 let parens_empty = Group::new(Delimiter::Parenthesis, TokenStream::new()); in test_fmt_group()
12 let brackets_empty = Group::new(Delimiter::Bracket, TokenStream::new()); in test_fmt_group()
14 let braces_empty = Group::new(Delimiter::Brace, TokenStream::new()); in test_fmt_group()
16 let none_empty = Group::new(Delimiter::None, TokenStream::new()); in test_fmt_group()
/third_party/rust/crates/clap/clap_derive/src/
Dlib.rs21 use proc_macro::TokenStream;
36 pub fn value_enum(input: TokenStream) -> TokenStream { in value_enum() argument
53 pub fn parser(input: TokenStream) -> TokenStream { in parser() argument
85 pub fn subcommand(input: TokenStream) -> TokenStream { in subcommand() argument
97 pub fn args(input: TokenStream) -> TokenStream { in args() argument
109 dummy: proc_macro2::TokenStream, in to_compile_error() argument
110 ) -> proc_macro2::TokenStream { in to_compile_error() argument
/third_party/rust/crates/cxx/syntax/
Dtokens.rs6 use proc_macro2::{Ident, Span, TokenStream};
11 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
43 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
60 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
88 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
113 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
129 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
148 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
165 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
171 fn to_tokens(&self, tokens: &mut TokenStream) { in to_tokens() argument
[all …]
/third_party/rust/crates/syn/codegen/src/
Doperand.rs1 use proc_macro2::TokenStream;
5 Borrowed(TokenStream),
6 Owned(TokenStream),
12 pub fn tokens(&self) -> &TokenStream { in tokens() argument
18 pub fn ref_tokens(&self) -> TokenStream { in ref_tokens() argument
25 pub fn ref_mut_tokens(&self) -> TokenStream { in ref_mut_tokens() argument
32 pub fn owned_tokens(&self) -> TokenStream { in owned_tokens() argument
Dgen.rs3 use proc_macro2::{Ident, Span, TokenStream};
14 node: fn(&mut TokenStream, &mut TokenStream, &Node, &Definitions), in traverse() argument
15 ) -> (TokenStream, TokenStream) { in traverse() argument
27 let mut traits = TokenStream::new(); in traverse()
28 let mut impls = TokenStream::new(); in traverse()
Dfold.rs3 use proc_macro2::{Ident, Span, TokenStream};
10 fn simple_visit(item: &str, name: &TokenStream) -> TokenStream { in simple_visit() argument
22 name: &TokenStream, in visit() argument
23 ) -> Option<TokenStream> { in visit() argument
53 let mut code = TokenStream::new(); in visit()
81 fn node(traits: &mut TokenStream, impls: &mut TokenStream, s: &Node, defs: &Definitions) { in node() argument
86 let mut fold_impl = TokenStream::new(); in node()
90 let mut fold_variants = TokenStream::new(); in node()
102 let mut bind_fold_fields = TokenStream::new(); in node()
103 let mut fold_fields = TokenStream::new(); in node()
[all …]
Dvisit.rs4 use proc_macro2::{Ident, Span, TokenStream};
11 fn simple_visit(item: &str, name: &Operand) -> TokenStream { in simple_visit() argument
20 fn noop_visit(name: &Operand) -> TokenStream { in noop_visit() argument
32 ) -> Option<TokenStream> { in visit() argument
70 let mut code = TokenStream::new(); in visit()
97 fn node(traits: &mut TokenStream, impls: &mut TokenStream, s: &Node, defs: &Definitions) { in node() argument
102 let mut visit_impl = TokenStream::new(); in node()
111 let mut visit_variants = TokenStream::new(); in node()
121 let mut bind_visit_fields = TokenStream::new(); in node()
122 let mut visit_fields = TokenStream::new(); in node()
Dvisit_mut.rs4 use proc_macro2::{Ident, Span, TokenStream};
11 fn simple_visit(item: &str, name: &Operand) -> TokenStream { in simple_visit() argument
20 fn noop_visit(name: &Operand) -> TokenStream { in noop_visit() argument
32 ) -> Option<TokenStream> { in visit() argument
70 let mut code = TokenStream::new(); in visit()
97 fn node(traits: &mut TokenStream, impls: &mut TokenStream, s: &Node, defs: &Definitions) { in node() argument
102 let mut visit_mut_impl = TokenStream::new(); in node()
111 let mut visit_mut_variants = TokenStream::new(); in node()
121 let mut bind_visit_mut_fields = TokenStream::new(); in node()
122 let mut visit_mut_fields = TokenStream::new(); in node()
/third_party/rust/crates/serde/serde_derive/src/
Dfragment.rs1 use proc_macro2::TokenStream;
7 Expr(TokenStream),
10 Block(TokenStream),
29 fn to_tokens(&self, out: &mut TokenStream) { in to_tokens() argument
42 fn to_tokens(&self, out: &mut TokenStream) { in to_tokens() argument
54 fn to_tokens(&self, out: &mut TokenStream) { in to_tokens() argument
67 impl AsRef<TokenStream> for Fragment {
68 fn as_ref(&self) -> &TokenStream { in as_ref() argument
/third_party/rust/crates/clap/clap_derive/src/derives/
Dvalue_enum.rs11 use proc_macro2::TokenStream;
18 pub fn derive_value_enum(input: &DeriveInput) -> Result<TokenStream, syn::Error> { in derive_value_enum() argument
41 ) -> Result<TokenStream, syn::Error> { in gen_for_enum() argument
74 fn lits(variants: &[(&Variant, Item)]) -> Result<Vec<(TokenStream, Ident)>, syn::Error> { in lits() argument
98 fn gen_value_variants(lits: &[(TokenStream, Ident)]) -> TokenStream { in gen_value_variants() argument
108 fn gen_to_possible_value(item: &Item, lits: &[(TokenStream, Ident)]) -> TokenStream { in gen_to_possible_value() argument
109 let (lit, variant): (Vec<TokenStream>, Vec<Ident>) = lits.iter().cloned().unzip(); in gen_to_possible_value()
/third_party/rust/crates/cxx/macro/src/
Dderive.rs2 use proc_macro2::{Ident, Span, TokenStream};
7 pub fn expand_struct(strct: &Struct, actual_derives: &mut Option<TokenStream>) -> TokenStream { in expand_struct() argument
8 let mut expanded = TokenStream::new(); in expand_struct()
38 pub fn expand_enum(enm: &Enum, actual_derives: &mut Option<TokenStream>) -> TokenStream { in expand_enum() argument
39 let mut expanded = TokenStream::new(); in expand_enum()
97 fn struct_copy(strct: &Struct, span: Span) -> TokenStream { in struct_copy() argument
106 fn struct_clone(strct: &Struct, span: Span) -> TokenStream { in struct_clone() argument
135 fn struct_debug(strct: &Struct, span: Span) -> TokenStream { in struct_debug() argument
153 fn struct_default(strct: &Struct, span: Span) -> TokenStream { in struct_default() argument
172 fn struct_ord(strct: &Struct, span: Span) -> TokenStream { in struct_ord() argument
[all …]
/third_party/rust/crates/proc-macro-error/src/
Ddummy.rs116 use proc_macro2::TokenStream;
122 static DUMMY_IMPL: RefCell<Option<TokenStream>> = RefCell::new(None);
129 pub fn set_dummy(dummy: TokenStream) -> Option<TokenStream> { in set_dummy() argument
136 pub fn append_dummy(dummy: TokenStream) { in append_dummy() argument
148 pub(crate) fn cleanup() -> Option<TokenStream> { in cleanup()
/third_party/rust/crates/syn/tests/
Dtest_visibility.rs6 use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};
13 rest: TokenStream,
31 let expected = $rest.parse::<TokenStream>().unwrap();
105 let tokens = TokenStream::from_iter(vec![ in test_empty_group_vis()
110 TokenStream::from_iter(vec![ in test_empty_group_vis()
111 TokenTree::Group(Group::new(Delimiter::None, TokenStream::new())), in test_empty_group_vis()
114 TokenStream::from_iter(vec![TokenTree::Ident(Ident::new( 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};
72 let tokens = TokenStream::from_iter(vec![ in trailing_empty_none_group()
76 TokenStream::from_iter(vec![ 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()
84 TokenStream::from_iter(vec![TokenTree::Group(Group::new( in trailing_empty_none_group()
86 TokenStream::new(), in trailing_empty_none_group()
/third_party/rust/crates/proc-macro-error/proc-macro-error-attr/src/
Dlib.rs8 use proc_macro::TokenStream;
9 use proc_macro2::{Literal, Span, TokenStream as TokenStream2, TokenTree};
37 pub fn proc_macro_error(attr: TokenStream, input: TokenStream) -> TokenStream { in proc_macro_error() argument
49 fn impl_proc_macro_error(attr: TokenStream2, input: TokenStream2) -> Result<TokenStream> { in impl_proc_macro_error() argument
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

1234567