@@ -26,7 +26,7 @@ pub struct Field {
26
26
27
27
pub fn mk_expr ( cx : ext_ctxt ,
28
28
sp : codemap:: span ,
29
- expr : ast:: expr_ )
29
+ + expr : ast:: expr_ )
30
30
-> @ast:: expr {
31
31
@ast:: expr {
32
32
id : cx. next_id ( ) ,
@@ -62,7 +62,7 @@ pub fn mk_unary(cx: ext_ctxt, sp: span, op: ast::unop, e: @ast::expr)
62
62
cx. next_id ( ) ; // see ast_util::op_expr_callee_id
63
63
mk_expr ( cx, sp, ast:: expr_unary ( op, e) )
64
64
}
65
- pub fn mk_raw_path ( sp : span , idents : ~[ ast:: ident ] ) -> @ast:: path {
65
+ pub fn mk_raw_path ( sp : span , + idents : ~[ ast:: ident ] ) -> @ast:: path {
66
66
let p = @ast:: path { span : sp,
67
67
global : false ,
68
68
idents : idents,
@@ -71,7 +71,7 @@ pub fn mk_raw_path(sp: span, idents: ~[ast::ident]) -> @ast::path {
71
71
return p;
72
72
}
73
73
pub fn mk_raw_path_ ( sp : span ,
74
- idents : ~[ ast:: ident ] ,
74
+ + idents : ~[ ast:: ident ] ,
75
75
+types : ~[ @ast:: Ty ] )
76
76
-> @ast:: path {
77
77
@ast:: path { span : sp,
@@ -80,25 +80,25 @@ pub fn mk_raw_path_(sp: span,
80
80
rp : None ,
81
81
types : types }
82
82
}
83
- pub fn mk_raw_path_global ( sp : span , idents : ~[ ast:: ident ] ) -> @ast:: path {
83
+ pub fn mk_raw_path_global ( sp : span , + idents : ~[ ast:: ident ] ) -> @ast:: path {
84
84
@ast:: path { span : sp,
85
85
global : true ,
86
86
idents : idents,
87
87
rp : None ,
88
88
types : ~[ ] }
89
89
}
90
- pub fn mk_path ( cx : ext_ctxt , sp : span , idents : ~[ ast:: ident ] ) -> @ast:: expr {
90
+ pub fn mk_path ( cx : ext_ctxt , sp : span , + idents : ~[ ast:: ident ] ) -> @ast:: expr {
91
91
mk_expr ( cx, sp, ast:: expr_path ( mk_raw_path ( sp, idents) ) )
92
92
}
93
- pub fn mk_path_global ( cx : ext_ctxt , sp : span , idents : ~[ ast:: ident ] )
93
+ pub fn mk_path_global ( cx : ext_ctxt , sp : span , + idents : ~[ ast:: ident ] )
94
94
-> @ast:: expr {
95
95
mk_expr ( cx, sp, ast:: expr_path ( mk_raw_path_global ( sp, idents) ) )
96
96
}
97
97
pub fn mk_access_ ( cx : ext_ctxt , sp : span , p : @ast:: expr , m : ast:: ident )
98
98
-> @ast:: expr {
99
99
mk_expr ( cx, sp, ast:: expr_field ( p, m, ~[ ] ) )
100
100
}
101
- pub fn mk_access ( cx : ext_ctxt , sp : span , p : ~[ ast:: ident ] , m : ast:: ident )
101
+ pub fn mk_access ( cx : ext_ctxt , sp : span , + p : ~[ ast:: ident ] , m : ast:: ident )
102
102
-> @ast:: expr {
103
103
let pathexpr = mk_path ( cx, sp, p) ;
104
104
return mk_access_ ( cx, sp, pathexpr, m) ;
@@ -107,21 +107,21 @@ pub fn mk_addr_of(cx: ext_ctxt, sp: span, e: @ast::expr) -> @ast::expr {
107
107
return mk_expr ( cx, sp, ast:: expr_addr_of ( ast:: m_imm, e) ) ;
108
108
}
109
109
pub fn mk_call_ ( cx : ext_ctxt , sp : span , fn_expr : @ast:: expr ,
110
- args : ~[ @ast:: expr ] ) -> @ast:: expr {
110
+ + args : ~[ @ast:: expr ] ) -> @ast:: expr {
111
111
mk_expr ( cx, sp, ast:: expr_call ( fn_expr, args, ast:: NoSugar ) )
112
112
}
113
- pub fn mk_call ( cx : ext_ctxt , sp : span , fn_path : ~[ ast:: ident ] ,
114
- args : ~[ @ast:: expr ] ) -> @ast:: expr {
113
+ pub fn mk_call ( cx : ext_ctxt , sp : span , + fn_path : ~[ ast:: ident ] ,
114
+ + args : ~[ @ast:: expr ] ) -> @ast:: expr {
115
115
let pathexpr = mk_path ( cx, sp, fn_path) ;
116
116
return mk_call_ ( cx, sp, pathexpr, args) ;
117
117
}
118
- pub fn mk_call_global ( cx : ext_ctxt , sp : span , fn_path : ~[ ast:: ident ] ,
119
- args : ~[ @ast:: expr ] ) -> @ast:: expr {
118
+ pub fn mk_call_global ( cx : ext_ctxt , sp : span , + fn_path : ~[ ast:: ident ] ,
119
+ + args : ~[ @ast:: expr ] ) -> @ast:: expr {
120
120
let pathexpr = mk_path_global ( cx, sp, fn_path) ;
121
121
return mk_call_ ( cx, sp, pathexpr, args) ;
122
122
}
123
123
// e = expr, t = type
124
- pub fn mk_base_vec_e ( cx : ext_ctxt , sp : span , exprs : ~[ @ast:: expr ] )
124
+ pub fn mk_base_vec_e ( cx : ext_ctxt , sp : span , + exprs : ~[ @ast:: expr ] )
125
125
-> @ast:: expr {
126
126
let vecexpr = ast:: expr_vec ( exprs, ast:: m_imm) ;
127
127
mk_expr ( cx, sp, vecexpr)
@@ -131,25 +131,25 @@ pub fn mk_vstore_e(cx: ext_ctxt, sp: span, expr: @ast::expr,
131
131
@ast:: expr {
132
132
mk_expr ( cx, sp, ast:: expr_vstore ( expr, vst) )
133
133
}
134
- pub fn mk_uniq_vec_e ( cx : ext_ctxt , sp : span , exprs : ~[ @ast:: expr ] )
134
+ pub fn mk_uniq_vec_e ( cx : ext_ctxt , sp : span , + exprs : ~[ @ast:: expr ] )
135
135
-> @ast:: expr {
136
136
mk_vstore_e ( cx, sp, mk_base_vec_e ( cx, sp, exprs) , ast:: expr_vstore_uniq)
137
137
}
138
- pub fn mk_slice_vec_e ( cx : ext_ctxt , sp : span , exprs : ~[ @ast:: expr ] )
138
+ pub fn mk_slice_vec_e ( cx : ext_ctxt , sp : span , + exprs : ~[ @ast:: expr ] )
139
139
-> @ast:: expr {
140
140
mk_vstore_e ( cx, sp, mk_base_vec_e ( cx, sp, exprs) ,
141
141
ast:: expr_vstore_slice)
142
142
}
143
- pub fn mk_fixed_vec_e ( cx : ext_ctxt , sp : span , exprs : ~[ @ast:: expr ] )
143
+ pub fn mk_fixed_vec_e ( cx : ext_ctxt , sp : span , + exprs : ~[ @ast:: expr ] )
144
144
-> @ast:: expr {
145
145
mk_vstore_e ( cx, sp, mk_base_vec_e ( cx, sp, exprs) ,
146
146
ast:: expr_vstore_fixed ( None ) )
147
147
}
148
- pub fn mk_base_str ( cx : ext_ctxt , sp : span , s : ~str ) -> @ast:: expr {
148
+ pub fn mk_base_str ( cx : ext_ctxt , sp : span , + s : ~str ) -> @ast:: expr {
149
149
let lit = ast:: lit_str ( @s) ;
150
150
return mk_lit ( cx, sp, lit) ;
151
151
}
152
- pub fn mk_uniq_str ( cx : ext_ctxt , sp : span , s : ~str ) -> @ast:: expr {
152
+ pub fn mk_uniq_str ( cx : ext_ctxt , sp : span , + s : ~str ) -> @ast:: expr {
153
153
mk_vstore_e ( cx, sp, mk_base_str ( cx, sp, s) , ast:: expr_vstore_uniq)
154
154
}
155
155
pub fn mk_field ( sp : span , f : & Field ) -> ast:: field {
@@ -161,28 +161,36 @@ pub fn mk_field(sp: span, f: &Field) -> ast::field {
161
161
pub fn mk_fields ( sp : span , fields : ~[ Field ] ) -> ~[ ast:: field ] {
162
162
fields. map ( |f| mk_field ( sp, f) )
163
163
}
164
- pub fn mk_rec_e ( cx : ext_ctxt , sp : span , fields : ~[ Field ] ) -> @ast:: expr {
164
+ pub fn mk_rec_e ( cx : ext_ctxt ,
165
+ sp : span ,
166
+ +fields : ~[ Field ] )
167
+ -> @ast:: expr {
165
168
mk_expr ( cx, sp, ast:: expr_rec ( mk_fields ( sp, fields) ,
166
169
option:: None :: < @ast:: expr > ) )
167
170
}
168
- pub fn mk_struct_e ( cx : ext_ctxt , sp : span , ctor_path : ~[ ast:: ident ] ,
169
- fields : ~[ Field ] ) -> @ast:: expr {
171
+ pub fn mk_struct_e ( cx : ext_ctxt ,
172
+ sp : span ,
173
+ +ctor_path : ~[ ast:: ident ] ,
174
+ +fields : ~[ Field ] )
175
+ -> @ast:: expr {
170
176
mk_expr ( cx, sp,
171
177
ast:: expr_struct ( mk_raw_path ( sp, ctor_path) ,
172
178
mk_fields ( sp, fields) ,
173
179
option:: None :: < @ast:: expr > ) )
174
180
}
175
- pub fn mk_global_struct_e ( cx : ext_ctxt , sp : span ,
176
- ctor_path : ~[ ast:: ident ] ,
177
- fields : ~[ Field ] )
181
+ pub fn mk_global_struct_e ( cx : ext_ctxt ,
182
+ sp : span ,
183
+ +ctor_path : ~[ ast:: ident ] ,
184
+ +fields : ~[ Field ] )
178
185
-> @ast:: expr {
179
186
mk_expr ( cx, sp,
180
187
ast:: expr_struct ( mk_raw_path_global ( sp, ctor_path) ,
181
188
mk_fields ( sp, fields) ,
182
189
option:: None :: < @ast:: expr > ) )
183
190
}
184
- pub fn mk_glob_use ( cx : ext_ctxt , sp : span , path : ~[ ast:: ident ] )
185
- -> @ast:: view_item {
191
+ pub fn mk_glob_use ( cx : ext_ctxt ,
192
+ sp : span ,
193
+ +path : ~[ ast:: ident ] ) -> @ast:: view_item {
186
194
let glob = @codemap:: spanned {
187
195
node : ast:: view_path_glob ( mk_raw_path ( sp, path) , cx. next_id ( ) ) ,
188
196
span : sp,
@@ -218,8 +226,8 @@ pub fn mk_local(cx: ext_ctxt, sp: span, mutbl: bool,
218
226
@codemap:: spanned { node : ast:: stmt_decl ( @decl, cx. next_id ( ) ) , span : sp }
219
227
}
220
228
pub fn mk_block ( cx : ext_ctxt , span : span ,
221
- view_items : ~[ @ast:: view_item ] ,
222
- stmts : ~[ @ast:: stmt ] ,
229
+ + view_items : ~[ @ast:: view_item ] ,
230
+ + stmts : ~[ @ast:: stmt ] ,
223
231
expr : Option < @ast:: expr > ) -> @ast:: expr {
224
232
let blk = codemap:: spanned {
225
233
node : ast:: blk_ {
@@ -313,7 +321,7 @@ pub fn mk_stmt(cx: ext_ctxt, span: span, expr: @ast::expr) -> @ast::stmt {
313
321
}
314
322
pub fn mk_ty_path ( cx : ext_ctxt ,
315
323
span : span ,
316
- idents : ~[ ast:: ident ] )
324
+ + idents : ~[ ast:: ident ] )
317
325
-> @ast:: Ty {
318
326
let ty = build:: mk_raw_path ( span, idents) ;
319
327
let ty = ast:: ty_path ( ty, cx. next_id ( ) ) ;
@@ -322,7 +330,7 @@ pub fn mk_ty_path(cx: ext_ctxt,
322
330
}
323
331
pub fn mk_ty_path_global ( cx : ext_ctxt ,
324
332
span : span ,
325
- idents : ~[ ast:: ident ] )
333
+ + idents : ~[ ast:: ident ] )
326
334
-> @ast:: Ty {
327
335
let ty = build:: mk_raw_path_global ( span, idents) ;
328
336
let ty = ast:: ty_path ( ty, cx. next_id ( ) ) ;
0 commit comments