Remove support for the ivec T[] syntax.

This commit is contained in:
Erick Tryzelaar 2011-08-04 16:22:00 -07:00 committed by Brian Anderson
parent 491ed7f12c
commit 00ccd6ba42
2 changed files with 16 additions and 35 deletions

View file

@ -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);
}