From 9304b7ee5980b889e941251a8a3990593c496eff Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Tue, 16 Aug 2011 14:12:19 -0700 Subject: [PATCH] Change declaration type parameter syntax to foo. --- src/comp/syntax/parse/parser.rs | 3 +++ src/comp/syntax/print/pprust.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index b1a4a92373d..c629b7eaa4c 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1755,6 +1755,9 @@ fn parse_ty_params(p: &parser) -> [ast::ty_param] { ty_params = parse_seq(token::LBRACKET, token::RBRACKET, some(token::COMMA), parse_ty_param, p).node; + } else if p.peek() == token::LT { + p.bump(); + ty_params = parse_seq_to_gt(some(token::COMMA), parse_ty_param, p); } if p.peek() == token::LT { ty_params = diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index d2af60096ec..d2c2192fd02 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -1210,13 +1210,13 @@ fn print_kind(s: &ps, kind: ast::kind) { fn print_type_params(s: &ps, params: &[ast::ty_param]) { if vec::len(params) > 0u { - word(s.s, "["); + word(s.s, "<"); fn printParam(s: &ps, param: &ast::ty_param) { print_kind(s, param.kind); word(s.s, param.ident); } commasep(s, inconsistent, params, printParam); - word(s.s, "]"); + word(s.s, ">"); } }