Roxen.git / server / modules / scripting / piketag.pike

version» Context lines:

Roxen.git/server/modules/scripting/piketag.pike:1:   // This is a roxen module. Copyright © 1996 - 2001, Roxen IS.   //   // Adds support for inline pike in documents.   //   // Example:   // <pike>   // return "Hello world!\n";   // </pike>    - constant cvs_version = "$Id: piketag.pike,v 2.36 2001/09/21 15:58:13 jhs Exp $"; + constant cvs_version = "$Id: piketag.pike,v 2.37 2002/10/22 00:21:29 nilsson Exp $";   constant thread_safe=1;      inherit "module";   #include <module.h>      constant module_type = MODULE_TAG;   constant module_name = "Scripting: Pike tag";   constant module_doc = #"   <p>This module adds a processing instruction tag, <code>&lt;?pike ...   ?&gt;</code>, for evaluating Pike code directly in the document.</p>
Roxen.git/server/modules/scripting/piketag.pike:449:   {    add_constant( "__magic_helpers", CompatHelpers );    return    "inherit __magic_helpers;\n"    "#"+line+" \""+replace(page,"\"","\\\"")+"\"\n";   }      // Preamble   string pre(string what, object id)   { -  if(search(what, "parse(") != -1) +  if(has_value(what, "parse("))    return functions(id->not_query, id->misc->line); -  if(search(what, "return") != -1) +  if(has_value(what, "return"))    return functions(id->not_query, id->misc->line) +    "string|int parse(RequestID id, mapping defines, object file, mapping args) { ";    else    return functions(id->not_query, id->misc->line) +    "string|int parse(RequestID id, mapping defines, object file, mapping args) { return ";   }      // Will be added at the end...   string post(string what)   { -  if(search(what, "parse(") != -1) +  if(has_value(what, "parse("))    return "";    if (!strlen(what) || what[-1] != ';')    return ";}";    else    return "}";   }      // Compile and run the contents of the tag (in s) as a pike   // program.   string container_pike(string tag, mapping m, string s, RequestID request_id,