提交 2985f74f 编写于 作者: J John Clements

s/one_tuple/trailing_comma (more accurate name)

上级 aa346401
......@@ -1181,7 +1181,7 @@ fn parse_bottom_expr(&self) -> @expr {
self.bump();
// (e) is parenthesized e
// (e,) is a tuple with only one field, e
let mut one_tuple = false;
let mut trailing_comma = false;
if *self.token == token::RPAREN {
hi = self.span.hi;
self.bump();
......@@ -1195,13 +1195,13 @@ fn parse_bottom_expr(&self) -> @expr {
es.push(self.parse_expr());
}
else {
one_tuple = true;
trailing_comma = true;
}
}
hi = self.span.hi;
self.expect(&token::RPAREN);
return if es.len() == 1 && !one_tuple {
return if es.len() == 1 && !trailing_comma {
self.mk_expr(lo, self.span.hi, expr_paren(es[0]))
}
else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册