pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: las.c,v 1.71 1998/11/22 11:02:56 hubbe Exp $"); + RCSID("$Id: las.c,v 1.72 1999/02/04 20:33:56 hubbe Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:1860:    goto use_tmp1;    }    break;       case F_ADD_EQ:    if(CDR(n)->type == int_type_string)    {    if(CDR(n)->token == F_CONSTANT && CDR(n)->u.sval.type == T_INT)    {    /* a+=0 -> a */ -  if(n->u.sval.u.integer == 0) goto use_car; +  if(CDR(n)->u.sval.u.integer == 0) goto use_car;       /* a+=1 -> ++a */ -  if(n->u.sval.u.integer == 1) +  if(CDR(n)->u.sval.u.integer == 1)    { -  tmp1=mknode(F_INC,CDR(n),0); -  CDR(n)=0; +  tmp1=mknode(F_INC,CAR(n),0); +  CAR(n)=0;    goto use_tmp1;    }       /* a+=-1 -> --a */ -  if(n->u.sval.u.integer == -1) +  if(CDR(n)->u.sval.u.integer == -1)    { -  tmp1=mknode(F_DEC, CDR(n), 0); -  CDR(n)=0; +  tmp1=mknode(F_DEC, CAR(n), 0); +  CAR(n)=0;    goto use_tmp1;    }    }    }    break;       case F_SUB_EQ:    if(CDR(n)->type == int_type_string)    {    if(CDR(n)->token == F_CONSTANT && CDR(n)->u.sval.type == T_INT)    {    /* a-=0 -> a */ -  if(n->u.sval.u.integer == 0) goto use_car; +  if(CDR(n)->u.sval.u.integer == 0) goto use_car;       /* a-=-1 -> ++a */ -  if(n->u.sval.u.integer == -1) +  if(CDR(n)->u.sval.u.integer == -1)    { -  tmp1=mknode(F_INC, CDR(n), 0); -  CDR(n)=0; +  tmp1=mknode(F_INC, CAR(n), 0); +  CAR(n)=0;    goto use_tmp1;    }       /* a-=-1 -> --a */ -  if(n->u.sval.u.integer == 1) +  if(CDR(n)->u.sval.u.integer == 1)    { -  tmp1=mknode(F_DEC, CDR(n), 0); -  CDR(n)=0; +  tmp1=mknode(F_DEC, CAR(n), 0); +  CAR(n)=0;    goto use_tmp1;    }    }    }    break;       case F_ARROW:    if(CAR(n)->token==F_CONSTANT &&    CAR(n)->u.sval.type==T_OBJECT &&    CAR(n)->u.sval.u.object->prog &&
pike.git/src/las.c:2059:    }       if(count_args(CDR(opnode)) != 2) break;    arg1=my_get_arg(&CDR(opnode), 0);    arg2=my_get_arg(&CDR(opnode), 1);       /* it was not on the form for(; x op y; z++) p; */    if(!node_is_eq(*arg1,CAR(tmp1)) || /* x == z */    depend_p(*arg2,*arg2) || /* does y depend on y? */    depend_p(*arg2,*arg1) || /* does y depend on x? */ -  depend_p(*arg2,CADR(n))) /* does y depend on p? */ +  depend_p(*arg2,CADR(n)) || /* does y depend on p? */ +  depend_p(*arg2,tmp1)) /* does y depend on z? */    {    /* it was not on the form for(; x op y; x++) p; */    if(!node_is_eq(*arg2,CAR(tmp1)) || /* y == z */    depend_p(*arg1,*arg2) || /* does x depend on y? */    depend_p(*arg1,*arg1) || /* does x depend on x? */ -  depend_p(*arg1,CADR(n)) /* does x depend on p? */ -  ) +  depend_p(*arg1,CADR(n)) || /* does x depend on p? */ +  depend_p(*arg1,tmp1)) /* does x depend on z? */    {    /* it was not on the form for(; x op y; y++) p; */    break;    }else{    node **tmparg;    /* for(; x op y; y++) p; -> for(; y op^-1 x; y++) p; */       switch(oper)    {    case F_LT: oper=F_GT; break;