Make zero step numerical for loop use the positive number evaluation

This commit is contained in:
Deukhoofd 2019-06-23 12:58:01 +02:00
parent e472dcec1c
commit 1a84661c79
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 1 additions and 1 deletions

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()) {