From 884b163b1cc7255ba5dacb637970e1609fac41dc Mon Sep 17 00:00:00 2001 From: ludverse <62475903+ludverse@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:15:50 +0200 Subject: [PATCH] allow negative ranges in for loops --- src/expressions/for.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expressions/for.rs b/src/expressions/for.rs index 4e594a6..4740647 100644 --- a/src/expressions/for.rs +++ b/src/expressions/for.rs @@ -39,7 +39,7 @@ impl Evaluable for ExprFor { Data::Number(start_i) => { match end_i { Data::Number(end_i) => { - for i in start_i as usize..end_i as usize { + for i in start_i as isize..end_i as isize { interpreter.memory.push_scope(); interpreter.memory.insert(self.index_var.to_string(), Data::Number(i as f64));