pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.393 2007/06/11 14:24:57 mbaehr Exp $ + // $Id: master.pike.in,v 1.394 2007/06/12 14:29:14 mbaehr Exp $      #pike __REAL_VERSION__   //#pragma strict_types      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif   
pike.git/lib/master.pike.in:345:   //!   //! @seealso   //! @[compile()], @[cpp()], @[compile_file()]   //!   program compile_string(string source, void|string filename,    object|void handler,    void|program p,    void|object o,    void|int _show_if_constant_errors)   { -  return compile(cpp(source, filename||"-", 1, handler, +  program ret = compile(cpp(source, filename||"-", 1, handler,    compat_major, compat_minor,    (zero_type(_show_if_constant_errors)?    show_if_constant_errors:    _show_if_constant_errors)),    handler,    compat_major,    compat_minor,    p,    o); -  +  cache_source(ret, filename, source); +  return ret;   }      //!   string master_read_file(string file)   {    object o=Files()->Fd();    if( ([function(string, string : int)]o->open)(fakeroot(file),"r") )    return ([function(void : string)]o->read)();    return 0;   }
pike.git/lib/master.pike.in:501:   //!   //! @seealso   //! @[compile()], @[compile_string()], @[cpp()]   //!   program compile_file(string filename,    object|void handler,    void|program p,    void|object o)   {    AUTORELOAD_CHECK_FILE(filename); -  return compile(cpp(master_read_file(filename), +  program ret = compile(cpp(master_read_file(filename),    filename,    1,    handler,    compat_major,    compat_minor),    handler,    compat_major,    compat_minor,    p,    o); -  +  cache_source(ret, filename); +  return ret;   }            #if 0   variant mapping(string:string) getenv()   {    return environment + ([]);   }   
pike.git/lib/master.pike.in:751:    if (has_suffix(fname, ".pike")) return 1;       // FIXME: Warn here?    return 0;   }      //! Used to capture the source from programs being compiled to allow later   //! extraction of documentation   static void cache_source(mixed ret, string fname, void|string source)   { -  if (documentation && !documentation[ret]) -  documentation[ret] = ([ "fname":fname, "source":source ]); +  if (documentation && !documentation[ret] && (fname||source)) +  { +  if (fname) +  documentation[ret] = ([ "fname":fname ]); +  else +  documentation[ret] = ([ "source":source ]);    } -  + }      //! Show documentation for the item @[obj]   //!   //! @param obj   //! The object for which the documentation should be shown   //!   //! @returns   //! an AutoDoc object   object show_doc(program|object|function obj)   {    object doc_extractor = main_resolv("Tools.AutoDoc.PikeExtractor.extractClass");    string child;    program prog;    if (programp(obj))    prog = obj;    if (functionp(obj))    {    prog = function_program(obj); -  child = (describe_function(obj)/"->")[-1]; +  child = ((describe_function(obj)||"")/"->")[-1];    }    if (objectp(obj))    {    if (obj->is_resolv_joinnode)    obj = obj->joined_modules[0]; // FIXME: check for multiples    if (obj->is_resolv_dirnode)    prog = object_program(obj->module);    }       if (doc_extractor && documentation[prog] && !documentation[prog]->doc)
pike.git/lib/master.pike.in:933:    } )    {    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("low_findprog %s: compilation failed\n", fname);    objects[ret] = no_value;    ret=programs[fname]=0; // Negative cache.    throw(e);    }    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("low_findprog %s: compilation ok\n", fname); -  cache_source(ret, fname, src); +  cache_source(ret, fname);    break;      #if constant(load_module)    case ".so":    if (fname == "") {    werror( "low_findprog(%O, %O) => load_module(\"\")\n"    "%s\n", pname, ext, describe_backtrace(backtrace()) );    }       if (array|object err = catch (ret = load_module(fakeroot(fname)))) {