Skip to content

Commit c9da7d1

Browse files
committed
---
yaml --- r: 79260 b: refs/heads/auto c: bc2a44d h: refs/heads/master v: v3
1 parent bd1298b commit c9da7d1

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: e29d25338d7b0374f3dd5976b57463e6aafab0ac
16+
refs/heads/auto: bc2a44daf1cf348da98de9553fccc23806e84f71
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libsyntax/ext/tt/macro_parser.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,12 @@ pub fn parse_or_else(
234234
}
235235
}
236236
237-
// temporary for testing
237+
// perform a token equality check, ignoring syntax context (that is, an unhygienic comparison)
238238
pub fn token_name_eq(t1 : &Token, t2 : &Token) -> bool {
239-
if (*t1 == *t2) {
240-
true
241-
} else {
242-
match (t1,t2) {
243-
(&token::IDENT(id1,_),&token::IDENT(id2,_)) =>
244-
id1.name == id2.name,
245-
_ => false
246-
}
239+
match (t1,t2) {
240+
(&token::IDENT(id1,_),&token::IDENT(id2,_)) =>
241+
id1.name == id2.name,
242+
_ => *t1 == *t2
247243
}
248244
}
249245
@@ -310,7 +306,10 @@ pub fn parse(
310306
// the *_t vars are workarounds for the lack of unary move
311307
match ei.sep {
312308
Some(ref t) if idx == len => { // we need a separator
313-
if tok == (*t) { //pass the separator
309+
// i'm conflicted about whether this should be hygienic....
310+
// though in this case, if the separators are never legal
311+
// idents, it shouldn't matter.
312+
if token_name_eq(&tok, t) { //pass the separator
314313
let mut ei_t = ei.clone();
315314
ei_t.idx += 1;
316315
next_eis.push(ei_t);
@@ -367,7 +366,7 @@ pub fn parse(
367366
}
368367

369368
/* error messages here could be improved with links to orig. rules */
370-
if tok == EOF {
369+
if token_name_eq(&tok, &EOF) {
371370
if eof_eis.len() == 1u {
372371
let mut v = ~[];
373372
for dv in eof_eis[0u].matches.mut_iter() {

0 commit comments

Comments
 (0)