changeset 541:c0f5b1f78a55

Added ComplexExpression.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 19 Dec 2007 16:27:15 +0100
parents 660684f559a4
children 743b0390d20a
files trunk/src/dil/Expressions.d
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/Expressions.d	Tue Dec 18 22:49:52 2007 +0100
+++ b/trunk/src/dil/Expressions.d	Wed Dec 19 16:27:15 2007 +0100
@@ -808,6 +808,30 @@
   }
 }
 
+/++
+  This expression holds a complex number.
+  It is only created in the semantic phase.
++/
+class ComplexExpression : Expression
+{
+  creal number;
+
+  this(creal number, Type type)
+  {
+    mixin(set_kind);
+    this.number = number;
+    this.type = type;
+  }
+
+  Expression semantic(Scope)
+  {
+    if (type)
+      return this;
+    type = Types.Cdouble;
+    return this;
+  }
+}
+
 class CharExpression : Expression
 {
   dchar character;