public override void VisitElseClause(ElseClause node) { NewLine(); Append("else"); var isIf = node.Body is IfStatement; if (!isIf) { NewLine(); Append("{"); Indent(); NewLine(); } else { Append(" "); } node.Body.Accept(this); if (!isIf) { Outdent(); Append("}"); } }
public IfStatement(Node condition, Node body, ElseClause elseClause) { Condition = condition; Body = body; ElseClause = elseClause; SetParent(Condition); SetParent(Body); SetParent(ElseClause); }