Support break and cont in pretty-printer
This commit is contained in:
parent
f8393cc572
commit
8a7ea941bb
2 changed files with 8 additions and 0 deletions
|
@ -1683,6 +1683,8 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool {
|
||||||
case (ast.expr_index(_,_,_)) { ret true; }
|
case (ast.expr_index(_,_,_)) { ret true; }
|
||||||
case (ast.expr_path(_,_,_)) { ret true; }
|
case (ast.expr_path(_,_,_)) { ret true; }
|
||||||
case (ast.expr_fail) { 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_ret(_)) { ret true; }
|
||||||
case (ast.expr_put(_)) { ret true; }
|
case (ast.expr_put(_)) { ret true; }
|
||||||
case (ast.expr_be(_)) { ret true; }
|
case (ast.expr_be(_)) { ret true; }
|
||||||
|
|
|
@ -553,6 +553,12 @@ impure fn print_expr(ps s, &@ast.expr expr) {
|
||||||
case (ast.expr_fail) {
|
case (ast.expr_fail) {
|
||||||
wrd(s.s, "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)) {
|
case (ast.expr_ret(?result)) {
|
||||||
wrd(s.s, "ret");
|
wrd(s.s, "ret");
|
||||||
alt (result) {
|
alt (result) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue