|
|
@ -588,8 +588,16 @@ public class ConstantFolder implements ActualParameterVisitor<Void, AbstractSynt |
|
|
|
|
|
|
|
|
|
|
|
if (o.decl == StdEnvironment.addDecl) { |
|
|
|
if (o.decl == StdEnvironment.addDecl) { |
|
|
|
foldedValue = int1 + int2; |
|
|
|
foldedValue = int1 + int2; |
|
|
|
|
|
|
|
} else if(o.decl == StdEnvironment.multiplyDecl) { |
|
|
|
|
|
|
|
foldedValue = int1 * int2; |
|
|
|
|
|
|
|
} else if(o.decl == StdEnvironment.subtractDecl) { |
|
|
|
|
|
|
|
foldedValue = int1 - int2; |
|
|
|
|
|
|
|
} else if(o.decl == StdEnvironment.moduloDecl) { |
|
|
|
|
|
|
|
foldedValue = int1 % int2; |
|
|
|
|
|
|
|
} else if(o.decl == StdEnvironment.divideDecl) { |
|
|
|
|
|
|
|
foldedValue = int1 / int2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (foldedValue instanceof Integer) { |
|
|
|
if (foldedValue instanceof Integer) { |
|
|
|
IntegerLiteral il = new IntegerLiteral(foldedValue.toString(), node1.getPosition()); |
|
|
|
IntegerLiteral il = new IntegerLiteral(foldedValue.toString(), node1.getPosition()); |
|
|
|
IntegerExpression ie = new IntegerExpression(il, node1.getPosition()); |
|
|
|
IntegerExpression ie = new IntegerExpression(il, node1.getPosition()); |
|
|
|