pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.270 2001/09/29 11:31:40 hubbe Exp $"); + RCSID("$Id: las.c,v 1.271 2001/10/05 01:30:13 hubbe 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:1727:       default:    yyerror("Syntax error in implicit lambda.");    free_node(arg);    break;    }       return n;   }    -  +    node *index_node(node *n, char *node_name, struct pike_string *id)   {    node *ret;    JMP_BUF tmp;       check_tree(n,0);       if(SETJMP(tmp))    {    struct svalue thrown = throw_value;
pike.git/src/las.c:1782:    if (node_name) {    my_yyerror("Failed to index module '%s' (Not a module?)",    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)) +  { +  if(report_compiler_dependency(p)) +  { +  pop_stack(); +  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();    push_int(0);
pike.git/src/las.c:1824:    } else {    f_index(2);    }    UNSETJMP(recovery);    }       if(Pike_sp[-1].type == T_INT &&    !Pike_sp[-1].u.integer &&    Pike_sp[-1].subtype==NUMBER_UNDEFINED)    { +  if(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE) +  {    if (node_name) {    my_yyerror("Index '%s' not present in module '%s'.",    id->str, node_name);    } else {    my_yyerror("Index '%s' not present in module.", id->str);    }       if (thrown.type != PIKE_T_UNKNOWN) {    push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1);    if (IS_ZERO(sp-1)) yy_describe_exception(&thrown);    pop_stack();    free_svalue(&thrown);    } -  +  }else{ +  /* Hope it's there in pass 2 */ +  pop_stack(); +  ref_push_object(placeholder_object);    }    } -  +  }    END_CYCLIC();    }    }    }    UNSETJMP(tmp);    ret=mkconstantsvaluenode(Pike_sp-1);    pop_stack();    return ret;   }