diff options
author | Damien George <damien.p.george@gmail.com> | 2014-12-12 17:19:56 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-12-12 17:19:56 +0000 |
commit | e181c0dc07c32408d7584ef5b078cd3e88076d3f (patch) | |
tree | 626f340b4c82a0336cc3e4e73431deb051189a06 /tests/basics/for3.py | |
parent | 7764f163fa54dc39532f7729c774ab92611bb115 (diff) |
py: Fix optimised for-loop compiler so it follows proper semantics.
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!).
Diffstat (limited to 'tests/basics/for3.py')
-rw-r--r-- | tests/basics/for3.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/basics/for3.py b/tests/basics/for3.py index ffa1be244..56617df49 100644 --- a/tests/basics/for3.py +++ b/tests/basics/for3.py @@ -5,7 +5,7 @@ for i in range(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 +n = 2 +for i in range(n): + print(i) + n = 0 |