/* parse a return */
void fcReturn()
{
Var e = emit.GetFunc();
CommentHolder(); /* mark the position in insn stream */
tok.scan(); /* get the return value */
if (tok.getFirstChar() == ';') /* if end of statment */
{
if (e.getTypeId() != Tok.T_VOID)
{
io.Abort("Expected value for return type");
}
}
else
{
if (e.getTypeId() == Tok.T_VOID)
{
io.Abort("Unexpected value for void return type");
}
boolExpr(); /* parse as expression */
}
emit.Ret(); /* issue the return (value is on stack) */
CommentFill();
tok.scan(); /* move past the semi */
}