e181c0dc07
You can now assign to the range end variable and the for-loop still works correctly. This fully addresses issue #565. Also fixed a bug with the stack not being fully popped when breaking out of an optimised for-loop (and it's actually impossible to write a test for this case!).
12 lines
261 B
Python
12 lines
261 B
Python
# test assigning to iterator within the loop
|
|
for i in range(2):
|
|
print(i)
|
|
i = 2
|
|
|
|
# test assigning to range parameter within the loop
|
|
# (since we optimise for loops, this needs checking, currently it fails)
|
|
n = 2
|
|
for i in range(n):
|
|
print(i)
|
|
n = 0
|