diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-03-30 23:14:55 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-03-30 23:30:16 +0300 |
commit | f39d3b93da4b9205a095430e12472051c6b22ef6 (patch) | |
tree | b2f56443f9646bef8035b4a527f1d1f533e6196e /py/runtime.h | |
parent | a30cf9f3aff671ada1c84a1977ecf96d473d7256 (diff) |
py: Implement support for generalized generator protocol.
Iterators and ducktype objects can now be arguments of yield from.
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h index 8487309a1..f79cb2e30 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -1,3 +1,9 @@ +typedef enum { + MP_VM_RETURN_NORMAL, + MP_VM_RETURN_YIELD, + MP_VM_RETURN_EXCEPTION, +} mp_vm_return_kind_t; + void mp_init(void); void mp_deinit(void); @@ -55,6 +61,7 @@ void mp_store_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t val); mp_obj_t mp_getiter(mp_obj_t o); mp_obj_t mp_iternext_allow_raise(mp_obj_t o); // may return MP_OBJ_NULL instead of raising StopIteration() mp_obj_t mp_iternext(mp_obj_t o); // will always return MP_OBJ_NULL instead of raising StopIteration(...) +mp_vm_return_kind_t mp_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val); mp_obj_t mp_make_raise_obj(mp_obj_t o); |