From 00ccd6ba4272c487c62b06544219ee150307482a Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Thu, 4 Aug 2011 16:22:00 -0700 Subject: [PATCH] Remove support for the ivec T[] syntax. --- src/comp/middle/trans.rs | 2 +- src/comp/syntax/parse/parser.rs | 49 ++++++++++----------------------- 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 2d003182cb2b..b23388f290d9 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -6886,7 +6886,7 @@ fn vtbl_mthd_lteq(a: &vtbl_mthd, b: &vtbl_mthd) -> bool { // Used by create_vtbl to filter a list of methods to remove the ones that we // don't need forwarding slots for. fn filtering_fn(cx: @local_ctxt, m: &vtbl_mthd, - addtl_meths: (@ast::method)[]) -> + addtl_meths: [@ast::method]) -> option::t[vtbl_mthd] { // Since m is a fwding_mthd, and we're checking to see if it's in diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 9bcf6d5aa84c..2033e181fe7b 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -429,42 +429,23 @@ fn parse_ty_postfix(orig_t: ast::ty_, p: &parser) -> @ast::ty { // This is explicit type parameter instantiation. p.bump(); - let mut; - if eat_word(p, "mutable") { - if p.peek() == token::QUES { - p.bump(); - mut = ast::maybe_mut; - } else { mut = ast::mut; } - } else { mut = ast::imm; } + let seq = + parse_seq_to_end(token::RBRACKET, some(token::COMMA), + parse_ty, p); - if mut == ast::imm && p.peek() != token::RBRACKET { - // This is explicit type parameter instantiation. - let seq = - parse_seq_to_end(token::RBRACKET, some(token::COMMA), - parse_ty, p); - - - alt orig_t { - ast::ty_path(pth, ann) { - let hi = p.get_hi_pos(); - ret @spanned(lo, hi, - ast::ty_path(spanned(lo, hi, - {global: pth.node.global, - idents: pth.node.idents, - types: seq}), ann)); - } - _ { - p.fatal("type parameter instantiation only allowed for " + - "paths"); - } - } + alt orig_t { + ast::ty_path(pth, ann) { + let hi = p.get_hi_pos(); + ret @spanned(lo, hi, + ast::ty_path(spanned(lo, hi, + {global: pth.node.global, + idents: pth.node.idents, + types: seq}), ann)); + } + _ { + p.fatal("type parameter instantiation only allowed for paths"); + } } - - expect(p, token::RBRACKET); - let hi = p.get_hi_pos(); - // FIXME: spans are probably wrong - let t = ast::ty_ivec({ty: @spanned(lo, hi, orig_t), mut: mut}); - ret parse_ty_postfix(t, p); } ret @spanned(lo, p.get_lo_pos(), orig_t); }