@@ -59,6 +59,10 @@ typedef enum {
5959#define MP_EMIT_IDOP_LOCAL_FAST (0)
6060#define MP_EMIT_IDOP_LOCAL_DEREF (1)
6161
62+ // Kind for emit->yield()
63+ #define MP_EMIT_YIELD_VALUE (0)
64+ #define MP_EMIT_YIELD_FROM (1)
65+
6266typedef struct _emit_t emit_t ;
6367
6468typedef struct _mp_emit_method_table_id_ops_t {
@@ -137,8 +141,7 @@ typedef struct _emit_method_table_t {
137141 void (* call_method )(emit_t * emit , mp_uint_t n_positional , mp_uint_t n_keyword , mp_uint_t star_flags );
138142 void (* return_value )(emit_t * emit );
139143 void (* raise_varargs )(emit_t * emit , mp_uint_t n_args );
140- void (* yield_value )(emit_t * emit );
141- void (* yield_from )(emit_t * emit );
144+ void (* yield )(emit_t * emit , int kind );
142145
143146 // these methods are used to control entry to/exit from an exception handler
144147 // they may or may not emit code
@@ -252,8 +255,7 @@ void mp_emit_bc_call_function(emit_t *emit, mp_uint_t n_positional, mp_uint_t n_
252255void mp_emit_bc_call_method (emit_t * emit , mp_uint_t n_positional , mp_uint_t n_keyword , mp_uint_t star_flags );
253256void mp_emit_bc_return_value (emit_t * emit );
254257void mp_emit_bc_raise_varargs (emit_t * emit , mp_uint_t n_args );
255- void mp_emit_bc_yield_value (emit_t * emit );
256- void mp_emit_bc_yield_from (emit_t * emit );
258+ void mp_emit_bc_yield (emit_t * emit , int kind );
257259void mp_emit_bc_start_except_handler (emit_t * emit );
258260void mp_emit_bc_end_except_handler (emit_t * emit );
259261
0 commit comments