From ed6d96f3f51cc6464ff03381ce6358dbf04fb560 Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Fri, 19 Jul 2019 15:47:46 +0200 Subject: [PATCH] Fix for-downto --- .../scala/millfork/compiler/AbstractStatementCompiler.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/millfork/compiler/AbstractStatementCompiler.scala b/src/main/scala/millfork/compiler/AbstractStatementCompiler.scala index 9970f587..8cef90f7 100644 --- a/src/main/scala/millfork/compiler/AbstractStatementCompiler.scala +++ b/src/main/scala/millfork/compiler/AbstractStatementCompiler.scala @@ -270,7 +270,7 @@ abstract class AbstractStatementCompiler[T <: AbstractCode] { )) case (ForDirection.DownTo, _, _) => // TODO: smarter countdown if end is not a constant - val endMinusOne = SumExpression(List(true -> f.end, false -> LiteralExpression(1, 1)), decimal = false).pos(p) + val endMinusOne = SumExpression(List(false -> f.end, true -> LiteralExpression(1, 1)), decimal = false).pos(p) compile(ctx, List( Assignment(vex, f.start).pos(p), IfStatement(