- formatted += format("\n%selse\n", string(indent*2, ' '));
- SetForScope<unsigned> set(else_if, 2);
- cond.else_body.visit(*this);
+ Conditional *else_cond = dynamic_cast<Conditional *>(cond.else_body.body.front().get());
+ if(cond.else_body.body.size()==1 && else_cond)
+ {
+ append(format("\n%selse ", string(indent*2, ' ')));
+ else_cond->visit(*this);
+ }
+ else
+ {
+ append(format("\n%selse\n", string(indent*2, ' ')));
+ cond.else_body.visit(*this);
+ }