diff dmd/CatExp.d @ 63:cab4c37afb89

A bunch of implementations
author korDen
date Mon, 23 Aug 2010 16:52:24 +0400
parents 10317f0c89a5
children 2e2a5c3f943a
line wrap: on
line diff
--- a/dmd/CatExp.d	Mon Aug 23 03:21:32 2010 +0400
+++ b/dmd/CatExp.d	Mon Aug 23 16:52:24 2010 +0400
@@ -153,9 +153,30 @@
 		return e;
 	}
 
-	Expression interpret(InterState* istate)
+	Expression interpret(InterState istate)
 	{
-		assert(false);
+		Expression e;
+		Expression e1;
+		Expression e2;
+
+version (LOG) {
+		printf("CatExp.interpret() %.*s\n", toChars());
+}
+		e1 = this.e1.interpret(istate);
+		if (e1 is EXP_CANT_INTERPRET)
+		{
+			goto Lcant;
+		}
+		e2 = this.e2.interpret(istate);
+		if (e2 is EXP_CANT_INTERPRET)
+			goto Lcant;
+		return Cat(type, e1, e2);
+
+	Lcant:
+version (LOG) {
+		printf("CatExp.interpret() %.*s CANT\n", toChars());
+}
+		return EXP_CANT_INTERPRET;
 	}
 
 	Identifier opId()