Add parens, as needed, around else-if conditions.
This commit is contained in:
parent
2c6eba00dd
commit
ce1877dc8e
2 changed files with 10 additions and 3 deletions
|
|
@ -625,7 +625,7 @@ fn print_if(s: ps, test: @ast::expr, blk: ast::blk,
|
|||
cbox(s, indent_unit - 1u);
|
||||
ibox(s, 0u);
|
||||
word(s.s, " else if ");
|
||||
print_expr(s, i);
|
||||
print_maybe_parens_discrim(s, i);
|
||||
space(s.s);
|
||||
print_block(s, t);
|
||||
do_else(s, e);
|
||||
|
|
|
|||
|
|
@ -21,8 +21,15 @@ fn what() {
|
|||
}
|
||||
|
||||
fn zombiejesus() {
|
||||
do { while (ret) { if (ret) { alt (ret) { _ { ret ? ret : ret } } } } }
|
||||
while ret
|
||||
do {
|
||||
while (ret) {
|
||||
if (ret) {
|
||||
alt (ret) { _ { ret ? ret : ret } };
|
||||
} else if (ret) {
|
||||
ret;
|
||||
}
|
||||
}
|
||||
} while ret
|
||||
}
|
||||
|
||||
fn notsure() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue