Skip to content

Commit 9304b7e

Browse files
committed
Change declaration type parameter syntax to foo<T>.
1 parent 0107d6a commit 9304b7e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/comp/syntax/parse/parser.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,9 @@ fn parse_ty_params(p: &parser) -> [ast::ty_param] {
17551755
ty_params =
17561756
parse_seq(token::LBRACKET, token::RBRACKET, some(token::COMMA),
17571757
parse_ty_param, p).node;
1758+
} else if p.peek() == token::LT {
1759+
p.bump();
1760+
ty_params = parse_seq_to_gt(some(token::COMMA), parse_ty_param, p);
17581761
}
17591762
if p.peek() == token::LT {
17601763
ty_params =

src/comp/syntax/print/pprust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,13 +1210,13 @@ fn print_kind(s: &ps, kind: ast::kind) {
12101210

12111211
fn print_type_params(s: &ps, params: &[ast::ty_param]) {
12121212
if vec::len(params) > 0u {
1213-
word(s.s, "[");
1213+
word(s.s, "<");
12141214
fn printParam(s: &ps, param: &ast::ty_param) {
12151215
print_kind(s, param.kind);
12161216
word(s.s, param.ident);
12171217
}
12181218
commasep(s, inconsistent, params, printParam);
1219-
word(s.s, "]");
1219+
word(s.s, ">");
12201220
}
12211221
}
12221222

0 commit comments

Comments
 (0)