]> git.lizzy.rs Git - rust.git/commitdiff
Start accepting short keywords for parameter kinds
authorMarijn Haverbeke <marijnh@gmail.com>
Fri, 28 Oct 2011 12:57:35 +0000 (14:57 +0200)
committerMarijn Haverbeke <marijnh@gmail.com>
Fri, 28 Oct 2011 12:57:35 +0000 (14:57 +0200)
This is a pre-snapshot commit to be able to implement #1076 without
the bootstrap compiler getting in my way.

src/comp/syntax/parse/parser.rs

index 9b467e683b80dcb5fdf2c8a06427781ea1f5ee81..ee308c55af54f03136c105c53240fd05f8b09572 100644 (file)
@@ -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};
 }