From acac6abc8512971f56be7c12940c8016ae6e94ff Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 28 Jul 2011 17:22:59 +0000 Subject: Parse, store and print type parameter kind constraints. --- src/comp/syntax/parse/parser.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/comp/syntax/parse') diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 4d8fe833559..79728fade13 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1696,7 +1696,14 @@ fn parse_block_tail(p: &parser, lo: uint) -> ast::blk { ret spanned(lo, hi, bloc); } -fn parse_ty_param(p: &parser) -> ast::ty_param { ret parse_ident(p); } +fn parse_ty_param(p: &parser) -> ast::ty_param { + let k = alt p.peek() { + token::TILDE. { p.bump(); ast::kind_unique } + token::AT. { p.bump(); ast::kind_shared } + _ { ast::kind_pinned } + }; + ret {ident: parse_ident(p), kind: k}; +} fn parse_ty_params(p: &parser) -> ast::ty_param[] { let ty_params: ast::ty_param[] = ~[]; -- cgit 1.4.1-3-g733a5