diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-04-26 18:35:16 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-04-27 16:45:54 -0700 |
| commit | 345a21916cdbdaf075182bf45251c71cf06cb4ad (patch) | |
| tree | d4ad7ebe461f883e8d1a024a722042b6cb1f739f | |
| parent | 0be41ce02b2313bb75d68d3828680ca88cf44c27 (diff) | |
| download | rust-345a21916cdbdaf075182bf45251c71cf06cb4ad.tar.gz rust-345a21916cdbdaf075182bf45251c71cf06cb4ad.zip | |
syntax: Refactor ident parsing
| -rw-r--r-- | src/librustsyntax/parse/parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustsyntax/parse/parser.rs b/src/librustsyntax/parse/parser.rs index 6168d6e8b3c..d0aee6fffab 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: []} } |
