From 9769b612261d6000b969ce466c4033f8445d3474 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 24 Nov 2010 17:36:22 -0800 Subject: rustc: Parse type-parametric typedefs --- src/comp/front/parser.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/comp/front/parser.rs') 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)); } -- cgit v1.2.3