diff src/dil/semantic/Pass2.d @ 820:1d06b4aed7cf

Revised code in the first pass. Added code to handle anonymous unions and structs. Hope the idea will work. Added type to class Aggregate and isAnonymous to some other Symbol classes.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Fri, 14 Mar 2008 15:42:08 +0100
parents 525ee3f848d9
children fd52beaaa94a
line wrap: on
line diff
--- a/src/dil/semantic/Pass2.d	Thu Mar 13 18:59:54 2008 +0100
+++ b/src/dil/semantic/Pass2.d	Fri Mar 14 15:42:08 2008 +0100
@@ -134,7 +134,10 @@
     Type type = Types.Int; // Default to int.
     if (d.baseType)
       type = visitT(d.baseType).type;
-    d.symbol.type = new TypeEnum(d.symbol, type);
+    // Set the enum's base type.
+    d.symbol.type.baseType = type;
+
+    // TODO: check base type. must be basic type or another enum.
 
     enterScope(d.symbol);
 
@@ -151,7 +154,6 @@
       }
       //else
         // TODO: increment a number variable and assign that to value.
-      member.symbol.type = d.symbol.type; // Assign TypeEnum.
       member.symbol.value = finalValue;
       member.symbol.setComplete();
     }