1
Fork 0

syntax: Refactor ident parsing

This commit is contained in:
Brian Anderson 2012-04-26 18:35:16 -07:00
parent 0be41ce02b
commit 345a21916c

View file

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