Merge branch 'master' into lib

lib
Avril 3 years ago
commit b49d25b4dd
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -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_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)
// ---

@ -53,7 +53,7 @@ int main()
sm_state_setopt(state, INTERMEDIATE_RETURNS, false);
sm_output output;
int out_int;
int out_int=0;
while(sm_next(&gen, state, &output)) {
if(!sm_output_value(output, &out_int))
continue;

Loading…
Cancel
Save