Skip to content

Commit

Permalink
allow negative ranges in for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
ludverse committed Apr 4, 2024
1 parent ae212d6 commit 884b163
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/expressions/for.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 884b163

Please sign in to comment.