diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2011-08-10 07:50:00 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-08-16 15:05:57 -0700 |
| commit | adb9cde39977d06ebfb9ec76f108103545c80acb (patch) | |
| tree | 576508b360ded61bd1001935e068c6c0aaafe6e9 /src/comp/syntax/parse | |
| parent | b3eba1527127264cb26ec5acffb6d3bcd1558ce9 (diff) | |
| download | rust-adb9cde39977d06ebfb9ec76f108103545c80acb.tar.gz rust-adb9cde39977d06ebfb9ec76f108103545c80acb.zip | |
Remove type parameter and vec/port/chan foo[T] syntax.
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 2cd31d5b3c1..3591322c1cf 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -448,23 +448,17 @@ fn parse_ty_postfix(orig_t: ast::ty_, p: &parser, colons_before_params: bool) -> @ast::ty { let lo = p.get_lo_pos(); - let seq; - if p.peek() == token::LBRACKET { - p.bump(); - seq = parse_seq_to_end(token::RBRACKET, some(token::COMMA), - bind parse_ty(_, false), p); - } else if colons_before_params && p.peek() == token::MOD_SEP { + if colons_before_params && p.peek() == token::MOD_SEP { p.bump(); expect(p, token::LT); - seq = parse_seq_to_gt(some(token::COMMA), bind parse_ty(_, false), p); } else if !colons_before_params && p.peek() == token::LT { p.bump(); - seq = parse_seq_to_gt(some(token::COMMA), bind parse_ty(_, false), p); } else { ret @spanned(lo, p.get_lo_pos(), orig_t); } // If we're here, we have explicit type parameter instantiation. + let seq = parse_seq_to_gt(some(token::COMMA), bind parse_ty(_, false), p); alt orig_t { ast::ty_path(pth, ann) { @@ -575,17 +569,10 @@ fn parse_ty(p: &parser, colons_before_params: bool) -> @ast::ty { parse_type_constraints(p)); } } else if (eat_word(p, "vec")) { - if p.peek() == token::LBRACKET { - p.bump(); - t = ast::ty_vec(parse_mt(p)); - hi = p.get_hi_pos(); - expect(p, token::RBRACKET); - } else { - expect(p, token::LT); - t = ast::ty_vec(parse_mt(p)); - hi = p.get_hi_pos(); - expect_gt(p); - } + expect(p, token::LT); + t = ast::ty_vec(parse_mt(p)); + hi = p.get_hi_pos(); + expect_gt(p); } else if (p.peek() == token::LBRACKET) { expect(p, token::LBRACKET); t = ast::ty_ivec(parse_mt(p)); |
