mirror of
https://github.com/KarolS/millfork.git
synced 2024-10-05 18:57:18 +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, _, _) =>
|
case (ForDirection.DownTo, _, _) =>
|
||||||
// TODO: smarter countdown if end is not a constant
|
// 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(
|
compile(ctx, List(
|
||||||
Assignment(vex, f.start).pos(p),
|
Assignment(vex, f.start).pos(p),
|
||||||
IfStatement(
|
IfStatement(
|
||||||
|
Loading…
Reference in New Issue
Block a user