Branch: Tag:

1999-08-17

1999-08-17 22:00:00 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

changed `[] to act like `-> on arrays..

Rev: src/array.c:1.52

21:   #include "main.h"   #include "security.h"    - RCSID("$Id: array.c,v 1.51 1999/08/17 03:17:06 mast Exp $"); + RCSID("$Id: array.c,v 1.52 1999/08/17 22:00:00 hubbe Exp $");      struct array empty_array=   {
182:    break;       case T_STRING: -  if (ind->subtype == 1) { +  {    check_stack(4);    ref_push_array(a);    assign_svalue_no_free(sp++,ind);
197:    struct svalue tmp;    tmp.type=T_ARRAY;    tmp.u.array=a; -  index_error(0,0,0,&tmp,ind,"Index is not an integer.\n"); +  index_error(0,0,0,&tmp,ind,"Array index is neither int nor string.\n");    }    }   }
254:    break;       case T_STRING: -  if (ind->subtype == 1) { +  {    INT32 i, n; -  +  check_stack(2);    sp++->type = T_VOID;    push_svalue(ind);    for (i = 0, n = a->size; i < n; i++) {
267:    }       default: -  error("Index is not an integer.\n"); +  { +  struct svalue tmp; +  tmp.type=T_ARRAY; +  tmp.u.array=a; +  index_error(0,0,0,&tmp,ind,"Array index is neither int nor string.\n");    }    } -  + }      /*    * Insert an svalue into an array, grow the array if nessesary