Branch: Tag:

1997-09-29

1997-09-29 00:57:55 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

({})->identifier implemented

Rev: src/array.c:1.14
Rev: src/object.c:1.24
Rev: src/opcodes.c:1.9
Rev: src/operators.c:1.18
Rev: src/pike_types.c:1.26
Rev: src/testsuite.in:1.55

143:    free_array(v);   }    - void simple_array_index(struct svalue *s,struct array *a,struct svalue *ind) - { -  INT32 i; -  if(ind->type != T_INT) -  error("Index is not an integer.\n"); -  i=ind->u.integer; -  if(i<0) i+=a->size; -  if(i<0 || i>=a->size) error("Index out of range.\n"); -  array_index(s,a,i); - } +       void simple_array_index_no_free(struct svalue *s,struct array *a,struct svalue *ind)   {    INT32 i; -  if(ind->type != T_INT) -  error("Index is not an integer.\n"); +  switch(ind->type) +  { +  case T_INT:    i=ind->u.integer;    if(i<0) i+=a->size;    if(i<0 || i>=a->size) error("Index out of range.\n");    array_index_no_free(s,a,i); -  +  break; +  +  case T_STRING: +  check_stack(4); +  ref_push_array(a); +  assign_svalue_no_free(sp++,ind); +  f_column(2); +  s[0]=sp[-1]; +  sp--; +  break; +  +  default: +  error("Index is not an integer.\n");    } -  + }      /*    * Extract an svalue from an array