diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-07-28 17:22:59 +0000 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-07-28 17:22:59 +0000 |
| commit | acac6abc8512971f56be7c12940c8016ae6e94ff (patch) | |
| tree | 8f73d8814fcc53ce68fd23beca17e507b3a84f9f /src/comp/syntax/parse | |
| parent | 1836f59d9a769216161367cabe3269cb6c915cd7 (diff) | |
| download | rust-acac6abc8512971f56be7c12940c8016ae6e94ff.tar.gz rust-acac6abc8512971f56be7c12940c8016ae6e94ff.zip | |
Parse, store and print type parameter kind constraints.
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 9 |
1 files changed, 8 insertions, 1 deletions
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[] = ~[]; |
