accept naked exprs with commas in pattern arms

pretty printing will use them, but indentation is slightly off
if the expr is long
This commit is contained in:
Niko Matsakis
2012-07-10 10:37:05 -07:00
committed by Brian Anderson
parent a89ed49d3d
commit c206d024eb
6 changed files with 76 additions and 6 deletions

View File

@@ -588,6 +588,13 @@ fn view_path_id(p: @view_path) -> node_id {
}
}
fn lone_block_expr(blk: blk) -> option<@ast::expr> {
if blk.node.view_items.len() != 0 { ret none; }
if blk.node.stmts.len() != 0 { ret none; }
if blk.node.rules != default_blk { ret none; }
ret blk.node.expr;
}
// Local Variables:
// mode: rust
// fill-column: 78;