changeset 116:352a5164f692

small bugfixes
author Trass3r
date Thu, 02 Sep 2010 02:49:29 +0200
parents 6caaf0256da1
children fe941d774f4a
files dmd/BinExp.d dmd/PragmaDeclaration.d
diffstat 2 files changed, 49 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/BinExp.d	Thu Sep 02 01:29:29 2010 +0200
+++ b/dmd/BinExp.d	Thu Sep 02 02:49:29 2010 +0200
@@ -677,74 +677,75 @@
 
 	Expression interpretCommon(InterState istate, Expression function(Type, Expression, Expression) fp)
 	{
-		   Expression e;
-			Expression e1;
-			Expression e2;
+		Expression e;
+		Expression e1;
+		Expression e2;
 
 version(LOG)
 {
-			writef("BinExp::interpretCommon() %s\n", toChars());
+		writef("BinExp::interpretCommon() %s\n", toChars());
 }
-			e1 = this.e1.interpret(istate);
-			if (e1 == EXP_CANT_INTERPRET)
-				goto Lcant;
-			if (e1.isConst() != 1)
-				goto Lcant;
+		e1 = this.e1.interpret(istate);
+		if (e1 is EXP_CANT_INTERPRET)
+			goto Lcant;
+		if (e1.isConst() != 1)
+			goto Lcant;
 
-			e2 = this.e2.interpret(istate);
-			if (e2 == EXP_CANT_INTERPRET)
-				goto Lcant;
-			if (e2.isConst() != 1)
-				goto Lcant;
+		e2 = this.e2.interpret(istate);
+		if (e2 is EXP_CANT_INTERPRET)
+			goto Lcant;
+		if (e2.isConst() != 1)
+			goto Lcant;
 
-			e = fp(type, e1, e2);
-			return e;
+		e = fp(type, e1, e2);
+		return e;
 
-		Lcant:
-			return EXP_CANT_INTERPRET;
+	Lcant:
+		return EXP_CANT_INTERPRET;
 	}
 
 	Expression interpretCommon2(InterState istate, Expression function(TOK, Type, Expression, Expression) fp)
 	{
-		   Expression e;
-			Expression e1;
-			Expression e2;
+		Expression e;
+		Expression e1;
+		Expression e2;
 
 version(LOG)
 {
-			writef("BinExp::interpretCommon2() %s\n", toChars());
+		writef("BinExp::interpretCommon2() %s\n", toChars());
 }
-			e1 = this.e1.interpret(istate);
-			if (e1 == EXP_CANT_INTERPRET)
-				goto Lcant;
-			if (e1.isConst() != 1 &&
-				e1.op != TOKnull &&
-				e1.op != TOKstring &&
-				e1.op != TOKarrayliteral &&
-				e1.op != TOKstructliteral)
-				goto Lcant;
+		e1 = this.e1.interpret(istate);
+		if (e1 is EXP_CANT_INTERPRET)
+			goto Lcant;
+		if (e1.isConst() != 1 &&
+			e1.op != TOKnull &&
+			e1.op != TOKstring &&
+			e1.op != TOKarrayliteral &&
+			e1.op != TOKstructliteral)
+			goto Lcant;
 
-			e2 = this.e2.interpret(istate);
-			if (e2 == EXP_CANT_INTERPRET)
-				goto Lcant;
-			if (e2.isConst() != 1 &&
-				e2.op != TOKnull &&
-				e2.op != TOKstring &&
-				e2.op != TOKarrayliteral &&
-				e2.op != TOKstructliteral)
-				goto Lcant;
+		e2 = this.e2.interpret(istate);
+		if (e2 is EXP_CANT_INTERPRET)
+			goto Lcant;
+		if (e2.isConst() != 1 &&
+			e2.op != TOKnull &&
+			e2.op != TOKstring &&
+			e2.op != TOKarrayliteral &&
+			e2.op != TOKstructliteral)
+			goto Lcant;
 
-			e = fp(op, type, e1, e2);
-			return e;
+		e = fp(op, type, e1, e2);
+		return e;
 
-		Lcant:
-			return EXP_CANT_INTERPRET;
+	Lcant:
+		return EXP_CANT_INTERPRET;
 	}
 	
-    Expression interpretAssignCommon(InterState istate, Expression (*fp)(Type, Expression, Expression), int post = 0)
+    Expression interpretAssignCommon(InterState istate, Expression function(Type, Expression, Expression) fp, int post = 0)
 	{
-version (LOG) {
-		printf("BinExp.interpretAssignCommon() %.*s\n", toChars());
+version (LOG)
+{
+		writef("BinExp.interpretAssignCommon() %.*s\n", toChars());
 }
 		Expression e = EXP_CANT_INTERPRET;
 		Expression e1 = this.e1;
--- a/dmd/PragmaDeclaration.d	Thu Sep 02 01:29:29 2010 +0200
+++ b/dmd/PragmaDeclaration.d	Thu Sep 02 02:49:29 2010 +0200
@@ -61,7 +61,7 @@
 					if (e.op == TOKstring)
 					{
 						auto se = cast(StringExp)e;
-						writef("%s", se.toChars()[1..$-3] /*se.len, cast(char*)se.string_*/);
+						writef("%s", se.toChars()[1..$-2] /*se.len, cast(char*)se.string_*/);
 					}
 					else
 						writef(e.toChars());