pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:3388:       exit(0, format_paths());       case "execute":    main_resolv( "Gmp.bignum" );    random_seed((time() ^ (getpid()<<8)));    argv = tmp->get_args(argv,1);       program prog;    mixed compile_err = catch {; -  if(cur_compat_ver <= Version(7,4)) -  prog = compile_string( -  "mixed create(int argc, array(string) argv,array(string) env){"+ -  opts[1]+";}"); -  else if (intp (opts[1])) +  if (intp (opts[1]))    prog = compile_string ("mixed run() {}");    else {    string code = opts[1];    while(sscanf(code, "%sCHAR(%1s)%s", code, string c, string rest)==3)    code += c[0] + rest;    if (cur_compat_ver <= Version (7, 6))    prog = compile_string(    "#define NOT(X) !(X)\n"    "mixed run(int argc, array(string) argv,"    "mapping(string:string) env){"+
pike.git/lib/master.pike.in:3430:   #if constant(_debug)    if(debug) _debug(debug);   #endif    if(trace) trace = predef::trace(trace);    mixed ret;    mixed err = catch {    // One reason for this catch is to get a new call to    // eval_instruction in interpret.c so that the debug and    // trace levels set above take effect in the bytecode    // evaluator. -  if(cur_compat_ver <= Version(7,4)) -  prog (sizeof(argv),argv,getenv()); -  else if (cur_compat_ver <= Version (7, 6)) +  if (cur_compat_ver <= Version (7, 6))    ret = prog()->run(sizeof(argv),argv,getenv());    else    ret = prog()->run(sizeof(argv),argv);    };    predef::trace(trace);    if (err) {    handle_error (err);    ret = 10;    }    if(stringp(ret)) {
pike.git/lib/master.pike.in:3580:   #endif    if(trace) trace = predef::trace(trace);    mixed ret;    mixed err = catch {    // The main reason for this catch is actually to get a new call    // to eval_instruction in interpret.c so that the debug and    // trace levels set above take effect in the bytecode evaluator.    // Note that it won't work if there's another catch surrounding    // this one.    object script; -  if(cur_compat_ver <= Version(7,4)) { -  script=prog(); -  } -  else { +     script=prog(argv); -  } +     if(!script->main)    error("Error: %s has no main().\n", argv[0]);    if (cur_compat_ver <= Version (7, 6))    ret=script->main(sizeof(argv),argv,getenv());    else if (cur_compat_ver <= Version (8, 0))    ret = script->main(sizeof(argv),argv);    else    {    mixed first_arg = __get_first_arg_type(_typeof(script->main));    // NB: first_arg may be zero eg in case main() ignores all args.