diff trunk/src/dil/ast/DefaultVisitor.d @ 791:5fe89bb8cbdd

Implemented syntax tree copying.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 26 Feb 2008 20:13:41 +0100
parents 3b34f6a95a27
children cf2ad5df025c
line wrap: on
line diff
--- a/trunk/src/dil/ast/DefaultVisitor.d	Mon Feb 25 03:37:20 2008 +0100
+++ b/trunk/src/dil/ast/DefaultVisitor.d	Tue Feb 26 20:13:41 2008 +0100
@@ -109,7 +109,7 @@
     static if (is(E == IllegalExpression))
     {}
     else
-    static if (is(E : CondExpression))
+    static if (is(E == CondExpression))
       visitE(e.condition), visitE(e.lhs), visitE(e.rhs);
     else
     static if (is(E : BinaryExpression))
@@ -192,8 +192,8 @@
   {
     alias T S;
     static if (is(S == CompoundStatement))
-      foreach (node; s.children)
-        visitS(cast(Statement)cast(void*)node);
+      foreach (stmnt; s.stmnts)
+        visitS(stmnt);
     //IllegalStatement has no subnodes.
     static if (is(S == FuncBodyStatement))
       s.funcBody && visitS(s.funcBody),
@@ -265,7 +265,8 @@
     static if (is(S == AsmStatement))
       foreach (op; s.operands)
         visitE(op);
-    //AsmAlignStatement has no subnodes.
+    //AsmAlignStatement,
+    //IllegalAsmStatement have no subnodes.
     static if (is(S == PragmaStatement))
     {
       foreach (arg; s.args)
@@ -342,7 +343,7 @@
     //TemplateTupleParameter has no subnodes.
   }
   else
-    assert(0, "Missing default visit method for: "~t.classinfo.name);
+    static assert(0, "Missing default visit method for: "~typeof(t).stringof);
   return t;
 }