py/emitnative: Implement yield and yield-from in native emitter.
This commit adds first class support for yield and yield-from in the native emitter, including send and throw support, and yields enclosed in exception handlers (which requires pulling down the NLR stack before yielding, then rebuilding it when resuming). This has been fully tested and is working on unix x86 and x86-64, and stm32. Also basic tests have been done with the esp8266 port. Performance of existing native code is unchanged.
This commit is contained in:
1
py/obj.h
1
py/obj.h
@@ -558,6 +558,7 @@ extern const mp_obj_type_t mp_type_zip;
|
||||
extern const mp_obj_type_t mp_type_array;
|
||||
extern const mp_obj_type_t mp_type_super;
|
||||
extern const mp_obj_type_t mp_type_gen_wrap;
|
||||
extern const mp_obj_type_t mp_type_native_gen_wrap;
|
||||
extern const mp_obj_type_t mp_type_gen_instance;
|
||||
extern const mp_obj_type_t mp_type_fun_builtin_0;
|
||||
extern const mp_obj_type_t mp_type_fun_builtin_1;
|
||||
|
||||
Reference in New Issue
Block a user