pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret_functions.h,v 1.155 2003/08/13 15:58:04 grubba Exp $ + || $Id: interpret_functions.h,v 1.156 2003/09/05 15:19:20 mast Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:1400:    }else{    /* write_to_stderr("foreach\n", 8); */    DONT_BRANCH();    }   });      OPCODE0(F_MAKE_ITERATOR, "get_iterator", 0, {    f_get_iterator(1);   });    - OPCODE0_BRANCH(F_NEW_FOREACH, "foreach++", 0, { /* iterator, lvalue, lvalue */ -  extern int foreach_iterate(struct object *o); + /* Stack is: iterator, index lvalue, value lvalue. */ + OPCODE0_BRANCH (F_FOREACH_START, "foreach start", 0, { +  DO_IF_DEBUG ( +  if(Pike_sp[-5].type != PIKE_T_OBJECT) +  Pike_fatal ("Iterator gone from stack.\n"); +  ); +  if (foreach_iterate (Pike_sp[-5].u.object, 0)) +  DONT_BRANCH(); +  else { +  DO_BRANCH(); +  } + });    -  + /* Stack is: iterator, index lvalue, value lvalue. */ + OPCODE0_BRANCH(F_FOREACH_LOOP, "foreach loop", 0, { +  DO_IF_DEBUG (    if(Pike_sp[-5].type != PIKE_T_OBJECT) -  PIKE_ERROR("foreach", "Bad argument 1.\n", Pike_sp-3, 1); -  if(foreach_iterate(Pike_sp[-5].u.object)) +  Pike_fatal ("Iterator gone from stack.\n"); +  ); +  if(foreach_iterate(Pike_sp[-5].u.object, 1))    {    DO_BRANCH();    }else{ -  /* write_to_stderr("foreach\n", 8); */ +     DONT_BRANCH();    }   });         OPCODE1_RETURN(F_RETURN_LOCAL,"return local", I_UPDATE_SP|I_UPDATE_FP, {    DO_IF_DEBUG(    /* special case! Pike_interpreter.mark_stack may be invalid at the time we    * call return -1, so we must call the callbacks here to    * prevent false alarms! /Hubbe