aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-10-13 10:55:20 -0700
committerPatrick Walton <[email protected]>2010-10-13 10:55:20 -0700
commitd50d48152998ca474329afd3c7cbf9bed29a6a4f (patch)
treead84e9736a84e561add95dc9ff2ead543d1da2ae /src
parentFirst stab at a Vim syntax highlighter for Rust (diff)
downloadrust-d50d48152998ca474329afd3c7cbf9bed29a6a4f.tar.xz
rust-d50d48152998ca474329afd3c7cbf9bed29a6a4f.zip
rustc: Parse vector types
Diffstat (limited to 'src')
-rw-r--r--src/comp/front/ast.rs1
-rw-r--r--src/comp/front/parser.rs7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index a7ef4e65..aa4ed1e7 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -117,6 +117,7 @@ tag ty_ {
ty_char;
ty_str;
ty_box(@ty);
+ ty_vec(@ty);
ty_tup(vec[tup(bool /* mutability */, @ty)]);
ty_path(path, option[referent]);
}
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 8d945dd8..d731bf70 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -107,6 +107,13 @@ io fn parse_ty(parser p) -> @ast.ty {
case (token.AT) { p.bump(); t = ast.ty_box(parse_ty(p)); }
+ case (token.VEC) {
+ p.bump();
+ expect(p, token.LBRACKET);
+ t = ast.ty_vec(parse_ty(p));
+ expect(p, token.RBRACKET);
+ }
+
case (token.TUP) {
p.bump();
auto f = parse_possibly_mutable_ty; // FIXME: trans_const_lval bug