pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:3909:
push_int(sizeof(INT_TYPE) * 8); push_static_text("time_size"); push_int(sizeof(time_t) * 8); push_static_text("float_size"); push_int(sizeof(FLOAT_TYPE) * 8); push_static_text("auto_bignum"); push_int(1); f_aggregate_mapping(7*2); }
+
/*! @decl mixed yield(mixed val)
+
*!
+
*! Stop execution of the current generator function for now,
+
*! and return the value @[val].
+
*!
+
*! @returns
+
*! Evaluates to the first argument passed to the
+
*! generator function on restart.
+
*!
+
*! Calling this special form is similar to the statement:
+
*!
+
*! @code
+
*! continue return val;
+
*! @endcode
+
*!
+
*! This syntax is however an expression and can thus be used
+
*! to pass a value back.
+
*!
+
*! @note
+
*! Use of this function is only valid in generator functions.
+
*!
+
*! @seealso
+
*! Generator functions
+
*/
+
PIKEFUN mixed yield(mixed val)
+
optfunc optimize_yield;
+
prototype;
+
efun;
+
{
+
}
+
+
static node *optimize_yield(node *n)
+
{
+
if (n) {
+
node *ret = mknode(F_RETURN, CDR(n), mkintnode(2));
+
ADD_NODE_REF(CDR(n));
+
return ret;
+
}
+
return NULL;
+
}
+
/*! @endmodule */ void low_backtrace(struct Pike_interpreter_struct *i, int flags) { struct svalue *stack_top = i->stack_pointer; struct pike_frame *f, *of = 0; int size = 0; struct array *res = NULL;