Branch: Tag:

2001-06-20

2001-06-20 23:27:24 by Martin Stjernholm <mast@lysator.liu.se>

Various p-code fixes, especially wrt error handling. The known bug with
compiled-in rxml backtraces is now fixed.

Rev: server/etc/modules/RXML.pmod/PEnt.pike:1.22
Rev: server/etc/modules/RXML.pmod/PXml.pike:1.58
Rev: server/etc/modules/RXML.pmod/module.pmod:1.169
Rev: server/etc/modules/RXML.pmod/utils.pmod:1.25

4:   //!   //! Created 2000-01-28 by Martin Stjernholm.   //! - //! $Id: PEnt.pike,v 1.21 2001/04/19 12:59:51 mast Exp $ + //! $Id: PEnt.pike,v 1.22 2001/06/20 23:27:24 mast Exp $      //#pragma strict_types // Disabled for now since it doesn't work well enough.   
42:   #endif   }    - void reset (RXML.Context ctx, RXML.Type _type, RXML.TagSet _tag_set) + void reset (RXML.Context ctx, RXML.Type _type, +  RXML.PCode p_code, RXML.TagSet _tag_set)   {   #ifdef DEBUG    if (type != _type) error ("Internal error: Type change in reset().\n");    if (tag_set != _tag_set) error ("Internal error: Tag set change in reset().\n");   #endif -  value = RXML.nil; -  initialize (ctx, _type, _tag_set); +  initialize (ctx, _type, p_code, _tag_set);      #ifdef OLD_RXML_COMPAT    int new_not_compat = !(ctx && ctx->id && ctx->id->conf->old_rxml_compat);
59:   #endif   }    - this_program clone (RXML.Context ctx, RXML.Type type, RXML.TagSet tag_set) + this_program clone (RXML.Context ctx, RXML.Type type, +  RXML.PCode p_code, RXML.TagSet tag_set)   {   #ifdef OLD_RXML_COMPAT    int new_not_compat = !(ctx && ctx->id && ctx->id->conf->old_rxml_compat); -  if (new_not_compat != not_compat) return this_program (ctx, type, tag_set); +  if (new_not_compat != not_compat) return this_program (ctx, type, p_code, tag_set);   #endif -  return [object(this_program)] _low_clone (ctx, type, tag_set, 1); +  return [object(this_program)] _low_clone (ctx, type, p_code, tag_set, 1);   }    - static void create ( -  RXML.Context ctx, RXML.Type type, RXML.TagSet tag_set, void|int cloned) + static void create (RXML.Context ctx, RXML.Type type, +  RXML.PCode p_code, RXML.TagSet tag_set, void|int cloned)   {   #ifdef OLD_RXML_COMPAT    not_compat = !(ctx && ctx->id && ctx->id->conf->old_rxml_compat);   #endif    -  initialize (ctx, type, tag_set); +  if (type->free_text) +  alternative = FREE_TEXT; +  else +  alternative = type->handle_literals ? LITERALS : NO_LITERALS;    -  +  initialize (ctx, type, p_code, tag_set); +     if (cloned) return;    -  if (!type->free_text && !type->handle_literals) -  _set_data_callback (.utils.free_text_error); +     ignore_tags (1);    lazy_entity_end (1);    match_tag (0);