|
|
@ -101,6 +101,9 @@ inline sm_yield sm_continue() { return (sm_yield)_sm_noop; }
|
|
|
|
#define SM_YIELD(v) do { state->current->pc = __LINE__; return (sm_yield)(v); case __LINE__:; } while(0)
|
|
|
|
#define SM_YIELD(v) do { state->current->pc = __LINE__; return (sm_yield)(v); case __LINE__:; } while(0)
|
|
|
|
#define SM_YIELD_VALUE(v) do { _sm_replace_ip(&state->current->rval, (v)); SM_YIELD(sm_continue()); } while(0)
|
|
|
|
#define SM_YIELD_VALUE(v) do { _sm_replace_ip(&state->current->rval, (v)); SM_YIELD(sm_continue()); } while(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define SM_RETURN() SM_YIELD(sm_end())
|
|
|
|
|
|
|
|
#define SM_RETURN_VALUE(v) do { _sm_replace_ip(&state->current->rval, (v)); SM_YIELD(sm_end()); } while(0)
|
|
|
|
|
|
|
|
|
|
|
|
#define SM_GENERATOR(name) sm_yield name(sm_state* state)
|
|
|
|
#define SM_GENERATOR(name) sm_yield name(sm_state* state)
|
|
|
|
|
|
|
|
|
|
|
|
// ---
|
|
|
|
// ---
|
|
|
|