From e181c0dc07c32408d7584ef5b078cd3e88076d3f Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 12 Dec 2014 17:19:56 +0000 Subject: 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!). --- tests/basics/for3.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3