diff options
| author | Patrick Walton <[email protected]> | 2010-11-24 17:36:22 -0800 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-11-24 17:36:22 -0800 |
| commit | 9769b612261d6000b969ce466c4033f8445d3474 (patch) | |
| tree | 5313b4cb1be29bbe3d396a758b3cf46a68b6a5af /src/comp/front | |
| parent | rustc: Parse type-parametric tags (diff) | |
| download | rust-9769b612261d6000b969ce466c4033f8445d3474.tar.xz rust-9769b612261d6000b969ce466c4033f8445d3474.zip | |
rustc: Parse type-parametric typedefs
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 2 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 800d9794..7da857b4 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -170,7 +170,7 @@ type item = spanned[item_]; tag item_ { item_fn(ident, _fn, vec[ty_param], def_id, ann); item_mod(ident, _mod, def_id); - item_ty(ident, @ty, def_id, ann); + item_ty(ident, @ty, vec[ty_param], def_id, ann); item_tag(ident, vec[variant], vec[ty_param], def_id); } diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 3c640f4a..f4874733 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -1026,7 +1026,7 @@ impure fn parse_block(parser p) -> ast.block { case (ast.item_mod(?i, _, _)) { index.insert(i, u-1u); } - case (ast.item_ty(?i, _, _, _)) { + case (ast.item_ty(?i, _, _, _, _)) { index.insert(i, u-1u); } } @@ -1112,11 +1112,13 @@ impure fn parse_item_type(parser p) -> tup(ast.ident, @ast.item) { auto lo = p.get_span(); expect(p, token.TYPE); auto id = parse_ident(p); + auto tps = parse_ty_params(p); + expect(p, token.EQ); auto ty = parse_ty(p); auto hi = p.get_span(); expect(p, token.SEMI); - auto item = ast.item_ty(id, ty, p.next_def_id(), ast.ann_none); + auto item = ast.item_ty(id, ty, tps, p.next_def_id(), ast.ann_none); ret tup(id, @spanned(lo, hi, item)); } |