@ -185,6 +185,10 @@ public final class Encoder implements ActualParameterVisitor<Frame, Integer>,
@Override
public Void visitRepeatCommand(RepeatCommand ast, Frame frame) {
var loopAddr = emitter.getNextInstrAddr();
ast.E.visit(this, frame);
ast.C.visit(this, frame);
emitter.emit(OpCode.JUMPIF, Machine.trueRep, Register.CB, loopAddr);
return null;
}
@ -188,6 +188,10 @@ public final class Checker implements ActualParameterVisitor<FormalParameter, Vo
public Void visitRepeatCommand(RepeatCommand ast, Void arg) {
var eType = ast.E.visit(this);
checkAndReportError(eType.equals(StdEnvironment.booleanType), "Boolean expression expected here", ast.E);
ast.C.visit(this);