py: Implement break and continue byte codes, and add tests.
Also fixes a bug in the for-in-range optimiser. I hope to remove break and continue byte codes in the future and just use jump (if possible).
This commit is contained in:
16
tests/basics/continue.py
Normal file
16
tests/basics/continue.py
Normal file
@@ -0,0 +1,16 @@
|
||||
for i in range(4):
|
||||
print('one', i)
|
||||
if i > 2:
|
||||
continue
|
||||
print('two', i)
|
||||
|
||||
for i in range(4):
|
||||
print('one', i)
|
||||
if i < 2:
|
||||
continue
|
||||
print('two', i)
|
||||
|
||||
for i in [1, 2, 3, 4]:
|
||||
if i == 3:
|
||||
continue
|
||||
print(i)
|
||||
Reference in New Issue
Block a user