Branch: Tag:

1998-04-10

1998-04-10 04:35:20 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

recursive module references now generates errors

Rev: src/ChangeLog:1.144
Rev: src/language.yacc:1.71
Rev: src/las.c:1.58

169:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.70 1998/04/09 20:37:20 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.71 1998/04/10 04:35:19 hubbe Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
188:   #include "error.h"   #include "docode.h"   #include "machine.h" + #include "cyclic.h"      #define YYMAXDEPTH 1000   
1290:    {    if(get_master())    { -  reference_shared_string(last_identifier); -  push_string(last_identifier); +  DECLARE_CYCLIC(); +  if(BEGIN_CYCLIC(last_identifier, lex.current_file)) +  { +  my_yyerror("Recursive module dependency in %s",last_identifier->str); +  }else{ +  SET_CYCLIC_RET(1); +  ref_push_string(last_identifier);    ref_push_string(lex.current_file);    SAFE_APPLY_MASTER("resolv", 2);   
1312:    $$=mkconstantsvaluenode(sp-1);    }    pop_stack(); +  END_CYCLIC(); +  }    }else{    if(compiler_pass==2)    {