diff ast/Exp.d @ 119:c0b531362ca6

Non compileing commit. Work on floating points and casts
author Anders Johnsen <skabet@gmail.com>
date Sun, 25 May 2008 19:13:07 +0200
parents 3a0cd42de9cc
children 6a5f745d351c
line wrap: on
line diff
--- a/ast/Exp.d	Sun May 25 18:24:16 2008 +0200
+++ b/ast/Exp.d	Sun May 25 19:13:07 2008 +0200
@@ -11,6 +11,8 @@
 import sema.Scope,
        sema.DType;
 
+import basic.LiteralParsing;
+
 enum ExpType
 {
     Binary,
@@ -314,13 +316,30 @@
         return this;
     }
 
-    override DType type() { return DType.Int; }
+    override DType type() 
+    { 
+        switch(number.type)
+        {
+            case NumberType.Int:
+                return DType.Int;
+            case NumberType.Long:
+                return DType.Long;
+            case NumberType.ULong:
+                return DType.ULong;
+            case NumberType.Double:
+                return DType.Double;
+            case NumberType.Real:
+                return DType.Real;
+        }
+    }
 
     override SourceRange sourceRange()
     {
         return range;
     }
 
+    Number number;
+
     char[] name;
     private SourceRange range;
 }