From 1a84661c79799816bd31b44e1f6b3b5ad0d2020d Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 23 Jun 2019 12:58:01 +0200 Subject: [PATCH] Make zero step numerical for loop use the positive number evaluation --- src/Evaluator/Evaluator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Evaluator/Evaluator.cpp b/src/Evaluator/Evaluator.cpp index 6d30c41..a2d3b65 100644 --- a/src/Evaluator/Evaluator.cpp +++ b/src/Evaluator/Evaluator.cpp @@ -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(i)); for (auto s: *block->GetStatements()) {