diff sema/AstAction.d @ 143:d76cc5cad4fc

Added partial support for switches. Added support for extern(C) in CodeGen.
author Anders Johnsen <skabet@gmail.com>
date Mon, 21 Jul 2008 01:05:20 +0200
parents 2be29b296081
children 6e6355fb5f0f
line wrap: on
line diff
--- a/sema/AstAction.d	Sun Jul 20 23:41:53 2008 +0200
+++ b/sema/AstAction.d	Mon Jul 21 01:05:20 2008 +0200
@@ -173,6 +173,23 @@
         return new DeclStmt(d);
     }
 
+    override StmtT actOnStartOfSwitchStmt(ExprT exp)
+    {
+        return new SwitchStmt(cast(Exp)exp);
+    }
+
+    override void actOnCaseStmt(StmtT stmt, ExprT[] exps, StmtT[] stmts)
+    {
+        auto sw = cast(SwitchStmt)stmt;
+        sw.addCase(cast(Exp[])exps, cast(Stmt[])stmts);
+    }
+
+    override void actOnDefaultStmt(StmtT stmt, StmtT[] stmts)
+    {
+        auto sw = cast(SwitchStmt)stmt;
+        sw.setDefault(cast(Stmt[])stmts);
+    }
+
     // -- Expressions --
     override ExprT actOnNumericConstant(Token c)
     {