diff ast/Exp.d @ 81:110c7e1c4ca2 new_gen

Now you can declare array
author Anders Johnsen <skabet@gmail.com>
date Fri, 02 May 2008 18:23:33 +0200
parents 682e20aa224f
children 9e90694f5da0
line wrap: on
line diff
--- a/ast/Exp.d	Fri May 02 17:33:50 2008 +0200
+++ b/ast/Exp.d	Fri May 02 18:23:33 2008 +0200
@@ -372,21 +372,21 @@
 
 class ArrayIdentifier : Identifier
 {
-    this(Identifier arrayOf)
+    this(Identifier arrayOf, IntegerLit size)
     {
         super(ExpType.ArrayIdentifier);
         this.arrayOf = arrayOf;
+        this.size = Integer.parse(size.get);
+        this.name = arrayOf.name;
     }
 
     override DType type()
     {
-        if (myType !is null)
-            return myType;
-        myType = new DArray(arrayOf.type);
-        return myType;
+        return arrayOf.type.getAsArray(size);
     }
 
     Identifier arrayOf;
+    int size;
 
     private DType myType;
 }