Branch: Tag:

2000-01-23

2000-01-23 07:50:35 by Martin Nilsson <mani@lysator.liu.se>

Added some comments and removed <version> and some spaces.

Rev: server/base_server/rxml.pike:1.76

1:   /* -  * $Id: rxml.pike,v 1.75 2000/01/23 06:25:24 nilsson Exp $ +  * $Id: rxml.pike,v 1.76 2000/01/23 07:50:35 nilsson Exp $    *    * The Roxen Challenger RXML Parser.    *
33:    else return describe_error (err);   }    + #ifdef OLD_RXML_COMPAT + RoxenModule rxml_warning_cache; + void old_rxml_warning(RequestID id, string no, string yes) { +  if(!rxml_warning_cache) rxml_warning_cache=id->conf->get_provider("oldRXMLwarning"); +  if(!rxml_warning_cache) return; +  rxml_warning_cache->old_rxml_warning(id, no, yes); + } + #endif +    // A note on tag overriding: It's possible for old style tags to   // propagate their results to the tags they have overridden. This is   // done by an extension to the return value:
51:   // Note that there's no other way to handle tag overriding -- the page   // is no longer parsed multiple times.    +  + // ----------------------- Default scopes ------------------------- +    class Scope_roxen {    inherit RXML.Scope;    string ver=roxen.version();
70:    array(string) _indices() {    return ({"version", "time", "server"});    } +  +  string _sprintf() { return "RXML.Scope(roxen)"; }   }      class Scope_page {
97:    if(c->id->misc->defines[def]) ind+=({def});    return ind;    } +  +  void m_delete (string var, void|RXML.Context c, void|string scope_name) { +  if(!c) return; +  if(has_value(in_defines, var)) { +  if(var[0..4]=="theme") +  predef::m_delete(c->id->misc->defines, var); +  else +  ::m_delete(var, c, scope_name);    } -  +  predef::m_delete(c->id->misc->page, var); +  }    -  +  string _sprintf() { return "RXML.Scope(page)"; } + } +    RXML.Scope scope_roxen=Scope_roxen();   RXML.Scope scope_page=Scope_page();    -  +  + // ------------------------- RXML Parser ------------------------------ +    RXML.TagSet rxml_tag_set = class   {    inherit RXML.TagSet;
496:    return r;   }    -  +    #define _stat defines[" _stat"]   #define _error defines[" _error"]   #define _extra_heads defines[" _extra_heads"]
549:   }       + // ------------------------- RXML Core tags -------------------------- +    string tag_help(string t, mapping args, RequestID id)   {    RXML.PHtml parser = rxml_tag_set (RXML.t_html (RXML.PHtmlCompat), id);
596:    }   }    - string tag_number(string t, mapping args) + string tag_number(string t, mapping args, RequestID id)   { -  return roxen.language(args->language||args->lang, +  return roxen.language(args->lang||args->language||id->misc->defines->theme_language,    args->type||"number")( (int)args->num );   }   
624:    return data;   }    -  +    string use_file_doc( string f, string data, RequestID nid, Stdio.File id )   {    string res="";
745:    return ({ c });   }    - RoxenModule rxml_warning_cache; - void old_rxml_warning(RequestID id, string no, string yes) { -  if(!rxml_warning_cache) rxml_warning_cache=id->conf->get_provider("oldRXMLwarning"); -  if(!rxml_warning_cache) return; -  rxml_warning_cache->old_rxml_warning(id, no, yes); - } -  +    string tag_define(string tag, mapping m, string str, RequestID id,    Stdio.File file, mapping defines)   {
869:    return "";   }    -  -  +    class Tracer   {    inherit "roxenlib";
1115:    ]);   }    -  +    mapping query_tag_callers()   {    return ([
1123:    "false":tag_false,    "number":tag_number,    "undefine":tag_undefine, -  "help": tag_help, -  "version":lambda() { return ({ roxen.version() }); } +  "help": tag_help    ]);   }    -  +    RXML.TagSet query_tag_set()   {    // Note: By putting the tags in rxml_tag_set, they will always have
1140:   }       + // ---------------------------- If callers ------------------------------- +    class UserIf   {    string rxml_code;
1256:    }   }    -  +    int if_date( string date, RequestID id, mapping m )   {    CACHE(60); // One minute accuracy is probably good enough...