pike.git / src / modules / Image / mkwmml.pike

version» Context lines:

pike.git/src/modules/Image/mkwmml.pike:1: - /* $Id: mkwmml.pike,v 1.1 1997/11/10 05:41:13 mirar Exp $ */ + /* $Id: mkwmml.pike,v 1.2 1997/11/10 13:24:23 mirar Exp $ */      import Stdio;   import Array;      mapping parse=([]);   int illustration_counter;      #define error(X) throw( ({ (X), backtrace()[0..sizeof(backtrace())-2] }) )      /*
pike.git/src/modules/Image/mkwmml.pike:229:    string decl,name;    multiset(string) names=(<>);    foreach (decls,decl)    {    sscanf(decl,"%*s%*[\t ]%s%*[\t (]%*s",name);    names[name]=1;    }    return names;   }    + string *nice_order(string *arr) + { +  sort(map(arr,replace,({"_","`"}),({"ÿ","þ"})), +  arr); +  return arr; + }      string addprefix(string suffix,string prefix)   {    return prefix+suffix;   }      void document(mapping huh,string name,string prefix,object f)   {    string *names;   
pike.git/src/modules/Image/mkwmml.pike:259:       foreach (names,string n)    f->write("<anchor name="+linkify(n)+">\n");       f->write("<dl>\n");      // NAME       f->write("<dt><encaps>NAME</encaps><dd>\n");    -  foreach (names,n) +  foreach (nice_order(names),n)    f->write("\t<tt>"+n+"</tt><br>\n");       f->write("<p>\n");      // [SYNTAX]       if (huh->decl)    {    f->write("<dt><encaps>SYNTAX</encaps><dd>\n");   
pike.git/src/modules/Image/mkwmml.pike:302:    f->write("\t<table border=1 cellspacing=0><tr>\n"    "\t<td align=left><font size=-2>argument(s)</font></td>"    "\t<td align=left><font size=-2>description</font></td>"    "</tr>\n\n");       foreach (huh->args,mapping arg)    {    if (arg->desc)    {    f->write("\t<tr align=left><td valign=top>\n" -  +rarg+"\t\t<tt>" +  +fixdesc(rarg+"\t\t<tt>"    +arg->args*"</tt><br>\n\t\t<tt>" -  +"</tt></td>\n" +  +"</tt></td>\n",prefix,arg->_line)    +"\t<td valign=bottom>"    +fixdesc(arg->desc,prefix,arg->_line)    +"</td></tr>\n\n");    rarg="";    }    else    {    rarg+="\t\t<tt>"    +arg->args*"</tt><br>\n\t\t<tt>"+    "</tt><br>\n";
pike.git/src/modules/Image/mkwmml.pike:367:    // postprocess methods to get names       multiset(string) method_names=(<>);    string *method_names_arr,method_name;    mapping method;       if (huh->methods)    foreach (huh->methods,method)    method_names|=(method->names=get_method_names(method->decl));    -  method_names_arr=sort(indices(method_names)); +  method_names_arr=nice_order(indices(method_names));       // alphabetically       foreach (method_names_arr,method_name)    if (method_names[method_name])    {    // find it    foreach (huh->methods,method)    if ( method->names[method_name] )    {    document(method,prefix,prefix,f);    method_names-=method->names;    }    if (method_names[method_name])    stderr->write("failed to find "+method_name+" again, wierd...\n");    } -  -  foreach(huh->methods,mapping child) -  { -  document(child,prefix,prefix,f); +     } -  } +        if (huh->classes)    { -  foreach(indices(huh->classes),string n) +  foreach(nice_order(indices(huh->classes)),string n)    {    f->write("\n\n\n<section title=\""+prefix+n+"\">\n");    document(huh->classes[n],    prefix+n,prefix+n+"->",f);    f->write("</section title=\""+prefix+n+"\">\n");    }    }       if (huh->modules)    { -  foreach(indices(huh->modules),string n) +  foreach(nice_order(indices(huh->modules)),string n)    {    f->write("\n\n\n<section title=\""+prefix+n+"\">\n");    document(huh->modules[n],    prefix+n,prefix+n+".",f);    f->write("</section title=\""+prefix+n+"\">\n");    }    }   // end ANCHOR       foreach (names,string n)