@@ -114,8 +114,8 @@ pub fn is_some(&&mpu: matcher_pos_up) -> bool {
114
114
pub struct MatcherPos {
115
115
elts : ~[ ast:: matcher ] , // maybe should be /&? Need to understand regions.
116
116
sep : Option < Token > ,
117
- mut idx : uint ,
118
- mut up: matcher_pos_up , // mutable for swapping only
117
+ idx : uint ,
118
+ up : matcher_pos_up , // mutable for swapping only
119
119
matches : ~[ DVec < @named_match > ] ,
120
120
match_lo : uint , match_hi : uint ,
121
121
sp_lo : BytePos ,
@@ -155,8 +155,8 @@ pub fn initial_matcher_pos(ms: ~[matcher], sep: Option<Token>, lo: BytePos)
155
155
~MatcherPos {
156
156
elts : ms,
157
157
sep : sep,
158
- mut idx : 0 u,
159
- mut up: matcher_pos_up ( None ) ,
158
+ idx : 0 u,
159
+ up : matcher_pos_up ( None ) ,
160
160
matches : copy vec:: from_fn ( count_names ( ms) , |_i| dvec:: DVec ( ) ) ,
161
161
match_lo : 0 u,
162
162
match_hi : match_idx_hi,
@@ -267,7 +267,7 @@ pub fn parse(sess: @mut ParseSess,
267
267
if idx == len {
268
268
// pop from the matcher position
269
269
270
- let new_pos = copy_up(ei.up);
270
+ let mut new_pos = copy_up(ei.up);
271
271
272
272
// update matches (the MBE " parse tree") by appending
273
273
// each tree as a subtree.
@@ -295,13 +295,13 @@ pub fn parse(sess: @mut ParseSess,
295
295
match copy ei. sep {
296
296
Some ( ref t) if idx == len => { // we need a separator
297
297
if tok == ( * t) { //pass the separator
298
- let ei_t = ei;
298
+ let mut ei_t = ei;
299
299
ei_t. idx += 1 ;
300
300
next_eis. push ( ei_t) ;
301
301
}
302
302
}
303
303
_ => { // we don't need a separator
304
- let ei_t = ei;
304
+ let mut ei_t = ei;
305
305
ei_t. idx = 0 ;
306
306
cur_eis. push ( ei_t) ;
307
307
}
@@ -315,7 +315,7 @@ pub fn parse(sess: @mut ParseSess,
315
315
match_seq( ref matchers, ref sep, zero_ok,
316
316
match_idx_lo, match_idx_hi) => {
317
317
if zero_ok {
318
- let new_ei = copy ei;
318
+ let mut new_ei = copy ei;
319
319
new_ei. idx += 1 u;
320
320
//we specifically matched zero repeats.
321
321
for uint : : range( match_idx_lo, match_idx_hi) |idx| {
@@ -331,16 +331,16 @@ pub fn parse(sess: @mut ParseSess,
331
331
cur_eis. push( ~MatcherPos {
332
332
elts : ( * matchers) ,
333
333
sep : ( * sep) ,
334
- mut idx : 0 u,
335
- mut up : matcher_pos_up( Some ( ei_t) ) ,
334
+ idx : 0 u,
335
+ up : matcher_pos_up( Some ( ei_t) ) ,
336
336
matches : matches,
337
337
match_lo : match_idx_lo, match_hi : match_idx_hi,
338
338
sp_lo : sp. lo
339
339
} ) ;
340
340
}
341
341
match_nonterminal( _, _, _) => { bb_eis. push( ei) }
342
342
match_tok( ref t) => {
343
- let ei_t = ei;
343
+ let mut ei_t = ei;
344
344
if ( * t) == tok {
345
345
ei_t. idx += 1 ;
346
346
next_eis. push( ei_t) ;
@@ -388,7 +388,7 @@ pub fn parse(sess: @mut ParseSess,
388
388
} else /* bb_eis.len() == 1 */ {
389
389
let rust_parser = Parser(sess, cfg, rdr.dup());
390
390
391
- let ei = bb_eis.pop();
391
+ let mut ei = bb_eis.pop();
392
392
match ei.elts[ei.idx].node {
393
393
match_nonterminal(_, name, idx) => {
394
394
ei.matches[idx].push(@matched_nonterminal(
0 commit comments