diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-10-28 14:57:35 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-10-28 14:57:35 +0200 |
| commit | cba4ddc6a4c7ac382aeab60ab016159e57f8f5df (patch) | |
| tree | f69a781cf8ece69ac40589b9f2e42c3752d946ac /src/comp/syntax/parse | |
| parent | 4bb5a2c43abe7b4d90f0bba1cb1eabfdd9b771b6 (diff) | |
| download | rust-cba4ddc6a4c7ac382aeab60ab016159e57f8f5df.tar.gz rust-cba4ddc6a4c7ac382aeab60ab016159e57f8f5df.zip | |
Start accepting short keywords for parameter kinds
This is a pre-snapshot commit to be able to implement #1076 without the bootstrap compiler getting in my way.
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 9b467e683b8..ee308c55af5 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1735,9 +1735,11 @@ fn parse_block_tail(p: parser, lo: uint, s: ast::blk_check_mode) -> ast::blk { } fn parse_ty_param(p: parser) -> ast::ty_param { - let k = if eat_word(p, "pinned") { ast::kind_pinned } - else if eat_word(p, "unique") { ast::kind_unique } - else { ast::kind_shared }; + let k = if eat_word(p, "pinned") || eat_word(p, "pin") { + ast::kind_pinned + } else if eat_word(p, "unique") || eat_word(p, "uniq") { + ast::kind_unique + } else { eat_word(p, "shar"); ast::kind_shared }; ret {ident: parse_ident(p), kind: k}; } |
