diff dmd/CondExp.d @ 129:010eb8f0e18d

further work on dmd test suite
author korDen
date Sun, 05 Sep 2010 15:32:22 +0400
parents 9e39c7de8438
children 60bb0fe4563e
line wrap: on
line diff
--- a/dmd/CondExp.d	Sat Sep 04 01:33:05 2010 +0100
+++ b/dmd/CondExp.d	Sun Sep 05 15:32:22 2010 +0400
@@ -6,6 +6,7 @@
 import dmd.PtrExp;
 import dmd.MATCH;
 import dmd.Expression;
+import dmd.GlobalExpressions;
 import dmd.Scope;
 import dmd.InterState;
 import dmd.OutBuffer;
@@ -161,7 +162,20 @@
 	
     override Expression interpret(InterState istate)
 	{
-		assert(false);
+version (LOG) {
+		printf("CondExp.interpret() %.*s\n", toChars());
+}
+		Expression e = econd.interpret(istate);
+		if (e !is EXP_CANT_INTERPRET)
+		{
+			if (e.isBool(true))
+				e = e1.interpret(istate);
+			else if (e.isBool(false))
+				e = e2.interpret(istate);
+			else
+				e = EXP_CANT_INTERPRET;
+		}
+		return e;
 	}
 
     override void checkEscape()