about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-10-28 15:09:12 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-10-28 15:25:33 +0200
commit7a0aee74bf15446a235830c0ea7a32ac1ea765a4 (patch)
tree5437e48772652930646fb5f8603c40752df6e79b /src/comp/syntax
parent8e65dffc30b854179a366272957be661a6fdb7bd (diff)
downloadrust-7a0aee74bf15446a235830c0ea7a32ac1ea765a4.tar.gz
rust-7a0aee74bf15446a235830c0ea7a32ac1ea765a4.zip
Move to short type parameter keywords
Issue #1076
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/parse/parser.rs10
-rw-r--r--src/comp/syntax/print/pprust.rs4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index ee308c55af5..9c33901741a 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -1735,11 +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") || 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 };
+    let k = if eat_word(p, "pin") { ast::kind_pinned }
+            else if eat_word(p, "uniq") { ast::kind_unique }
+            else if eat_word(p, "shar") { ast::kind_shared }
+            // FIXME distinguish implied shared from explicit
+            else { ast::kind_shared };
     ret {ident: parse_ident(p), kind: k};
 }
 
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index e95ce36252f..f30688f7ee5 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -1193,8 +1193,8 @@ fn print_arg_mode(s: ps, m: ast::mode) {
 
 fn print_kind(s: ps, kind: ast::kind) {
     alt kind {
-      ast::kind_unique. { word_nbsp(s, "unique"); }
-      ast::kind_pinned. { word_nbsp(s, "pinned"); }
+      ast::kind_unique. { word_nbsp(s, "uniq"); }
+      ast::kind_pinned. { word_nbsp(s, "pin"); }
       _ {/* fallthrough */ }
     }
 }