Skip to content

Commit c525346

Browse files
committed
---
yaml --- r: 144825 b: refs/heads/try2 c: bc2a44d h: refs/heads/master i: 144823: 45e47a8 v: v3
1 parent f911276 commit c525346

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e29d25338d7b0374f3dd5976b57463e6aafab0ac
8+
refs/heads/try2: bc2a44daf1cf348da98de9553fccc23806e84f71
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)