pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.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: docode.c,v 1.71 2000/05/01 02:11:25 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.72 2000/05/01 03:33:45 hubbe Exp $");   #include "las.h"   #include "program.h"   #include "language.h"   #include "pike_types.h"   #include "stralloc.h"   #include "interpret.h"   #include "constants.h"   #include "array.h"   #include "pike_macros.h"   #include "error.h"
pike.git/src/docode.c:382:    case F_SUB_EQ:    case F_MULT_EQ:    case F_MOD_EQ:    case F_DIV_EQ:    tmp1=do_docode(CAR(n),DO_LVALUE);   #ifdef PIKE_DEBUG    if(tmp1 != 2)    fatal("HELP! FATAL INTERNAL COMPILER ERROR (7)\n");   #endif    +  if(n->token == F_ADD_EQ && (flags & DO_POP)) +  { +  code_expression(CDR(n), 0, "assignment"); +  emit0(F_ADD_TO_AND_POP); +  return 0; +  } +     if(match_types(CAR(n)->type,array_type_string) ||    match_types(CAR(n)->type,string_type_string) ||    match_types(CAR(n)->type,mapping_type_string) ||    match_types(CAR(n)->type,object_type_string))    {    code_expression(CDR(n), 0, "assignment");    emit0(F_LTOSVAL2);    }else{    emit0(F_LTOSVAL);    code_expression(CDR(n), 0, "assignment");    }          switch(n->token)    { -  case F_ADD_EQ: emit0(F_ADD); break; +  case F_ADD_EQ: +  if(CAR(n)->type == int_type_string && +  CDR(n)->type == int_type_string) +  { +  emit0(F_ADD_INTS); +  } +  else if(CAR(n)->type == float_type_string && +  CDR(n)->type == float_type_string) +  { +  emit0(F_ADD_FLOATS); +  }else{ +  emit0(F_ADD); +  } +  break;    case F_AND_EQ: emit0(F_AND); break;    case F_OR_EQ: emit0(F_OR); break;    case F_XOR_EQ: emit0(F_XOR); break;    case F_LSH_EQ: emit0(F_LSH); break;    case F_RSH_EQ: emit0(F_RSH); break;    case F_SUB_EQ: emit0(F_SUBTRACT); break;    case F_MULT_EQ:emit0(F_MULTIPLY);break;    case F_MOD_EQ: emit0(F_MOD); break;    case F_DIV_EQ: emit0(F_DIVIDE); break;    }