aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/ast.rs
diff options
context:
space:
mode:
authorLindsey Kuper <[email protected]>2011-03-18 12:32:54 -0700
committerLindsey Kuper <[email protected]>2011-03-18 12:32:54 -0700
commit6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0 (patch)
treef423d576e977e7a258f09e50e5a51702525782e2 /src/comp/front/ast.rs
parentIgnore emacs autosave files. (diff)
parentrustc: Add a span_unimpl() for debugging (diff)
downloadrust-6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0.tar.xz
rust-6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0.zip
Merge branch 'master' of git://github.com/graydon/rust
Diffstat (limited to 'src/comp/front/ast.rs')
-rw-r--r--src/comp/front/ast.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index 1970f788..ec93db55 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -91,6 +91,7 @@ tag pat_ {
tag mutability {
mut;
imm;
+ maybe_mut;
}
tag opacity {
@@ -168,7 +169,6 @@ tag unop {
bitnot;
not;
neg;
- _mutable;
}
fn unop_to_str(unop op) -> str {
@@ -178,7 +178,6 @@ fn unop_to_str(unop op) -> str {
case (bitnot) {ret "~";}
case (not) {ret "!";}
case (neg) {ret "-";}
- case (_mutable) {ret "mutable";}
}
}
@@ -215,7 +214,7 @@ type field = rec(mutability mut, ident ident, @expr expr);
type expr = spanned[expr_];
tag expr_ {
- expr_vec(vec[@expr], ann);
+ expr_vec(vec[@expr], mutability, ann);
expr_tup(vec[elt], ann);
expr_rec(vec[field], option.t[@expr], ann);
expr_call(@expr, vec[@expr], ann);
@@ -263,7 +262,8 @@ tag lit_ {
// NB: If you change this, you'll probably want to change the corresponding
// type structure in middle/ty.rs as well.
-type ty_field = rec(ident ident, @ty ty);
+type mt = rec(@ty ty, mutability mut);
+type ty_field = rec(ident ident, mt mt);
type ty_arg = rec(mode mode, @ty ty);
// TODO: effect
type ty_method = rec(proto proto, ident ident,
@@ -277,16 +277,15 @@ tag ty_ {
ty_machine(util.common.ty_mach);
ty_char;
ty_str;
- ty_box(@ty);
- ty_vec(@ty);
+ ty_box(mt);
+ ty_vec(mt);
ty_port(@ty);
ty_chan(@ty);
- ty_tup(vec[@ty]);
+ ty_tup(vec[mt]);
ty_rec(vec[ty_field]);
ty_fn(proto, vec[ty_arg], @ty); // TODO: effect
ty_obj(vec[ty_method]);
ty_path(path, option.t[def]);
- ty_mutable(@ty);
ty_type;
ty_constr(@ty, vec[@constr]);
}