Support break and cont in pretty-printer

This commit is contained in:
Marijn Haverbeke 2011-03-29 11:35:12 +02:00 committed by Graydon Hoare
parent f8393cc572
commit 8a7ea941bb
2 changed files with 8 additions and 0 deletions

View File

@ -1683,6 +1683,8 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool {
case (ast.expr_index(_,_,_)) { ret true; }
case (ast.expr_path(_,_,_)) { ret true; }
case (ast.expr_fail) { ret true; }
case (ast.expr_break) { ret true; }
case (ast.expr_cont) { ret true; }
case (ast.expr_ret(_)) { ret true; }
case (ast.expr_put(_)) { ret true; }
case (ast.expr_be(_)) { ret true; }

View File

@ -553,6 +553,12 @@ impure fn print_expr(ps s, &@ast.expr expr) {
case (ast.expr_fail) {
wrd(s.s, "fail");
}
case (ast.expr_break) {
wrd(s.s, "break");
}
case (ast.expr_cont) {
wrd(s.s, "cont");
}
case (ast.expr_ret(?result)) {
wrd(s.s, "ret");
alt (result) {