pike.git / lib / modules / Calendar.pmod / mkrules.pike

version» Context lines:

pike.git/lib/modules/Calendar.pmod/mkrules.pike:85:      class Shift   {    string dayrule;    int time;    string timetype;    int offset;    string s;    string comment;    -  void create(array a) +  protected void create(array a)    {    switch (sizeof(a))    {    case 5:    dayrule=think_day(a[0],a[1]);    comment=a[0]+" "+a[1];    // NB: The Morocco rule for 2011-07-31 has 0 as AT,    // while all others have 0:00.    [time,timetype] = parse_tod(a[2]) || ({ 0, "" });    switch (timetype)
pike.git/lib/modules/Calendar.pmod/mkrules.pike:119:    }    }       protected string _sprintf(int t)    {    return t=='O' &&    sprintf("Shift(%s,%d%s,%+d,%O)",    dayrule,time,timetype,offset,s);    }    -  int `==(Shift other) +  protected int `==(Shift other)    {    return ( dayrule==other->dayrule &&    time==other->time &&    timetype==other->timetype &&    offset==other->offset &&    s==other->s );    }    function(Shift:int) __equal=`==;       constant wday=(["Mon":1,"Tue":2,"Wed":3,"Thu":4,"Fri":5,"Sat":6,"Sun":7]);
pike.git/lib/modules/Calendar.pmod/mkrules.pike:190:    return "LDAY ("+(nleapy->month(mon)->day(d)->year_day())+    ","+wd+")";       return "LDAYL("+(nleapy->month(mon)->day(d)->year_day())+    ","+wd+")";    }    else    complain("unknown rule method %O\n",rule);    }    -  Shift|array ``+(array|Shift s) +  protected Shift|array ``+(array|Shift s)    {    if (!s) return this;    if (!arrayp(s)) s=({s});    return s+({this});    }       int ldayl_is_fix_l(int d1,int wd,int d2,int yn1,int yn2)    {    object y1=Year(yn1);    object y2=Year(yn2);
pike.git/lib/modules/Calendar.pmod/mkrules.pike:291:       a[7] = (a[7]/" #")[0];    if (a[7] == "-") a[7] = "";    symbols[a[7]] = 1;       if (!(int)a[0] && a[0]!="min")    complain("unknown year %O\n",a[0]);      // ---    - #define INF_YEAR 2050 + #define INF_YEAR 2150   #define NUL_YEAR 1850       int y1=(int)a[0] || NUL_YEAR;    int y2;    if (a[1]=="max") y2=INF_YEAR;    else if (a[1]=="only") y2=y1;    else if (!(y2=(int)a[1]))    complain("unknown year %O\n",a[1]);    else if (y2>=INF_YEAR)    complain("big year\n");
pike.git/lib/modules/Calendar.pmod/mkrules.pike:381:    if (y0==NUL_YEAR)    {    if (my[INF_YEAR])    t+=" default: // .."+max(y1,mn-1)+    " and ½½½..\n";    else    t+=" default: // .."+max(y1,mn-1)+":\n";    }    else if (y0==y1)    t+=" case "+y0+":\n"; -  else if (y1==2050) +  else if (y1 == INF_YEAR)    {    if (!my[NUL_YEAR]) t+=" case "+y0+"..:\n";    else t=replace(t,"½½½",(string)y0);    }    else    t+=" case "+y0+".."+y1+":\n";       y0=y1;    }