Branch: Tag:

2001-09-18

2001-09-18 18:57:45 by Martin Stjernholm <mast@lysator.liu.se>

Kludge for the loop detection between Scope.m_delete and Scope._m_delete.

Rev: server/etc/modules/RXML.pmod/module.pmod:1.246

2:   //   // Created 1999-07-30 by Martin Stjernholm.   // - // $Id: module.pmod,v 1.245 2001/09/13 14:03:48 mast Exp $ + // $Id: module.pmod,v 1.246 2001/09/18 18:57:45 mast Exp $      // Kludge: Must use "RXML.refs" somewhere for the whole module to be   // loaded correctly.
64:   // #define FRAME_DEPTH_DEBUG   // #define RXML_PCODE_DEBUG   // #define RXML_PCODE_UPDATE_DEBUG + // #define TAGSET_GENERATION_DEBUG         #ifdef RXML_OBJ_DEBUG
983:    //! Should be called whenever something is changed. Done    //! automatically most of the time, however.    { + #ifdef TAGSET_GENERATION_DEBUG +  werror ("%O update, generation %d -> %d\n", this_object(), +  generation, generation + 1); + #endif    generation++;    prepare_funs = 0;    overridden_tag_lookup = 0;
991:    (notify_funcs -= ({0}))();    set_weak_flag (notify_funcs, 1);    got_local_tags = sizeof (tags) || (proc_instrs && sizeof (proc_instrs)); + #ifdef TAGSET_GENERATION_DEBUG +  werror ("%O update done, generation %d -> %d\n", this_object(), +  generation - 1, generation); + #endif    }       function(Backtrace,Type:string) handle_run_error =
1368:    //! indexed.    {parse_error ("Cannot list variables" + _in_the_scope (scope_name) + ".\n");}    -  void _m_delete (string var, void|Context ctx, void|string scope_name) +  void _m_delete (string var, void|Context ctx, +  void|string scope_name, void|int from_m_delete)    //! Called to delete a variable in the scope. @[var] is the name of    //! it, @[ctx] and @[scope_name] are set to where this @[Scope] -  //! object was found. +  //! object was found. @[from_m_delete] is an internal kludge for 2.1 +  //! compatibility; it should never be given a value.    { -  if (m_delete != local::m_delete) +  if (!from_m_delete)    m_delete (var, ctx, scope_name); // For compatibility with 2.1.    else    parse_error ("Cannot delete variable" + _in_the_scope (scope_name) + ".\n");
1381:       void m_delete (string var, void|Context ctx, void|string scope_name)    // For compatibility with 2.1. -  {_m_delete (var, ctx, scope_name);} +  {_m_delete (var, ctx, scope_name, 1);}       private string _in_the_scope (string scope_name)    {
6611:    //! Returns whether the p-code is stale or not. Should be called    //! before @[eval] to ensure it won't fail for that reason.    { + #ifdef TAGSET_GENERATION_DEBUG +  werror ("%O is_stale test: generation=%d, %O->generation=%d\n", +  this_object(), generation, tag_set, tag_set && tag_set->generation); + #endif    return tag_set && tag_set->generation != generation;    }