@@ -311,8 +311,8 @@ pub fn Parser(sess: @mut ParseSess, cfg: ast::CrateConfig, rdr: @mut reader)
311
311
placeholder. clone ( ) ,
312
312
placeholder. clone ( ) ,
313
313
] ,
314
- buffer_start : @ mut 0 ,
315
- buffer_end : @ mut 0 ,
314
+ buffer_start : 0 ,
315
+ buffer_end : 0 ,
316
316
tokens_consumed : @mut 0 ,
317
317
restriction : @mut UNRESTRICTED ,
318
318
quote_depth : 0 ,
@@ -336,8 +336,8 @@ pub struct Parser {
336
336
// the previous token or None (only stashed sometimes).
337
337
last_token : Option < ~token:: Token > ,
338
338
buffer : [ TokenAndSpan , ..4 ] ,
339
- buffer_start : @ mut int ,
340
- buffer_end : @ mut int ,
339
+ buffer_start : int ,
340
+ buffer_end : int ,
341
341
tokens_consumed : @mut uint ,
342
342
restriction : @mut restriction ,
343
343
quote_depth : uint , // not (yet) related to the quasiquoter
@@ -733,13 +733,13 @@ impl Parser {
733
733
} else {
734
734
None
735
735
} ;
736
- let next = if * self . buffer_start == * self . buffer_end {
736
+ let next = if self . buffer_start == self . buffer_end {
737
737
self . reader . next_token ( )
738
738
} else {
739
739
// Avoid token copies with `util::replace`.
740
- let buffer_start = * self . buffer_start as uint ;
740
+ let buffer_start = self . buffer_start as uint ;
741
741
let next_index = ( buffer_start + 1 ) & 3 as uint ;
742
- * self . buffer_start = next_index as int ;
742
+ self . buffer_start = next_index as int ;
743
743
744
744
let placeholder = TokenAndSpan {
745
745
tok : token:: UNDERSCORE ,
@@ -768,19 +768,19 @@ impl Parser {
768
768
self . span = mk_sp ( lo, hi) ;
769
769
}
770
770
pub fn buffer_length ( & mut self ) -> int {
771
- if * self . buffer_start <= * self . buffer_end {
772
- return * self . buffer_end - * self . buffer_start ;
771
+ if self . buffer_start <= self . buffer_end {
772
+ return self . buffer_end - self . buffer_start ;
773
773
}
774
- return ( 4 - * self . buffer_start ) + * self . buffer_end ;
774
+ return ( 4 - self . buffer_start ) + self . buffer_end ;
775
775
}
776
776
pub fn look_ahead < R > ( & mut self , distance : uint , f: |& token:: Token | -> R )
777
777
-> R {
778
778
let dist = distance as int ;
779
779
while self . buffer_length ( ) < dist {
780
- self . buffer [ * self . buffer_end ] = self . reader . next_token ( ) ;
781
- * self . buffer_end = ( * self . buffer_end + 1 ) & 3 ;
780
+ self . buffer [ self . buffer_end ] = self . reader . next_token ( ) ;
781
+ self . buffer_end = ( self . buffer_end + 1 ) & 3 ;
782
782
}
783
- f ( & self . buffer [ ( * self . buffer_start + dist - 1 ) & 3 ] . tok )
783
+ f ( & self . buffer [ ( self . buffer_start + dist - 1 ) & 3 ] . tok )
784
784
}
785
785
pub fn fatal ( & mut self , m : & str ) -> ! {
786
786
self . sess . span_diagnostic . span_fatal ( self . span , m)
0 commit comments