Roxen.git / server / base_server / highlight_pike.pike

version» Context lines:

Roxen.git/server/base_server/highlight_pike.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS. - // $Id: highlight_pike.pike,v 1.6 2004/06/30 16:58:37 mast Exp $ + // $Id: highlight_pike.pike,v 1.7 2008/05/09 16:23:59 mast Exp $      string quote(string s)   {    return replace(s,({ "<", ">", "&", }),({"&lt;", "&gt;", "&amp;" }));   }      string highlight_string(string s,mapping m)   {    if(m->dark)    return "<i><font color='darkred'>"+quote(s)+"</font></i>";
Roxen.git/server/base_server/highlight_pike.pike:54:   }      constant keywords=({"foreach","break","constant","catch","gauge","class","continue","do","else","for","foreach","if","import","inherit","inline","lambda","nomask","private","protected","public","return","static","final", "switch","throw","while",});      constant types=({"mapping","function","multiset","array","object","program","float","int","mixed","string","void"});            array (string) find_decl(string in)   { -  string pre,decl,p2; +  string pre,decl;    sscanf(in, "%[ \t\r\n]%s", pre, in);    if(!strlen(in)) return ({"",pre+in});    if(in[0]==')') // Cast    return ({"",pre+in});    if(sscanf(in, "%[^(),; \t\n\r]%s", decl,in)==2)    return ({ pre+decl, in });    return ({ "", pre+in });   }      string find_complex_type(string post)
Roxen.git/server/base_server/highlight_pike.pike:100:    }    p+="|"+find_complex_type(post);    }    return p;    }    return p;   }      array (string) find_type(string in)   { -  string s,pre,post,decl; +  string s,pre,post;    int min=10000000000,i;    string mt;    foreach(types, s)    if(((i=search(in, s))!=-1) && i<min)    {    if(i) switch(in[i-1])    {    default:   // report_debug("Invalid type thingie: '"+in[i..i]+"'\n");    continue;