Skip to content

Commit f949837

Browse files
committed
---
yaml --- r: 79357 b: refs/heads/try c: be93735 h: refs/heads/master i: 79355: 79f7581 v: v3
1 parent 5f74d59 commit f949837

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e6de6b7da8ee88bf84b0e217900051334be08da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
5-
refs/heads/try: 63b541200b214632c121dd4dc2dd2ae4dc47d0cc
5+
refs/heads/try: be93735e4e818fb4bbb5be2a71921fd94726286e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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