Add ast.ty_mutable.
This commit is contained in:
parent
20b11c832c
commit
38846e39c4
4 changed files with 39 additions and 2 deletions
|
|
@ -150,6 +150,7 @@ tag ty_ {
|
|||
ty_tup(vec[tup(bool /* mutability */, @ty)]);
|
||||
ty_fn(vec[rec(mode mode, @ty ty)], @ty); // TODO: effect
|
||||
ty_path(path, option.t[def]);
|
||||
ty_mutable(@ty);
|
||||
}
|
||||
|
||||
tag mode {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,12 @@ impure fn parse_ty(parser p) -> @ast.ty {
|
|||
}
|
||||
}
|
||||
|
||||
case (token.AT) { p.bump(); t = ast.ty_box(parse_ty(p)); }
|
||||
case (token.AT) {
|
||||
p.bump();
|
||||
auto t0 = parse_ty(p);
|
||||
hi = t0.span;
|
||||
t = ast.ty_box(t0);
|
||||
}
|
||||
|
||||
case (token.VEC) {
|
||||
p.bump();
|
||||
|
|
@ -193,6 +198,13 @@ impure fn parse_ty(parser p) -> @ast.ty {
|
|||
t = ast.ty_tup(elems.node);
|
||||
}
|
||||
|
||||
case (token.MUTABLE) {
|
||||
p.bump();
|
||||
auto t0 = parse_ty(p);
|
||||
hi = p.get_span();
|
||||
t = ast.ty_mutable(t0);
|
||||
}
|
||||
|
||||
case (token.FN) {
|
||||
t = parse_ty_fn(p);
|
||||
alt (t) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue