libsyntax: Fix a parsing problem with the temporary syntax for by-value pattern match bindings

This commit is contained in:
Patrick Walton 2012-08-01 12:27:49 -07:00
parent 300e2b8513
commit 899400cd1a

View File

@ -1693,8 +1693,8 @@ class parser {
}
}
tok {
if !is_ident(tok) || self.is_keyword(~"true")
|| self.is_keyword(~"false") {
if (!is_ident(tok) && tok != token::BINOP(token::PLUS)) ||
self.is_keyword(~"true") || self.is_keyword(~"false") {
let val = self.parse_expr_res(RESTRICT_NO_BAR_OP);
if self.eat_keyword(~"to") {
let end = self.parse_expr_res(RESTRICT_NO_BAR_OP);