Skip to content

Commit 345a219

Browse files
committed
syntax: Refactor ident parsing
1 parent 0be41ce commit 345a219

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustsyntax/parse/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,10 @@ fn parse_lit(p: parser) -> ast::lit {
510510
fn parse_path_without_tps(p: parser) -> @ast::path {
511511
let lo = p.span.lo;
512512
let global = eat(p, token::MOD_SEP);
513-
let mut ids = [parse_ident(p)];
514-
while p.look_ahead(1u) != token::LT && eat(p, token::MOD_SEP) {
513+
let mut ids = [];
514+
do {
515515
ids += [parse_ident(p)];
516-
}
516+
} while p.look_ahead(1u) != token::LT && eat(p, token::MOD_SEP);
517517
@{span: mk_sp(lo, p.last_span.hi), global: global,
518518
idents: ids, rp: none, types: []}
519519
}

0 commit comments

Comments
 (0)