Branch: Tag:

1996-11-08

1996-11-08 04:57:40 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

object(foo), prog(), 'constant' and class foo {} implemented

Rev: src/ChangeLog:1.18
Rev: src/builtin_functions.c:1.9
Rev: src/builtin_functions.h:1.2
Rev: src/docode.c:1.3
Rev: src/interpret.c:1.8
Rev: src/language.yacc:1.6
Rev: src/lex.c:1.6
Rev: src/object.c:1.3
Rev: src/object.h:1.3
Rev: src/pike_types.c:1.5
Rev: src/program.c:1.4
Rev: src/program.h:1.2
Rev: src/testsuite.in:1.6

568:    break;       /* The not so basic 'push value' instructions */ -  CASE(F_GLOBAL) -  { -  struct identifier *i; -  INT32 tmp=GET_ARG() + fp->context.identifier_level; -  -  if(!fp->current_object->prog) -  error("Cannot access global variables in destructed object.\n"); -  -  i=ID_FROM_INT(fp->current_object->prog, tmp); -  if(i->run_time_type == T_MIXED) -  { -  struct svalue *s; -  s=(struct svalue *)GLOBAL_FROM_INT(tmp); -  check_destructed(s); -  assign_svalue_no_free(sp,s); -  }else{ -  union anything *u; -  u=(union anything *)GLOBAL_FROM_INT(tmp); -  check_short_destructed(u,i->run_time_type); -  -  assign_from_short_svalue_no_free(sp,u, i->run_time_type); -  } +  CASE(F_GLOBAL); +  low_object_index_no_free(sp, +  fp->current_object, +  GET_ARG() + fp->context.identifier_level);    sp++;    print_return_value();    break; -  } +        CASE(F_LOCAL);    assign_svalue_no_free(sp++,fp->locals+GET_ARG());
656:    fp->locals[instr].u.integer--;    break;    -  +     CASE(F_LTOSVAL);    lvalue_to_svalue_no_free(sp,sp-2);    sp++;
692:    error("Cannot access global variables in destructed object.\n");       i=ID_FROM_INT(fp->current_object->prog, tmp); +  +  if(!IDENTIFIER_IS_VARIABLE(i->flags)) +  error("Cannot re-assign functions or constants.\n"); +     if(i->run_time_type == T_MIXED)    {    sp[0].type=T_LVALUE;
1461:    apply_array(s->u.array,args);    break;    +  case T_PROGRAM: +  { +  struct object *o=clone(s->u.program,args); +  push_object(o); +  } +  break; +     default:    error("Call to non-function value.\n");    }