syntax: Refactor ident parsing

This commit is contained in:
Brian Anderson 2012-04-26 18:35:16 -07:00
parent 0be41ce02b
commit 345a21916c
1 changed files with 3 additions and 3 deletions

View File

@ -510,10 +510,10 @@ fn parse_lit(p: parser) -> ast::lit {
fn parse_path_without_tps(p: parser) -> @ast::path {
let lo = p.span.lo;
let global = eat(p, token::MOD_SEP);
let mut ids = [parse_ident(p)];
while p.look_ahead(1u) != token::LT && eat(p, token::MOD_SEP) {
let mut ids = [];
do {
ids += [parse_ident(p)];
}
} while p.look_ahead(1u) != token::LT && eat(p, token::MOD_SEP);
@{span: mk_sp(lo, p.last_span.hi), global: global,
idents: ids, rp: none, types: []}
}