Skip to content

Commit 6cfbcca

Browse files
committed
Update grammar/verify.rs to work with recent master
1 parent d397a3e commit 6cfbcca

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/grammar/verify.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(globs, plugin)]
11+
#![feature(plugin)]
1212

1313
extern crate syntax;
1414
extern crate rustc;
@@ -114,7 +114,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
114114
res.insert(num.to_string(), tok);
115115
}
116116

117-
debug!("Token map: {}", res);
117+
debug!("Token map: {:?}", res);
118118
res
119119
}
120120

@@ -162,7 +162,7 @@ fn fixchar(mut lit: &str) -> ast::Name {
162162
parse::token::intern(lit.slice(1, lit.len() - 1))
163163
}
164164

165-
fn count(lit: &str) -> uint {
165+
fn count(lit: &str) -> usize {
166166
lit.chars().take_while(|c| *c == '#').count()
167167
}
168168

@@ -177,12 +177,12 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>) -> TokenAn
177177
let toknum = m.name("toknum").unwrap_or("");
178178
let content = m.name("content").unwrap_or("");
179179

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",
181181
toknum).as_slice());
182182

183183
let nm = parse::token::intern(content);
184184

185-
debug!("What we got: content (`{}`), proto: {}", content, proto_tok);
185+
debug!("What we got: content (`{}`), proto: {:?}", content, proto_tok);
186186

187187
let real_tok = match *proto_tok {
188188
token::BinOp(..) => token::BinOp(str_to_binop(content)),
@@ -266,7 +266,7 @@ fn main() {
266266
continue
267267
}
268268

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,
270270
antlr_tok);
271271

272272
macro_rules! matches {
@@ -277,12 +277,12 @@ fn main() {
277277
if !tok_cmp(&rustc_tok.tok, &antlr_tok.tok) {
278278
// FIXME #15677: needs more robust escaping in
279279
// antlr
280-
warn!("Different names for {} and {}", rustc_tok, antlr_tok);
280+
warn!("Different names for {:?} and {:?}", rustc_tok, antlr_tok);
281281
}
282282
}
283-
_ => panic!("{} is not {}", antlr_tok, rustc_tok)
283+
_ => panic!("{:?} is not {:?}", antlr_tok, rustc_tok)
284284
},)*
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)
286286
}
287287
)
288288
}

0 commit comments

Comments
 (0)