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: docode.c,v 1.75 2000/07/07 01:28:57 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.76 2000/07/12 12:38:40 grubba Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"
299:    return 1;       case F_EXTERNAL: +  { +  int level = 0; +  struct program_state *state = Pike_compiler->previous; +  while (state && (state->new_program->id != n->u.integer.a)) { +  state = state->previous; +  level++; +  } +  if (!state) { +  my_yyerror("Program parent %d lost during compiling.", n->u.integer.a); +  emit1(F_NUMBER,0); +  return 1; +  }    if(flags & WANT_LVALUE)    { -  emit2(F_EXTERNAL_LVALUE, n->u.integer.b,n->u.integer.a); +  emit2(F_EXTERNAL_LVALUE, n->u.integer.b, level);    return 2;    }else{ -  emit2(F_EXTERNAL, n->u.integer.b,n->u.integer.a); +  emit2(F_EXTERNAL, n->u.integer.b, level);    return 1;    } -  +  }    break;       case F_UNDEFINED:
1228:       for(o=Pike_compiler->fake_object->parent;o!=n->u.sval.u.object;o=o->parent)    x++; -  emit2(F_EXTERNAL, n->u.sval.subtype,x); +  emit2(F_EXTERNAL, n->u.sval.subtype, x);    Pike_compiler->new_program->flags |= PROGRAM_USES_PARENT;    return 1;    }