mirror of
https://github.com/KarolS/millfork.git
synced 2025-04-13 21:37:08 +00:00
Fix for-downto
This commit is contained in:
parent
49d176fb3c
commit
ed6d96f3f5
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user