提交 de383bcf 编写于 作者: N Niko Matsakis

extend parser so that expressions that do not require semi-colons

to be statements are not considered expressions in the tail position
上级 9e1dc703
......@@ -1621,8 +1621,8 @@ fn expr_requires_semi_to_be_stmt(e: @ast::expr) -> bool {
fn stmt_to_expr(stmt: @ast::stmt) -> option::t<@ast::expr> {
alt stmt.node {
ast::stmt_expr(e, _) { some(e) }
ast::stmt_decl(_, _) { none }
ast::stmt_expr(e, _) when expr_requires_semi_to_be_stmt(e) { some(e) }
_ { none }
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册