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.6 1996/12/04 00:27:10 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.7 1997/01/16 05:00:43 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 "macros.h"   #include "error.h"
pike.git/src/docode.c:260:    default:    yyerror("Illegal lvalue.");    emit(F_NUMBER,0);    return 1;       case F_LVALUE_LIST:    case F_LOCAL:    case F_GLOBAL:    case F_IDENTIFIER:    case F_INDEX: +  case F_ARROW:    case F_ARG_LIST:    break;    }    }       switch(n->token)    {    case F_PUSH_ARRAY:    tmp1=do_docode(CAR(n),0);    if(tmp1!=1)
pike.git/src/docode.c:919:       current_break=break_save;    current_continue=continue_save;    current_switch_jumptable = prev_switch_jumptable;    return 1;    }       case F_LVALUE_LIST:    return do_docode(CAR(n),DO_LVALUE)+do_docode(CDR(n),DO_LVALUE);    +  case F_ARROW: +  if(CDR(n)->token != F_CONSTANT || CDR(n)->u.sval.type!=T_STRING) +  fatal("Bugg in F_ARROW, index not string."); +  if(flags & DO_LVALUE) +  { +  /* FIXME!!!! */ +  tmp1=do_docode(CAR(n), 0); +  emit(F_ARROW_STRING, store_prog_string(CDR(n)->u.sval.u.string)); +  return 2; +  }else{ +  tmp1=do_docode(CAR(n), DO_NOT_COPY); +  emit(F_ARROW, store_prog_string(CDR(n)->u.sval.u.string)); +  if(!(flags & DO_NOT_COPY)) +  { +  while(n && (n->token==F_INDEX || n->token==F_ARROW)) n=CAR(n); +  if(n->token==F_CONSTANT && !(n->node_info & OPT_EXTERNAL_DEPEND)) +  emit2(F_COPY_VALUE); +  } +  } +  return tmp1; +     case F_INDEX:    if(flags & DO_LVALUE)    {    tmp1=do_docode(CAR(n), 0);    if(do_docode(CDR(n),0) != 1)    fatal("Internal compiler error, please report this (1)."); -  +  if(CDR(n)->token != F_CONSTANT) emit2(F_CLEAR_STRING_SUBTYPE);    return 2;    }else{    tmp1=do_docode(CAR(n), DO_NOT_COPY);    if(do_docode(CDR(n),DO_NOT_COPY) != 1)    fatal("Internal compiler error, please report this (1).");    emit2(F_INDEX);    if(!(flags & DO_NOT_COPY))    { -  while(n && n->token==F_INDEX) n=CAR(n); +  while(n && (n->token==F_INDEX || n->token==F_ARROW)) n=CAR(n);    if(n->token==F_CONSTANT && !(n->node_info & OPT_EXTERNAL_DEPEND))    emit2(F_COPY_VALUE);    }    }    return tmp1;       case F_CONSTANT:    switch(n->u.sval.type)    {    case T_INT: