pike.git / lib / modules / Tools.pmod / AutoDoc.pmod / MirarDocParser.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:56: Inside #if constant(Image.PNG.encode)
   if(objectp(o))    o=Image.PNG.encode(o);    Stdio.write_file(fn, o);    if(verbosity > 1)    werror(\"Wrote %s.\\n\", fn);   #endif    return \"<image>\"+fn+\"</image>\";    }       object|string render() { -  // Make sure we get the same images every time, -  // even if they have a random component. -  random_seed(0x6aa6a66a); +    ",    // Prior to 7.3.11 there were implicit imports of Image    // and Stdio. cf src/modules/Image/illustration.pike.    //    // There was also a compat layer for various functions    // that later were removed.    #"// Pike 7.3 illustration, implicit imports.   #pike 7.3       import Image;
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:122: Inside #if constant(Image.PNG.encode)
   if(objectp(o))    o=PNG.encode(o);    Stdio.write_file(fn, o);    if(verbosity > 1)    werror(\"Wrote %s.\\n\", fn);   #endif    return \"<image>\"+fn+\"</image>\";    }       object|string render() { -  // Make sure we get the same images every time, -  // even if they have a random component. -  random_seed(0x6aa6a66a); +    ",    // Prior to 0.7.3 the Image module classes were all lower-case.    #"// Pike 0.6 illustration, implicit imports, only Image.image.   #pike 0.6       import 0.6::Image;    import 0.6::Stdio;    string fn;       constant Image = 7.6::Image;
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:186: Inside #if constant(Image.PNG.encode)
   if(objectp(o))    o=PNG.encode(o);    Stdio.write_file(fn, o);    if(verbosity > 1)    werror(\"Wrote %s.\\n\", fn);   #endif    return \"<image>\"+fn+\"</image>\";    }       object|string render() { -  // Make sure we get the same images every time, -  // even if they have a random component. -  random_seed(0x6aa6a66a); +    ",   });      string execute;      mapping parse=([ " appendix":([]) ]);   int illustration_counter;      int verbosity = 1;   
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:496:       value = lower_case(value);       string tag = p->parse_tag_name(value[1..<1]);       array(string) ret = ({});       if (has_prefix(tag, "/")) {    // End tag. Pop to starttag.    tag = tag[1..]; -  if (!has_value(nesting->arr[..nesting->ptr-1], tag)) { +  if (!has_value(nesting, tag)) {    // Extraneous end-tag -- remove it.    return ({""});    }    ret = pop_to_tag(tag);    nesting->pop();    } else if (!sizeof(tag) || has_value(tag, "(") || has_value(tag, ")")) {    // Insufficient quoting of paired < and >.    return ({ _Roxen.html_encode_string(orig_value) });    } else {    if (dtd_nesting[tag]) {
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:618:    for (i=0; i<sizeof(in); i++)    switch (in[i])    {    case '(': q++; break;    case ')': q--; if (!q) return ({in[..i-1],in[i+1..]}); break;    }    return ({in,""});    };    string combine_or(string a,string b)    { -  b = String.trim_all_whites(b); +  b = String.trim(b);    if (b[..3]=="<or>") b=b[4..<5];    return "<or>"+a+b+"</or>";    };    array(string) paramlist(string in,string indent)    {    int i;    int q=0;    array res=({});    for (i=0; i<sizeof(in); i++)    switch (in[i])
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:806:    int br;    for (; i<sizeof(in); i++) {    t += in[i..i];    if(in[i]=='(') br++;    if(in[i]==')') br--;    if(in[i]==' ' && !br) {    t = doctype(t[..<1]);    break;    }    if(br==-1 || (in[i]==',' && !br)) { -  if(String.trim_all_whites(t)==")") +  if(String.trim(t)==")")    return res; -  if(String.trim_all_whites(t[..<1])=="void" && res=="") +  if(String.trim(t[..<1])=="void" && res=="")    return "<argument/>\n";       if(t[-1]==')')    return res += "<argument><value>" + t[..<1] + "</value></argument>";    if(t[-1]==',')    break;    }    }       if(t[-1]==',') {    res += "<argument><value>" + t[..<1] + "</value></argument>";    i++;    continue;    }       // Find name    string n = "";    i++;    for (; i<sizeof(in); i++) {    if(in[i]==')') { -  if(!sizeof(String.trim_all_whites(n))) +  if(!sizeof(String.trim(n)))    throw( ({ "Empty argument name. ("+in+")\n", backtrace() }) );    return res + "<argument name=" + S(n) + "><type>" + t +    "</type></argument>\n";    }    if(in[i]==',') { -  if(!sizeof(String.trim_all_whites(n))) +  if(!sizeof(String.trim(n)))    throw( ({ "Empty argument name. ("+in+")\n", backtrace() }) );    res += "<argument name=" + S(n) + "><type>" + t +    "</type></argument>\n";    break;    }    if(in[i]==' ') {    if(n=="...") {    n = "";    t = "<varargs>" + t + "</varargs>";    }
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:1159:    }       object f = class {    string doc = "";    int write(string in) {    doc += in;    return sizeof(in);    }    string read() {    return string_to_utf8("<?xml version='1.0' encoding='utf-8'?>\n" -  "<autodoc>\n" + doc + "</autodoc>\n"); +  "<autodoc>\n" + string_to_utf8(doc) + +  "</autodoc>\n");    }    }();       string here = getcwd();    cd(builddir);       mixed err = catch {    // Module documentation exists in a namespace...    f->write("<namespace name='" + namespace + "'>\n");    foreach (sort(indices(parse)-({"_order", " appendix"})),string module)
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:1304:    string defines = sprintf("#define IMAGE_DIR %O\n", IMAGE_DIR);    program ip;    foreach(reverse(templates); int t; string template) {    if (!(flags & .FLAG_COMPAT) && ((t+1) != sizeof(templates))) {    continue;    }    code = defines + template + illustration_code + "\n;\n}\n";    handler = CompilationHandler();    ip = UNDEFINED;    err = catch { +  Random.Interface rnd = Random.Deterministic(0); +  add_constant("random", rnd->random); +  add_constant("random_string", rnd->random_string); +     ip = compile_string(code, "-", handler); -  // Make sure we get the same images every time, -  // even if they have a random component. -  random_seed(0x6aa6a66a); +     object g = ip(name, verbosity, type);    return ({ g->make() });    };    }    werror("Illustration at %O failed:\n"    "%s\n"    "******\n", where, handler->lines * "");    array(string) rows = code/"\n";    for(int i; i<sizeof(rows); i++)    werror("%04d: %s\n", i+1, rows[i]);
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:1331:    werror("%s\n", describe_backtrace(err));    }    return ({ "" }); // FIXME: Broken image?    }    throw(err);   }      void create(string image_dir, void|.Flags flags)   {    verbosity = (flags & .FLAG_VERB_MASK); -  this_program::flags = flags; +  this::flags = flags;       IMAGE_DIR = image_dir;       nesting_parser = Parser.HTML();    nesting_parser->_set_tag_callback(fix_tag_nesting);       parser = Parser.HTML();       Parser.HTML p = Parser.HTML();   
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:1394:    "));",    "mktag(\"td\",([\"align\":\"left\",\"valign\":\"center\"]),replace(longdesc, ({ \"<\",\">\",\"&\" }), ({\"&lt;\",\"&gt;\",\"&amp;\"})))",    }));    string name;    sscanf(where, "file='%s'", name);    name = (name/"/")[-1];    array err;    object g;       err = catch { +  Random.Interface rnd = Random.Deterministic(0); +  add_constant("random", rnd->random); +  add_constant("random_string", rnd->random_string); +     g = compile_string(execute + c)    (illustration_counter, name); -  // Make sure we get the same images every time, -  // even if they have a random component. -  random_seed(0x6aa6a66a); +     g->main();    };       if(err) {    werror("%O\n", where);    array rows = (execute+c)/"\n";    werror("******\n");    for(int i; i<sizeof(rows); i++)    werror("%04d: %s\n", i+1, rows[i]);    werror("******\n");
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:1545:    }    }       Interceptor write = Interceptor();       int img_counter;    string prefix;    void create(int _img_counter, string _prefix) {    img_counter = _img_counter;    prefix = _prefix; -  // Make sure we get the same images every time, -  // even if they have a random component. -  random_seed(0x6aa6a66a); +     }       string illustration(string|Image.Image img, mapping|object extra,    void|string suffix) {    string fn = prefix + \".\" + (img_counter++) + (suffix||\".png\");    if (objectp(extra)) extra = ([ \"alpha\":extra ]);   #if constant(Image.PNG.encode)    if(!stringp(img))    img = Image.PNG.encode(img, extra);    Stdio.write_file(fn, img);"+
pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/MirarDocParser.pike:1572:    }       string illustration_jpeg(Image.Image img, mapping|void extra) {   #if constant(Image.JPEG.encode)    return illustration(Image.JPEG.encode(img, extra||([])), extra, \".jpeg\");   #else    return illustration(img, extra);   #endif    }    -  static string low_mktag(string name, void|mapping args) { +  protected string low_mktag(string name, void|mapping args) {    if(!args) args = ([]);    string res = \"<\" + name;    foreach(sort(indices(args)), string attr)    res += \" \" + attr + \"='\" + args[attr] + \"'\";    return res;    }       string mktag(string name, void|mapping args, void|string c) {    string res = low_mktag(name, args);    if(!c)