Skip to content

Commit 8a7ea94

Browse files
marijnhgraydon
authored andcommitted
Support break and cont in pretty-printer
1 parent f8393cc commit 8a7ea94

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/comp/front/parser.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,8 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool {
16831683
case (ast.expr_index(_,_,_)) { ret true; }
16841684
case (ast.expr_path(_,_,_)) { ret true; }
16851685
case (ast.expr_fail) { ret true; }
1686+
case (ast.expr_break) { ret true; }
1687+
case (ast.expr_cont) { ret true; }
16861688
case (ast.expr_ret(_)) { ret true; }
16871689
case (ast.expr_put(_)) { ret true; }
16881690
case (ast.expr_be(_)) { ret true; }

src/comp/pretty/pprust.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,12 @@ impure fn print_expr(ps s, &@ast.expr expr) {
553553
case (ast.expr_fail) {
554554
wrd(s.s, "fail");
555555
}
556+
case (ast.expr_break) {
557+
wrd(s.s, "break");
558+
}
559+
case (ast.expr_cont) {
560+
wrd(s.s, "cont");
561+
}
556562
case (ast.expr_ret(?result)) {
557563
wrd(s.s, "ret");
558564
alt (result) {

0 commit comments

Comments
 (0)