1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
b0VIM 7.4 ��U�]~ erickt Erick-Tryzelaar-MBP.local ~erickt/projects/rust/rust-syntex/syntex_syntax/src/ext/expand.rs utf-8
3210 #"! U tp b V g d � Z ! ` { Z � Q 9 b � J � k ; O � g �
a \ ] � d
] � x � e X i � K & d q S � R ( * z ad � 9 b � { X U � � M ) ( �
�
�
g
S
J
;
� � � x T J = 2 � � � � � � � � I �
�
�
^
� � � � J ( � � � � N � � R Q 5 & � � \ V U 9 � � � y W
� z V < � � � � � l - � � � � o S D : 9 4 , � � � } } }) span: span, } }) span: span, node: e.node, id: ast::DUMMY_NODE_ID, fully_expanded.map(|e| ast::Expr { fld.cx.bt_pop(); let span = fld.new_span(span); let fully_expanded = fld.fold_expr(expanded_expr); // Keep going, outside-in. }; } return e; // return DummyResult::raw_expr(span); // Ignore unknown macros. None => { Some(expr) => expr, mark_expr, fld) { |r| r.make_expr(), let expanded_expr = match expand_mac_invoc(mac.clone(), span, ast::ExprMac(mac, _) => { // entry-point for all syntax extensions. // expr_mac should really be expr_ext or something; it's the return e.clone().and_then(|ast::Expr {id, node, span}| match node { let expr_span = e.span; } Span { expn_id: fld.cx.backtrace(), ..span } fn allow_unstable(fld: &mut MacroExpander, span: Span) -> Span { // Sets the expn_id so that we can use unstable methods. } }); }, span: None, allow_internal_unstable: true, // an appropriate span from `fld.cx.backtrace()`. // from stability lints; must also tag such code with // `push_compiler_expansion` is automatically exempt // This does *not* mean code generated after format: CompilerExpansion, name: expansion_desc.to_string(), callee: NameAndSpan { call_site: span, fld.cx.bt_push(ExpnInfo { fn push_compiler_expansion(fld: &mut MacroExpander, span: Span, expansion_desc: &str) { pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> { } fld.cx.path_global(span, idents) for s in suffix.iter() { idents.push(fld.cx.ident_of(*s)); } let mut idents = vec![fld.cx.ident_of_std("core")]; suffix: &[&'static str]) -> ast::Path { span: Span, fn mk_core_path(fld: &mut MacroExpander, // `fld.cx.use_std`, and `::core::b::c::d` otherwise. // Given suffix ["b","c","d"], returns path `::std::b::c::d` when use std_inject; use visit::Visitor; use visit; use util::small_vector::SmallVector; use ptr::P; use parse::token; use parse::token::{fresh_mark, fresh_name, intern}; use parse; use fold::*; use fold; use feature_gate::{self, Features}; use ext::base::*; use codemap::{Span, Spanned, ExpnInfo, NameAndSpan, MacroBang, MacroAttribute, CompilerExpansion}; use codemap; use attr::AttrMetaMethods; use attr; use ext::build::AstBuilder; use ext::mtwt; use ast; use ast::TokenTree; use ast::{StmtExpr, StmtSemi}; use ast::{ItemMac, MacStmtWithSemicolon, Mrk, Stmt, StmtDecl, StmtMac}; use ast::{Local, Ident, MacInvocTT}; use ast::{Block, Crate, DeclLocal, ExprMac, PatMac}; // except according to those terms. // option. This file may not be copied, modified, or distributed // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or //