aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/ast.rs1
-rw-r--r--src/comp/front/parser.rs14
2 files changed, 14 insertions, 1 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index 3c2af3c8..a177f301 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -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 {
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 261ea1ad..ab0f795d 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -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) {