From 345a21916cdbdaf075182bf45251c71cf06cb4ad Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 26 Apr 2012 18:35:16 -0700 Subject: [PATCH] syntax: Refactor ident parsing --- src/librustsyntax/parse/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustsyntax/parse/parser.rs b/src/librustsyntax/parse/parser.rs index 6168d6e8b3c1..d0aee6fffabb 100644 --- a/src/librustsyntax/parse/parser.rs +++ b/src/librustsyntax/parse/parser.rs @@ -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: []} }