libsyntax: Use the keyword "copy" for copy-mode bindings instead of the +.
Mea culpa for introducing + in the first place.
This commit is contained in:
parent
4991cc5d19
commit
fd536d9d3e
@ -1693,7 +1693,7 @@ fn parse_pat(refutable: bool) -> @pat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tok {
|
tok {
|
||||||
if (!is_ident(tok) && tok != token::BINOP(token::PLUS)) ||
|
if !is_ident(tok) ||
|
||||||
self.is_keyword(~"true") || self.is_keyword(~"false") {
|
self.is_keyword(~"true") || self.is_keyword(~"false") {
|
||||||
let val = self.parse_expr_res(RESTRICT_NO_BAR_OP);
|
let val = self.parse_expr_res(RESTRICT_NO_BAR_OP);
|
||||||
if self.eat_keyword(~"to") {
|
if self.eat_keyword(~"to") {
|
||||||
@ -1708,22 +1708,14 @@ fn parse_pat(refutable: bool) -> @pat {
|
|||||||
let binding_mode;
|
let binding_mode;
|
||||||
if self.eat_keyword(~"ref") {
|
if self.eat_keyword(~"ref") {
|
||||||
binding_mode = bind_by_ref;
|
binding_mode = bind_by_ref;
|
||||||
|
} else if self.eat_keyword(~"copy") {
|
||||||
|
binding_mode = bind_by_value;
|
||||||
|
} else if refutable {
|
||||||
|
// XXX: Should be bind_by_value, but that's not
|
||||||
|
// backward compatible.
|
||||||
|
binding_mode = bind_by_ref;
|
||||||
} else {
|
} else {
|
||||||
alt self.token {
|
binding_mode = bind_by_value;
|
||||||
token::BINOP(token::PLUS) => {
|
|
||||||
// XXX: Temporary thing pending a snapshot.
|
|
||||||
self.bump();
|
|
||||||
binding_mode = bind_by_value;
|
|
||||||
}
|
|
||||||
_ if refutable => {
|
|
||||||
// XXX: Should be bind_by_value, but that's not
|
|
||||||
// backward compatible.
|
|
||||||
binding_mode = bind_by_ref;
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
binding_mode = bind_by_value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if is_plain_ident(self.token) &&
|
if is_plain_ident(self.token) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user