8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- #![ feature( globs , plugin) ]
11
+ #![ feature( plugin) ]
12
12
13
13
extern crate syntax;
14
14
extern crate rustc;
@@ -114,7 +114,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
114
114
res. insert ( num. to_string ( ) , tok) ;
115
115
}
116
116
117
- debug ! ( "Token map: {}" , res) ;
117
+ debug ! ( "Token map: {:? }" , res) ;
118
118
res
119
119
}
120
120
@@ -162,7 +162,7 @@ fn fixchar(mut lit: &str) -> ast::Name {
162
162
parse:: token:: intern ( lit. slice ( 1 , lit. len ( ) - 1 ) )
163
163
}
164
164
165
- fn count ( lit : & str ) -> uint {
165
+ fn count ( lit : & str ) -> usize {
166
166
lit. chars ( ) . take_while ( |c| * c == '#' ) . count ( )
167
167
}
168
168
@@ -177,12 +177,12 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>) -> TokenAn
177
177
let toknum = m. name ( "toknum" ) . unwrap_or ( "" ) ;
178
178
let content = m. name ( "content" ) . unwrap_or ( "" ) ;
179
179
180
- let proto_tok = tokens. get ( toknum) . expect ( format ! ( "didn't find token {} in the map" ,
180
+ let proto_tok = tokens. get ( toknum) . expect ( format ! ( "didn't find token {:? } in the map" ,
181
181
toknum) . as_slice ( ) ) ;
182
182
183
183
let nm = parse:: token:: intern ( content) ;
184
184
185
- debug ! ( "What we got: content (`{}`), proto: {}" , content, proto_tok) ;
185
+ debug ! ( "What we got: content (`{}`), proto: {:? }" , content, proto_tok) ;
186
186
187
187
let real_tok = match * proto_tok {
188
188
token:: BinOp ( ..) => token:: BinOp ( str_to_binop ( content) ) ,
@@ -266,7 +266,7 @@ fn main() {
266
266
continue
267
267
}
268
268
269
- assert ! ( rustc_tok. sp == antlr_tok. sp, "{} and {} have different spans" , rustc_tok,
269
+ assert ! ( rustc_tok. sp == antlr_tok. sp, "{:? } and {:? } have different spans" , rustc_tok,
270
270
antlr_tok) ;
271
271
272
272
macro_rules! matches {
@@ -277,12 +277,12 @@ fn main() {
277
277
if !tok_cmp( & rustc_tok. tok, & antlr_tok. tok) {
278
278
// FIXME #15677: needs more robust escaping in
279
279
// antlr
280
- warn!( "Different names for {} and {}" , rustc_tok, antlr_tok) ;
280
+ warn!( "Different names for {:? } and {:? }" , rustc_tok, antlr_tok) ;
281
281
}
282
282
}
283
- _ => panic!( "{} is not {}" , antlr_tok, rustc_tok)
283
+ _ => panic!( "{:? } is not {:? }" , antlr_tok, rustc_tok)
284
284
} , ) *
285
- ref c => assert!( c == & antlr_tok. tok, "{} is not {}" , rustc_tok, antlr_tok)
285
+ ref c => assert!( c == & antlr_tok. tok, "{:? } is not {:? }" , rustc_tok, antlr_tok)
286
286
}
287
287
)
288
288
}
0 commit comments