pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: las.c,v 1.316 2002/12/09 22:20:09 mast Exp $ + || $Id: las.c,v 1.317 2002/12/10 16:53:28 mast Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.316 2002/12/09 22:20:09 mast Exp $"); + RCSID("$Id: las.c,v 1.317 2002/12/10 16:53:28 mast Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:1856:    node_name);    } else {    yyerror("Failed to index module (Not a module?)");    }    pop_stack();    push_int(0);    break;       case T_OBJECT:    case T_PROGRAM: - #if 1 +     if(!(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE))    {    struct program *p;    if(Pike_sp[-1].type == T_OBJECT)    p=Pike_sp[-1].u.object->prog;    else    p=Pike_sp[-1].u.program;       if(p && !(p->flags & PROGRAM_PASS_1_DONE))    {
pike.git/src/las.c:1878: Inside #if 1
   {    pop_stack();   #if 0    fprintf(stderr, "Placeholder deployed for %p\n", p);   #endif    ref_push_object(placeholder_object);    break;    }    }    } - #endif +        default:    {    ptrdiff_t c;    DECLARE_CYCLIC();    c = (ptrdiff_t)BEGIN_CYCLIC(Pike_sp[-1].u.refs, id);    if(c>1)    {    my_yyerror("Recursive module dependency in '%s'.",id->str);    pop_stack();
pike.git/src/las.c:1947: Inside #if 0
  #if 0    fprintf(stderr, "Placeholder deployed when indexing ");    print_tree(n);    fprintf(stderr, "with %s\n", id->str);   #endif    ref_push_object(placeholder_object);    if (thrown.type != PIKE_T_UNKNOWN)    free_svalue(&thrown);    }    } +  +  else if ((Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE) && +  ((Pike_sp[-1].type == T_OBJECT && +  Pike_sp[-1].u.object == placeholder_object) || +  (Pike_sp[-1].type == T_PROGRAM && +  Pike_sp[-1].u.program == placeholder_program)) && +  /* Ugly special case: We must be able to get +  * predef::__placeholder_object. */ +  (!node_name || strcmp (node_name, "predef"))) { +  if (node_name) +  my_yyerror("Got placeholder %s (resolver problem) " +  "when indexing module '%s' with '%s'.", +  get_name_of_type (Pike_sp[-1].type), +  node_name, id->str); +  else +  my_yyerror("Got placeholder %s (resolver problem) " +  "when indexing a module with '%s'.", +  get_name_of_type (Pike_sp[-1].type), +  id->str);    } -  +  }    END_CYCLIC();    }    }    }    UNSETJMP(tmp);    ret=mkconstantsvaluenode(Pike_sp-1);    pop_stack();    return ret;   }