rustc: Parse istr and ivec

This commit is contained in:
Patrick Walton
2011-06-09 15:04:06 -07:00
parent 1cc3fe567c
commit 54d34bec59
2 changed files with 8 additions and 0 deletions

View File

@@ -485,6 +485,7 @@ fn parse_ty(&parser p) -> @ast::ty {
else if (eat_word(p, "uint")) { t = ast::ty_uint; }
else if (eat_word(p, "float")) { t = ast::ty_float; }
else if (eat_word(p, "str")) { t = ast::ty_str; }
else if (eat_word(p, "istr")) { t = ast::ty_istr; }
else if (eat_word(p, "char")) { t = ast::ty_char; }
else if (eat_word(p, "task")) { t = ast::ty_task; }
else if (eat_word(p, "i8")) { t = ast::ty_machine(common::ty_i8); }
@@ -570,6 +571,11 @@ fn parse_ty(&parser p) -> @ast::ty {
t = ast::ty_chan(parse_ty(p));
hi = p.get_hi_pos();
expect(p, token::RBRACKET);
} else if (eat_word(p, "ivec")) {
expect(p, token::LBRACKET);
t = ast::ty_ivec(parse_ty(p));
hi = p.get_hi_pos();
expect(p, token::RBRACKET);
} else if (eat_word(p, "mutable")) {
p.get_session().span_warn(p.get_span(),
"ignoring deprecated 'mutable' type constructor");