|
@@ -317,7 +317,7 @@ export class IVProgProcessor {
|
|
*/
|
|
*/
|
|
executeFor (store, cmd) {
|
|
executeFor (store, cmd) {
|
|
//BEGIN for -> while rewrite
|
|
//BEGIN for -> while rewrite
|
|
- const initCmd = new Commands.Assign(cmd.for_id, cmd.for_from);
|
|
|
|
|
|
+ const initCmd = new Commands.Assign(cmd.for_id.id, cmd.for_from);
|
|
initCmd.sourceInfo = cmd.sourceInfo;
|
|
initCmd.sourceInfo = cmd.sourceInfo;
|
|
const is_forward_exp = new Expressions.InfixApp(Operators.GE, cmd.for_to, cmd.for_from);
|
|
const is_forward_exp = new Expressions.InfixApp(Operators.GE, cmd.for_to, cmd.for_from);
|
|
return this.evaluateExpression(store, is_forward_exp).then (result => {
|
|
return this.evaluateExpression(store, is_forward_exp).then (result => {
|
|
@@ -337,7 +337,7 @@ export class IVProgProcessor {
|
|
pass_value = new Expressions.IntLiteral(toInt(-1));
|
|
pass_value = new Expressions.IntLiteral(toInt(-1));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- const increment = new Commands.Assign(cmd.for_id,
|
|
|
|
|
|
+ const increment = new Commands.Assign(cmd.for_id.id,
|
|
new Expressions.InfixApp(Operators.ADD, cmd.for_id, pass_value));
|
|
new Expressions.InfixApp(Operators.ADD, cmd.for_id, pass_value));
|
|
increment.sourceInfo = cmd.sourceInfo;
|
|
increment.sourceInfo = cmd.sourceInfo;
|
|
const whileBlock = new Commands.CommandBlock([],
|
|
const whileBlock = new Commands.CommandBlock([],
|