pike.git / src / las.c

version» Context lines:

pike.git/src/las.c: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: las.c,v 1.398 2007/12/15 18:50:51 grubba Exp $ + || $Id: las.c,v 1.399 2007/12/17 18:03:33 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:853:    if (b) {    res->tree_info |= (b->tree_info & ~(OPT_BREAK|OPT_CONTINUE));    }    break;       case F_SSCANF:    if(!b || count_args(b) == 0) break;    res->node_info |= OPT_ASSIGNMENT;    break;    +  case F_APPEND_ARRAY:    case F_ASSIGN:    case F_MOD_EQ:    case F_AND_EQ:    case F_MULT_EQ:    case F_ADD_EQ:    case F_SUB_EQ:    case F_DIV_EQ:    case F_LSH_EQ:    case F_RSH_EQ:    case F_XOR_EQ:
pike.git/src/las.c:3301:    if (!CDR(n) || CDR(n)->type == void_type_string)    copy_pike_type(n->type, void_type_string);    else if(n->token == F_LAND || CAR(n)->type == CDR(n)->type)    {    copy_pike_type(n->type, CDR(n)->type);    }else{    n->type = or_pike_types(CAR(n)->type, CDR(n)->type, 0);    }    break;    +  case F_APPEND_ARRAY: +  if (!CAR(n) || (CAR(n)->type == void_type_string)) { +  yyerror("Assigning a void expression."); +  copy_pike_type(n->type, void_type_string); +  } else if (!CDR(n)) { +  copy_pike_type(n->type, CAR(n)->type); +  } else { +  struct pike_type *tmp; +  /* Ensure that the type-fields are up to date. */ +  fix_type_field(CAR(n)); +  fix_type_field(CDR(n)); +  type_stack_mark(); +  push_finished_type(CDR(n)->type); +  push_type(T_ARRAY); +  n->type = and_pike_types(CAR(n)->type, tmp = pop_unfinished_type()); +  free_type(tmp); +  } +  break; +     case F_ASSIGN:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    yyerror("Assigning a void expression.");    copy_pike_type(n->type, void_type_string);    } else if (!CDR(n)) {    copy_pike_type(n->type, CAR(n)->type);    } else {    /* Ensure that the type-fields are up to date. */    fix_type_field(CAR(n));    fix_type_field(CDR(n));