changeset 547:a6b43f87ee0c

Added semantic() method to BoolExpression.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 19 Dec 2007 21:54:54 +0100
parents 57f5b08b8313
children faf16f4e7fc8
files trunk/src/dil/Expressions.d
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/Expressions.d	Wed Dec 19 21:03:15 2007 +0100
+++ b/trunk/src/dil/Expressions.d	Wed Dec 19 21:54:54 2007 +0100
@@ -729,6 +729,18 @@
   {
     mixin(set_kind);
   }
+
+  Expression e;
+  Expression semantic(Scope scop)
+  {
+    if (type)
+      return this;
+    assert(this.begin !is null);
+    auto b = (this.begin.type == TOK.True) ? true : false;
+    e = new IntExpression(b, Types.Bool);
+    type = Types.Bool;
+    return this;
+  }
 }
 
 class IntExpression : Expression