Branch: Tag:

2000-07-12

2000-07-12 12:38:41 by Henrik Grubbström (Grubba) <grubba@grubba.org>

F_EXTERNAL nodes now hold the program_id instead of the level.

Rev: src/docode.c:1.76
Rev: src/language.yacc:1.201
Rev: src/las.c:1.186
Rev: src/las.h:1.40
Rev: src/program.c:1.250

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.249 2000/07/11 03:45:10 mast Exp $"); + RCSID("$Id: program.c,v 1.250 2000/07/12 12:38:41 grubba Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
350:    SEE_STATIC);    if(i!=-1)    { -  struct identifier *id; -  id=ID_FROM_INT(p->new_program, i); -  return mkexternalnode(n, i, id); +  return mkexternalnode(p->new_program, i);    }    }   
1622:    id=low_reference_inherited_identifier(state,e,function_name,SEE_STATIC);       if(id!=-1) -  return mkexternalnode(n,id,ID_FROM_INT(state->new_program, id)); +  return mkexternalnode(p, id);       if(ISCONSTSTR(function_name,"`->") ||    ISCONSTSTR(function_name,"`[]"))
1860:    goto continue_inherit;       case F_EXTERNAL: -  p=parent_compilation(n->u.integer.a); -  offset=n->u.integer.a; -  numid=n->u.integer.b; -  -  if(!p) +     { -  +  struct program_state *state = Pike_compiler->previous; +  +  offset = 0; /* FIXME: Should this be zero or 1? */ +  while (state && (state->new_program->id != n->u.integer.a)) { +  state = state->previous; +  offset++; +  } +  if (!state) {    yyerror("Failed to resolv external constant.\n");    return;    } -  +  p = state->new_program; +  numid = n->u.integer.b; +  }       continue_inherit: