implemented the while expression handling. break and continue yet to be implemented

This commit is contained in:
hyunghwan.chung
2017-01-25 13:57:14 +00:00
parent 6209b13410
commit b7a19a3b14
4 changed files with 165 additions and 21 deletions

View File

@ -3937,15 +3937,18 @@ int moo_execute (moo_t* moo)
}
}
/* the origin must always be a method context for both an active block context
* or an active method context */
MOO_ASSERT (moo, MOO_CLASSOF(moo, moo->active_context->origin) == moo->_method_context);
/* restore the stack pointer */
moo->sp = MOO_OOP_TO_SMOOI(moo->active_context->origin->sp);
if (bcode == BCODE_LOCAL_RETURN && moo->active_context != moo->active_context->origin)
{
SWITCH_ACTIVE_CONTEXT (moo, moo->active_context->origin);
}
else
{
/* restore the stack pointer */
moo->sp = MOO_OOP_TO_SMOOI(moo->active_context->origin->sp);
SWITCH_ACTIVE_CONTEXT (moo, moo->active_context->origin->sender);
}