diff options
| author | Patrick Walton <[email protected]> | 2010-10-13 10:55:20 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-10-13 10:55:20 -0700 |
| commit | d50d48152998ca474329afd3c7cbf9bed29a6a4f (patch) | |
| tree | ad84e9736a84e561add95dc9ff2ead543d1da2ae /src/comp/front | |
| parent | First stab at a Vim syntax highlighter for Rust (diff) | |
| download | rust-d50d48152998ca474329afd3c7cbf9bed29a6a4f.tar.xz rust-d50d48152998ca474329afd3c7cbf9bed29a6a4f.zip | |
rustc: Parse vector types
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 1 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 7 |
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 |