Make zero step numerical for loop use the positive number evaluation

This commit is contained in:
2019-06-23 12:58:01 +02:00
parent e472dcec1c
commit 1a84661c79

View File

@@ -129,7 +129,7 @@ namespace Porygon::Evaluation {
auto identifier = statement -> GetIdentifier();
this -> _evaluationScope -> CreateVariable(identifier, nullptr);
auto block = (BoundBlockStatement*)statement -> GetBlock();
if (step > 0){
if (step >= 0){
for (long i = start; i <= end; i += step){
this -> _evaluationScope -> SetVariable(identifier, make_shared<IntegerEvalValue>(i));
for (auto s: *block->GetStatements()) {