mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 16:28:04 +00:00
Updated TypedBinary
This commit is contained in:
parent
adf00a1803
commit
3ca35151a4
@ -55,14 +55,7 @@ public class TypedBinary implements TypedExpression {
|
|||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Type mismatch in " + op);
|
throw new RuntimeException("Type mismatch in " + op);
|
||||||
}
|
}
|
||||||
} else if (op == Operator.AND || op == Operator.OR) {
|
} else if(op == Operator.EQ || op == Operator.NE || op == Operator.AND || op == Operator.OR){
|
||||||
if (leftType == Type.BOOL && rightType == Type.BOOL) {
|
|
||||||
type = Type.BOOL;
|
|
||||||
return Type.BOOL;
|
|
||||||
} else {
|
|
||||||
throw new RuntimeException("Type mismatch in " + op);
|
|
||||||
}
|
|
||||||
} else if(op == Operator.EQ || op == Operator.NE){
|
|
||||||
if(leftType == Type.INT && rightType == Type.INT || leftType == Type.BOOL && rightType == Type.BOOL){
|
if(leftType == Type.INT && rightType == Type.INT || leftType == Type.BOOL && rightType == Type.BOOL){
|
||||||
type = Type.BOOL;
|
type = Type.BOOL;
|
||||||
return Type.BOOL;
|
return Type.BOOL;
|
||||||
|
Loading…
Reference in New Issue
Block a user