compare macro tokens hygienically (commented out)
This commit is contained in:
parent
9ec1623d57
commit
72ee6af4d4
@ -234,6 +234,19 @@ pub fn parse_or_else(
|
||||
}
|
||||
}
|
||||
|
||||
// temporary for testing
|
||||
pub fn token_name_eq(t1 : &Token, t2 : &Token) -> bool {
|
||||
if (*t1 == *t2) {
|
||||
true
|
||||
} else {
|
||||
match (t1,t2) {
|
||||
(&token::IDENT(id1,_),&token::IDENT(id2,_)) =>
|
||||
id1.name == id2.name,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse(
|
||||
sess: @mut ParseSess,
|
||||
cfg: ast::CrateConfig,
|
||||
@ -343,7 +356,8 @@ pub fn parse(
|
||||
match_nonterminal(_,_,_) => { bb_eis.push(ei) }
|
||||
match_tok(ref t) => {
|
||||
let mut ei_t = ei.clone();
|
||||
if (*t) == tok {
|
||||
if (token_name_eq(t,&tok)) {
|
||||
//if (token::mtwt_token_eq(t,&tok)) {
|
||||
ei_t.idx += 1;
|
||||
next_eis.push(ei_t);
|
||||
}
|
||||
|
@ -3518,7 +3518,10 @@ impl Parser {
|
||||
}
|
||||
|
||||
fn is_self_ident(&self) -> bool {
|
||||
*self.token == token::IDENT(special_idents::self_, false)
|
||||
match *self.token {
|
||||
token::IDENT(id, false) => id.name == special_idents::self_.name,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
||||
fn expect_self_ident(&self) {
|
||||
|
Loading…
Reference in New Issue
Block a user