Branch: Tag:

2007-12-17

2007-12-17 18:03:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now knows about F_APPEND_ARRAY.

Rev: src/docode.c:1.191
Rev: src/las.c:1.399

2:   || 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"
860:    res->node_info |= OPT_ASSIGNMENT;    break;    +  case F_APPEND_ARRAY:    case F_ASSIGN:    case F_MOD_EQ:    case F_AND_EQ:
3308:    }    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.");