pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:10629:    tFunc(tArray,tArr(tInt)), 0, OPT_TRY_OPTIMIZE);       /* Type variable use in map():    *    * 0: Accumulated argument types for callback function.    * 1: Iterator value type (aka indices). First arg to callback function.    * 2: Result value type. Return type for callback function.    * 3: Mapping index type when looping over mapping.    * 4: Callback function continuation type for optional arguments and result.    */ - #define tMapStuffLow(IN,SUB,OUTSET,OUTPROG,OUTMIX,OUTARR,OUTMAP) \ -  tOr5( tFuncV(IN tSet(tMix),tMix,OUTSET), \ + #define tMapStuffLow(IN,SUB,OUTSET,OUTPROG,OUTARR,OUTMAP) \ +  tOr3( tFuncV(IN tSet(tMix),tMix,OUTSET), \    tFuncV(IN tMap(tMix, tSetvar(2,tMix)), tMix, OUTMAP), \ -  tFuncV(IN tArray, tMix, OUTARR), \ -  tIfnot(tFuncV(IN, tNot(tMix), tMix), \ -  tFuncV(IN, tMix, OUTMIX)), \ -  tFuncV(IN, tVoid, OUTMIX) ) +  tFuncV(IN tArray, tMix, OUTARR) )    - #define tMapStuff(IN,SUB,OUTFUN,OUTSET,OUTPROG,OUTMIX,OUTARR,OUTMAP) \ + #define tMapStuff(IN,SUB,OUTFUN,OUTSET,OUTPROG,OUTARR,OUTMAP) \    tOr( tFuncV(IN tFuncV(SUB, tSetvar(0, tAny), tSetvar(2,tAny)), \    tVar(0), OUTFUN), \ -  tMapStuffLow(IN,SUB,OUTSET,OUTPROG,OUTMIX,OUTARR,OUTMAP)) +  tMapStuffLow(IN,SUB,OUTSET,OUTPROG,OUTARR,OUTMAP))       ADD_EFUN2("map", f_map, -  tOr8(tFuncArg(tArr(tSetvar(1,tMix)), +  tOr9(tFuncArg(tArr(tSetvar(1,tMix)),    tFuncArg(tFuncArg(tVar(1),    tSetvar(4,    tFuncV(tNone, tUnknown, tMix))),    tArr(tVar(4)))),    tMapStuffLow(tArr(tSetvar(1,tMix)),tVar(1),    tArr(tInt01),    tArr(tObj), -  tArr(tMix), +     tArr(tArr(tMix)),    tArr(tOr(tInt0,tVar(2)))),       tMapStuff(tMap(tSetvar(3,tMix),tSetvar(1,tMix)),tVar(1),    tMap(tVar(3),tVar(2)),    tMap(tVar(3),tInt01),    tMap(tVar(3),tObj), -  tMap(tVar(3),tMix), +     tMap(tVar(3),tArr(tMix)),    tMap(tVar(3),tOr(tInt0,tVar(2)))),       tMapStuff(tSet(tSetvar(1,tMix)),tVar(1),    tSet(tVar(2)),    tSet(tInt01),    tSet(tObj), -  tSet(tMix), +     tSet(tArr(tMix)),    tSet(tOr(tInt0,tVar(2)))),       tMapStuff(tAnd(tNot(tArray),tOr(tPrg(tObj),tFunction)),tMix,    tMap(tStr,tVar(2)),    tMap(tStr,tInt01),    tMap(tStr,tObj), -  tMap(tStr,tMix), +     tMap(tStr,tArr(tMix)),    tMap(tStr,tOr(tInt0,tVar(2)))),       tOr4( tFuncV(tString tFuncV(tInt,tMix,tInt),tMix,tString),    tFuncV(tString tFuncV(tInt,tMix,tInt),tMix,tString),    tFuncV(tString tSet(tMix),tMix,tString),    tFuncV(tString tMap(tMix,tInt), tMix, tString) ),       tOr4 (tFuncV(tArr(tStringIndicable) tString,tMix,tArray),    tFuncV(tMap(tSetvar(3,tMix),tStringIndicable) tString,tMix,    tMap(tVar(3),tMix)),    tFuncV(tSet(tStringIndicable) tString,tMix,tSet(tMix)),    tFuncV(tOr(tPrg(tObj),tFunction) tString,tMix,tMapping)),    -  +  tFunc(tSetvar(0, tOr4(tArray, tString, +  tMap(tMix, tMix), tSet(tMix))), +  tVar(0)), +     tFuncV(tObj,tMix,tMix) ),    OPT_TRY_OPTIMIZE, fix_map_node_info, 0);      #if 1    ADD_EFUN2("filter", f_filter,    tOr5(tFuncV(tSetvar(1,tOr(tMapping,tMultiset)),    tMixed,    tVar(1)),    tFuncV(tNStr(tSetvar(0,tInt)), tMixed, tNStr(tVar(0))),    tFuncV(tArr(tSetvar(0,tMixed)), tMixed, tArr(tVar(0))),