Move to short type parameter keywords

Issue #1076
This commit is contained in:
Marijn Haverbeke 2011-10-28 15:09:12 +02:00
parent 8e65dffc30
commit 7a0aee74bf
5 changed files with 24 additions and 24 deletions

View file

@ -26,9 +26,9 @@
*
* Since this forms a lattice, we denote the capabilites in terms of a
* worst-case requirement. That is, if your function needs to move-and-send (or
* copy) your T, you write fn<unique T>(...). If you need to move but not send,
* copy) your T, you write fn<uniq T>(...). If you need to move but not send,
* you write fn<T>(...). And if you need neither -- can work with any sort of
* pinned data at all -- then you write fn<pinned T>(...).
* pinned data at all -- then you write fn<pin T>(...).
*
* Most types are unique or shared. Other possible name combinations for these
* two: (tree, graph; pruned, pooled; message, local; owned, common) are

View file

@ -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};
}

View file

@ -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 */ }
}
}