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.
This commit is contained in:
Marijn Haverbeke 2011-10-28 14:57:35 +02:00
parent 4bb5a2c43a
commit cba4ddc6a4

View 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 { fn parse_ty_param(p: parser) -> ast::ty_param {
let k = if eat_word(p, "pinned") { ast::kind_pinned } let k = if eat_word(p, "pinned") || eat_word(p, "pin") {
else if eat_word(p, "unique") { ast::kind_unique } ast::kind_pinned
else { ast::kind_shared }; } 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}; ret {ident: parse_ident(p), kind: k};
} }