format all the things!

This commit is contained in:
jaredlll08 committed 2015-08-31 19:15:35 +02:00
1 parent 54ec75fd3d
commit b36c6dade6
377 files changed
+6833 -6772

No files matched your search

@@ -21,10 +21,10 @@ import stanhebben.zenscript.util.ZenPosition;
public class ExpressionCompareGeneric extends Expression {
private final Expression value; // should return a compareTo value (<=>0)
private final CompareType type;
public ExpressionCompareGeneric(ZenPosition position, Expression value, CompareType type) {
super(position);
this.value = value;
this.type = type;
}
@@ -35,24 +35,37 @@ public class ExpressionCompareGeneric extends Expression {
}
@Override
public void compile(boolean result, IEnvironmentMethod environment) {;
public void compile(boolean result, IEnvironmentMethod environment) {
;
value.compile(result, environment);
if (result) {
MethodOutput output = environment.getOutput();
Label lblThen = new Label();
Label lblEnd = new Label();
switch (type) {
case LT: output.ifLT(lblThen); break;
case GT: output.ifGT(lblThen); break;
case LE: output.ifLE(lblThen); break;
case GE: output.ifGE(lblThen); break;
case NE: output.ifNE(lblThen); break;
case EQ: output.ifEQ(lblThen); break;
case LT:
output.ifLT(lblThen);
break;
case GT:
output.ifGT(lblThen);
break;
case LE:
output.ifLE(lblThen);
break;
case GE:
output.ifGE(lblThen);
break;
case NE:
output.ifNE(lblThen);
break;
case EQ:
output.ifEQ(lblThen);
break;
default:
throw new RuntimeException();
}
output.iConst0();
output.goTo(lblEnd);
output.label(lblThen);