1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-06-09 16:29:34 +00:00

A for-loop index variable is also a used variable

This commit is contained in:
Karol Stasiak 2017-12-18 01:00:17 +01:00
parent a62f16d0a9
commit ae1bc96da7

View File

@ -163,7 +163,7 @@ object ForDirection extends Enumeration {
}
case class ForStatement(variable: String, start: Expression, end: Expression, direction: ForDirection.Value, body: List[ExecutableStatement]) extends ExecutableStatement {
override def getAllExpressions: List[Expression] = start :: end :: body.flatMap(_.getAllExpressions)
override def getAllExpressions: List[Expression] = VariableExpression(variable) :: start :: end :: body.flatMap(_.getAllExpressions)
}
case class DoWhileStatement(body: List[ExecutableStatement], condition: Expression) extends ExecutableStatement {