Branch: Tag:

2001-07-02

2001-07-02 16:44:11 by Martin Stjernholm <mast@lysator.liu.se>

Fixed bug with context inheritance when using the old parse_rxml to do a
subparse. Known misfeature: The parent parser is no longer tracked during
parsing. That should only show itself in that runtime tags doesn't
propagate into the surrounding parsers when Roxen.parse_rxml,
Roxen.compile_rxml or Roxen.get_rxml_parser is used. I'm not sure that's
undesirable, but it is a potential compatibility problem.

Rev: server/base_server/rxml.pike:1.307
Rev: server/etc/modules/RXML.pmod/module.pmod:1.189

2:   //   // Created 1999-07-30 by Martin Stjernholm.   // - // $Id: module.pmod,v 1.188 2001/06/30 16:50:40 per Exp $ + // $Id: module.pmod,v 1.189 2001/07/02 16:44:11 mast Exp $      // Kludge: Must use "RXML.refs" somewhere for the whole module to be   // loaded correctly.
551:    //!    {    id_number = ++tag_set_count; -  if (_name) { -  if (zero_type (all_tagsets[_name]) || -  (all_tagsets[_name] && gc() && zero_type (all_tagsets[_name]))) -  // Have to try to gc here to remove the old tag set object in -  // case the only ref left to it is through all_tagsets. -  all_tagsets[name = _name] = this_object(); -  else { -  report_warning ("The tag set name %O is not unique - ignoring it.\n", _name); -  if (TagSet other = all_tagsets[_name]) { -  // The already registered name is ambigious anyway. -  other->name = 0; -  all_tagsets[_name] = 0; -  } -  } -  } +  set_name (_name);    if (_tags) add_tags (_tags);   #ifdef RXML_OBJ_DEBUG    __object_marker->create (this_object());
785:    switch (var) {    case "name":    if (name) m_delete (all_tagsets, name); -  if (val) all_tagsets[name = val] = this_object(); +  set_name (val);    break;    case "imported":    if (!val) return val; // Pike can call us with 0 as part of an optimization.
890:    if (name) m_delete (all_tagsets, name);    }    +  static void set_name (string new_name) +  { +  if (new_name) { +  if (zero_type (all_tagsets[new_name]) || +  (all_tagsets[new_name] && gc() && zero_type (all_tagsets[new_name]))) +  // Have to try to gc here to remove the old tag set object in +  // case the only ref left to it is through all_tagsets. +  all_tagsets[name = new_name] = this_object(); +  else { +  report_warning ("The tag set name %O is not unique - ignoring it.\n", +  new_name); +  if (TagSet other = all_tagsets[new_name]) { +  // The already registered name is ambigious anyway. +  other->name = 0; +  all_tagsets[new_name] = 0; +  } +  } +  } +  } +     static mapping(string:Tag) tags = ([]), proc_instrs;    // Static since we want to track changes in these.   
4200:    // The parent parser if this one is nested. This is only used to    // register runtime tags.    -  Stdio.File _source_file; -  // This is a compatibility kludge for use with parse_rxml(). -  +     MARK_OBJECT_ONLY;       string _sprintf()
5379:    } )    parse_error ("Cannot convert %s to %s: %s",    utils->format_short (val), name, describe_error (err)); -  +     }       string decode (mixed val)