[pypy-svn] r66633 - in pypy/branch/io-lang/pypy/lang/io: . test
david at codespeak.net
david at codespeak.net
Sat Jul 25 21:16:01 CEST 2009
Author: david
Date: Sat Jul 25 21:16:01 2009
New Revision: 66633
Modified:
pypy/branch/io-lang/pypy/lang/io/object.py
pypy/branch/io-lang/pypy/lang/io/test/test_object.py
Log:
Support for continue in for loops
Modified: pypy/branch/io-lang/pypy/lang/io/object.py
==============================================================================
--- pypy/branch/io-lang/pypy/lang/io/object.py (original)
+++ pypy/branch/io-lang/pypy/lang/io/object.py Sat Jul 25 21:16:01 2009
@@ -119,4 +119,8 @@
w_result = w_message.arguments[0].eval(space, w_context, w_context)
space.break_status(w_result)
return w_target
-
\ No newline at end of file
+
+
+ at register_method('Object', 'continue')
+def object_continue(space, w_target, w_message, w_context):
+ space.continue_status()
\ No newline at end of file
Modified: pypy/branch/io-lang/pypy/lang/io/test/test_object.py
==============================================================================
--- pypy/branch/io-lang/pypy/lang/io/test/test_object.py (original)
+++ pypy/branch/io-lang/pypy/lang/io/test/test_object.py Sat Jul 25 21:16:01 2009
@@ -134,4 +134,11 @@
inp = """for(x, 7, 1000, break(-1))
"""
res, _ = interpret(inp)
- assert res.value == -1
\ No newline at end of file
+ assert res.value == -1
+
+def test_object_continue():
+ inp = """a := list()
+ for(x, 1, 10, continue; a append(x))
+ a"""
+ res, space = interpret(inp)
+ assert len(res.items) == 0
\ No newline at end of file
More information about the Pypy-commit
mailing list