diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-21 23:48:04 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-21 23:48:04 +0000 |
commit | 600ae734cf3d0ca5274086b897f1ebaf20cf9d20 (patch) | |
tree | 5d05831a589eb5dd614a23dfae01c0fae74f0b93 /tests/basics/break.py | |
parent | 2c302563820d18be5fcfed406582ea5edaa6b39f (diff) |
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).
Diffstat (limited to 'tests/basics/break.py')
-rw-r--r-- | tests/basics/break.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/break.py b/tests/basics/break.py new file mode 100644 index 000000000..c303ea0b3 --- /dev/null +++ b/tests/basics/break.py @@ -0,0 +1,13 @@ +while True: + break + +for i in range(4): + print('one', i) + if i > 2: + break + print('two', i) + +for i in [1, 2, 3, 4]: + if i == 3: + break + print(i) |