Mercurial > projects > dang
diff tools/AstPrinter.d @ 195:4e1a7265d620
Made a BuildTypes pass, to give all exp's a type.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 29 Jul 2008 15:50:24 +0200 |
parents | dc9bf56b7ace |
children |
line wrap: on
line diff
--- a/tools/AstPrinter.d Tue Jul 29 13:54:44 2008 +0200 +++ b/tools/AstPrinter.d Tue Jul 29 15:50:24 2008 +0200 @@ -139,6 +139,24 @@ } printEndLine(";"); break; + case StmtType.If: + auto i = cast(IfStmt)stmt; + printBeginLine("if"); + print(" ("); + printExp(i.cond); + printEndLine(" )"); + printOpenBrace; + printStatement(i.then_body); + printCloseBrace; + if (i.else_body) + { + printBeginLine("else"); + printEndLine(); + printOpenBrace; + printStatement(i.else_body); + printCloseBrace; + } + break; case StmtType.Decl: auto declStmt = cast(DeclStmt)stmt; printDecl(declStmt.decl, false);