First step on #2826, accept ^ for ty_ptr.

This commit is contained in:
Graydon Hoare 2012-07-06 16:03:43 -07:00
parent 23c73360ca
commit 6b8ebc12db
2 changed files with 3 additions and 2 deletions

View File

@ -463,7 +463,8 @@ class parser {
}
mt { ty_uniq(mt) }
}
} else if self.token == token::BINOP(token::STAR) {
} else if self.token == token::BINOP(token::STAR) ||
self.token == token::BINOP(token::CARET) {
self.bump();
ty_ptr(self.parse_mt())
} else if self.token == token::LBRACE {

View File

@ -341,7 +341,7 @@ fn print_type_ex(s: ps, &&ty: @ast::ty, print_colons: bool) {
print_type(s, mt.ty);
word(s.s, "]");
}
ast::ty_ptr(mt) { word(s.s, "*"); print_mt(s, mt); }
ast::ty_ptr(mt) { word(s.s, "^"); print_mt(s, mt); }
ast::ty_rptr(region, mt) {
alt region.node {
ast::re_anon { word(s.s, "&"); }