diff options
Diffstat (limited to 'ext/date')
-rw-r--r-- | ext/date/lib/parse_date.c | 202 | ||||
-rw-r--r-- | ext/date/lib/parse_date.re | 2 | ||||
-rw-r--r-- | ext/date/lib/parse_iso_intervals.c | 38 | ||||
-rw-r--r-- | ext/date/lib/parse_iso_intervals.re | 2 | ||||
-rw-r--r-- | ext/date/lib/timelib.h | 10 | ||||
-rw-r--r-- | ext/date/lib/timelib.m4 | 3 | ||||
-rw-r--r-- | ext/date/lib/timezonemap.h | 16 | ||||
-rw-r--r-- | ext/date/lib/tm2unixtime.c | 1 |
8 files changed, 131 insertions, 143 deletions
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 5be4d36e67..e95bc3e4aa 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.15.3 on Tue Oct 9 10:50:25 2018 */ +/* Generated by re2c 0.15.3 on Fri Oct 12 10:49:04 2018 */ #line 1 "parse_date.re" /* * The MIT License (MIT) @@ -24,8 +24,6 @@ * THE SOFTWARE. */ -/* $Id$ */ - #include "timelib.h" #include "timelib_private.h" @@ -885,11 +883,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) std: s->tok = cursor; s->len = 0; -#line 1012 "parse_date.re" +#line 1010 "parse_date.re" -#line 893 "<stdout>" +#line 891 "<stdout>" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1027,7 +1025,7 @@ yy2: } yy3: YYDEBUG(3, *YYCURSOR); -#line 1720 "parse_date.re" +#line 1718 "parse_date.re" { int tz_not_found; DEBUG_OUTPUT("tzcorrection | tz"); @@ -1040,7 +1038,7 @@ yy3: TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 1044 "<stdout>" +#line 1042 "<stdout>" yy4: YYDEBUG(4, *YYCURSOR); yych = *++YYCURSOR; @@ -1349,12 +1347,12 @@ yy11: if (yych <= '9') goto yy1377; yy12: YYDEBUG(12, *YYCURSOR); -#line 1815 "parse_date.re" +#line 1813 "parse_date.re" { add_error(s, TIMELIB_ERR_UNEXPECTED_CHARACTER, "Unexpected character"); goto std; } -#line 1358 "<stdout>" +#line 1356 "<stdout>" yy13: YYDEBUG(13, *YYCURSOR); yych = *++YYCURSOR; @@ -2598,11 +2596,11 @@ yy48: if (yych <= '9') goto yy54; yy49: YYDEBUG(49, *YYCURSOR); -#line 1804 "parse_date.re" +#line 1802 "parse_date.re" { goto std; } -#line 2606 "<stdout>" +#line 2604 "<stdout>" yy50: YYDEBUG(50, *YYCURSOR); yych = *++YYCURSOR; @@ -2611,12 +2609,12 @@ yy51: YYDEBUG(51, *YYCURSOR); ++YYCURSOR; YYDEBUG(52, *YYCURSOR); -#line 1809 "parse_date.re" +#line 1807 "parse_date.re" { s->pos = cursor; s->line++; goto std; } -#line 2620 "<stdout>" +#line 2618 "<stdout>" yy53: YYDEBUG(53, *YYCURSOR); yych = *++YYCURSOR; @@ -3052,7 +3050,7 @@ yy73: if (yych == 's') goto yy75; yy74: YYDEBUG(74, *YYCURSOR); -#line 1788 "parse_date.re" +#line 1786 "parse_date.re" { timelib_ull i; DEBUG_OUTPUT("relative"); @@ -3067,7 +3065,7 @@ yy74: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 3071 "<stdout>" +#line 3069 "<stdout>" yy75: YYDEBUG(75, *YYCURSOR); yych = *++YYCURSOR; @@ -3970,7 +3968,7 @@ yy190: } yy191: YYDEBUG(191, *YYCURSOR); -#line 1651 "parse_date.re" +#line 1649 "parse_date.re" { const timelib_relunit* relunit; DEBUG_OUTPUT("daytext"); @@ -3987,7 +3985,7 @@ yy191: TIMELIB_DEINIT; return TIMELIB_WEEKDAY; } -#line 3991 "<stdout>" +#line 3989 "<stdout>" yy192: YYDEBUG(192, *YYCURSOR); yych = *++YYCURSOR; @@ -4507,7 +4505,7 @@ yy217: } yy218: YYDEBUG(218, *YYCURSOR); -#line 1710 "parse_date.re" +#line 1708 "parse_date.re" { DEBUG_OUTPUT("monthtext"); TIMELIB_INIT; @@ -4516,7 +4514,7 @@ yy218: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4520 "<stdout>" +#line 4518 "<stdout>" yy219: YYDEBUG(219, *YYCURSOR); ++YYCURSOR; @@ -4765,7 +4763,7 @@ yy231: goto yy237; yy232: YYDEBUG(232, *YYCURSOR); -#line 1456 "parse_date.re" +#line 1454 "parse_date.re" { int length = 0; DEBUG_OUTPUT("datetextual | datenoyear"); @@ -4778,7 +4776,7 @@ yy232: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4782 "<stdout>" +#line 4780 "<stdout>" yy233: YYDEBUG(233, *YYCURSOR); yyaccept = 6; @@ -4905,7 +4903,7 @@ yy245: } yy246: YYDEBUG(246, *YYCURSOR); -#line 1758 "parse_date.re" +#line 1756 "parse_date.re" { int tz_not_found; DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); @@ -4934,7 +4932,7 @@ yy246: TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 4938 "<stdout>" +#line 4936 "<stdout>" yy247: YYDEBUG(247, *YYCURSOR); yyaccept = 7; @@ -5232,7 +5230,7 @@ yy270: YYDEBUG(270, *YYCURSOR); ++YYCURSOR; YYDEBUG(271, *YYCURSOR); -#line 1734 "parse_date.re" +#line 1732 "parse_date.re" { DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); TIMELIB_INIT; @@ -5255,7 +5253,7 @@ yy270: TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 5259 "<stdout>" +#line 5257 "<stdout>" yy272: YYDEBUG(272, *YYCURSOR); yych = *++YYCURSOR; @@ -5862,7 +5860,7 @@ yy320: YYDEBUG(321, *YYCURSOR); ++YYCURSOR; YYDEBUG(322, *YYCURSOR); -#line 1428 "parse_date.re" +#line 1426 "parse_date.re" { int length = 0; DEBUG_OUTPUT("datenoday"); @@ -5875,7 +5873,7 @@ yy320: TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 5879 "<stdout>" +#line 5877 "<stdout>" yy323: YYDEBUG(323, *YYCURSOR); yych = *++YYCURSOR; @@ -6106,7 +6104,7 @@ yy327: if (yych <= '9') goto yy331; yy330: YYDEBUG(330, *YYCURSOR); -#line 1572 "parse_date.re" +#line 1570 "parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextshort"); @@ -6119,7 +6117,7 @@ yy330: TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 6123 "<stdout>" +#line 6121 "<stdout>" yy331: YYDEBUG(331, *YYCURSOR); yych = *++YYCURSOR; @@ -6701,7 +6699,7 @@ yy356: } yy357: YYDEBUG(357, *YYCURSOR); -#line 1630 "parse_date.re" +#line 1628 "parse_date.re" { DEBUG_OUTPUT("ago"); TIMELIB_INIT; @@ -6721,7 +6719,7 @@ yy357: TIMELIB_DEINIT; return TIMELIB_AGO; } -#line 6725 "<stdout>" +#line 6723 "<stdout>" yy358: YYDEBUG(358, *YYCURSOR); yyaccept = 5; @@ -8504,7 +8502,7 @@ yy418: ++YYCURSOR; yy419: YYDEBUG(419, *YYCURSOR); -#line 1333 "parse_date.re" +#line 1331 "parse_date.re" { DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash"); TIMELIB_INIT; @@ -8515,7 +8513,7 @@ yy419: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 8519 "<stdout>" +#line 8517 "<stdout>" yy420: YYDEBUG(420, *YYCURSOR); yyaccept = 0; @@ -9159,7 +9157,7 @@ yy439: } yy440: YYDEBUG(440, *YYCURSOR); -#line 1470 "parse_date.re" +#line 1468 "parse_date.re" { DEBUG_OUTPUT("datenoyearrev"); TIMELIB_INIT; @@ -9170,7 +9168,7 @@ yy440: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 9174 "<stdout>" +#line 9172 "<stdout>" yy441: YYDEBUG(441, *YYCURSOR); yyaccept = 9; @@ -9311,7 +9309,7 @@ yy452: YYDEBUG(452, *YYCURSOR); ++YYCURSOR; YYDEBUG(453, *YYCURSOR); -#line 1188 "parse_date.re" +#line 1186 "parse_date.re" { DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); TIMELIB_INIT; @@ -9327,7 +9325,7 @@ yy452: TIMELIB_DEINIT; return TIMELIB_TIME12; } -#line 9331 "<stdout>" +#line 9329 "<stdout>" yy454: YYDEBUG(454, *YYCURSOR); yyaccept = 10; @@ -9340,7 +9338,7 @@ yy454: } yy455: YYDEBUG(455, *YYCURSOR); -#line 1225 "parse_date.re" +#line 1223 "parse_date.re" { int tz_not_found; DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); @@ -9365,7 +9363,7 @@ yy455: TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 9369 "<stdout>" +#line 9367 "<stdout>" yy456: YYDEBUG(456, *YYCURSOR); yyaccept = 10; @@ -9675,7 +9673,7 @@ yy487: YYDEBUG(487, *YYCURSOR); ++YYCURSOR; YYDEBUG(488, *YYCURSOR); -#line 1205 "parse_date.re" +#line 1203 "parse_date.re" { DEBUG_OUTPUT("mssqltime"); TIMELIB_INIT; @@ -9694,7 +9692,7 @@ yy487: TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 9698 "<stdout>" +#line 9696 "<stdout>" yy489: YYDEBUG(489, *YYCURSOR); yyaccept = 10; @@ -9800,7 +9798,7 @@ yy498: if (yych <= '9') goto yy505; yy499: YYDEBUG(499, *YYCURSOR); -#line 1387 "parse_date.re" +#line 1385 "parse_date.re" { int length = 0; DEBUG_OUTPUT("datefull"); @@ -9814,7 +9812,7 @@ yy499: TIMELIB_DEINIT; return TIMELIB_DATE_FULL; } -#line 9818 "<stdout>" +#line 9816 "<stdout>" yy500: YYDEBUG(500, *YYCURSOR); yych = *++YYCURSOR; @@ -10550,7 +10548,7 @@ yy569: YYDEBUG(570, *YYCURSOR); ++YYCURSOR; YYDEBUG(571, *YYCURSOR); -#line 1402 "parse_date.re" +#line 1400 "parse_date.re" { DEBUG_OUTPUT("pointed date YYYY"); TIMELIB_INIT; @@ -10561,7 +10559,7 @@ yy569: TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 10565 "<stdout>" +#line 10563 "<stdout>" yy572: YYDEBUG(572, *YYCURSOR); yyaccept = 10; @@ -10597,7 +10595,7 @@ yy575: if (yych <= '9') goto yy569; yy576: YYDEBUG(576, *YYCURSOR); -#line 1414 "parse_date.re" +#line 1412 "parse_date.re" { int length = 0; DEBUG_OUTPUT("pointed date YY"); @@ -10610,7 +10608,7 @@ yy576: TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 10614 "<stdout>" +#line 10612 "<stdout>" yy577: YYDEBUG(577, *YYCURSOR); yyaccept = 10; @@ -11251,7 +11249,7 @@ yy620: } yy621: YYDEBUG(621, *YYCURSOR); -#line 1373 "parse_date.re" +#line 1371 "parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshort"); @@ -11264,7 +11262,7 @@ yy621: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 11268 "<stdout>" +#line 11266 "<stdout>" yy622: YYDEBUG(622, *YYCURSOR); yyaccept = 12; @@ -11370,7 +11368,7 @@ yy630: } yy631: YYDEBUG(631, *YYCURSOR); -#line 1317 "parse_date.re" +#line 1315 "parse_date.re" { int length = 0; DEBUG_OUTPUT("americanshort | american"); @@ -11385,7 +11383,7 @@ yy631: TIMELIB_DEINIT; return TIMELIB_AMERICAN; } -#line 11389 "<stdout>" +#line 11387 "<stdout>" yy632: YYDEBUG(632, *YYCURSOR); yyaccept = 13; @@ -11618,7 +11616,7 @@ yy664: if (yych <= ':') goto yy668; yy665: YYDEBUG(665, *YYCURSOR); -#line 1600 "parse_date.re" +#line 1598 "parse_date.re" { int tz_not_found; DEBUG_OUTPUT("clf"); @@ -11638,7 +11636,7 @@ yy665: TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 11642 "<stdout>" +#line 11640 "<stdout>" yy666: YYDEBUG(666, *YYCURSOR); yych = *++YYCURSOR; @@ -12188,7 +12186,7 @@ yy727: } yy728: YYDEBUG(728, *YYCURSOR); -#line 1345 "parse_date.re" +#line 1343 "parse_date.re" { int length = 0; DEBUG_OUTPUT("iso8601date2"); @@ -12201,7 +12199,7 @@ yy728: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 12205 "<stdout>" +#line 12203 "<stdout>" yy729: YYDEBUG(729, *YYCURSOR); yych = *++YYCURSOR; @@ -12240,7 +12238,7 @@ yy735: YYDEBUG(735, *YYCURSOR); ++YYCURSOR; YYDEBUG(736, *YYCURSOR); -#line 1586 "parse_date.re" +#line 1584 "parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextreverse"); @@ -12253,7 +12251,7 @@ yy735: TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 12257 "<stdout>" +#line 12255 "<stdout>" yy737: YYDEBUG(737, *YYCURSOR); yych = *++YYCURSOR; @@ -12418,7 +12416,7 @@ yy747: } yy748: YYDEBUG(748, *YYCURSOR); -#line 1621 "parse_date.re" +#line 1619 "parse_date.re" { DEBUG_OUTPUT("year4"); TIMELIB_INIT; @@ -12426,7 +12424,7 @@ yy748: TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12430 "<stdout>" +#line 12428 "<stdout>" yy749: YYDEBUG(749, *YYCURSOR); yych = *++YYCURSOR; @@ -12631,7 +12629,7 @@ yy757: } yy758: YYDEBUG(758, *YYCURSOR); -#line 1442 "parse_date.re" +#line 1440 "parse_date.re" { int length = 0; DEBUG_OUTPUT("datenodayrev"); @@ -12644,7 +12642,7 @@ yy758: TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 12648 "<stdout>" +#line 12646 "<stdout>" yy759: YYDEBUG(759, *YYCURSOR); yych = *++YYCURSOR; @@ -12865,7 +12863,7 @@ yy778: if (yych <= '7') goto yy781; yy779: YYDEBUG(779, *YYCURSOR); -#line 1553 "parse_date.re" +#line 1551 "parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweek"); @@ -12883,7 +12881,7 @@ yy779: TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 12887 "<stdout>" +#line 12885 "<stdout>" yy780: YYDEBUG(780, *YYCURSOR); yych = *++YYCURSOR; @@ -12893,7 +12891,7 @@ yy781: YYDEBUG(781, *YYCURSOR); ++YYCURSOR; YYDEBUG(782, *YYCURSOR); -#line 1534 "parse_date.re" +#line 1532 "parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweekday"); @@ -12911,7 +12909,7 @@ yy781: TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 12915 "<stdout>" +#line 12913 "<stdout>" yy783: YYDEBUG(783, *YYCURSOR); yych = *++YYCURSOR; @@ -12981,7 +12979,7 @@ yy785: } yy786: YYDEBUG(786, *YYCURSOR); -#line 1520 "parse_date.re" +#line 1518 "parse_date.re" { int length = 0; DEBUG_OUTPUT("pgydotd"); @@ -12994,7 +12992,7 @@ yy786: TIMELIB_DEINIT; return TIMELIB_PG_YEARDAY; } -#line 12998 "<stdout>" +#line 12996 "<stdout>" yy787: YYDEBUG(787, *YYCURSOR); yych = *++YYCURSOR; @@ -13097,7 +13095,7 @@ yy806: ++YYCURSOR; yy807: YYDEBUG(807, *YYCURSOR); -#line 1494 "parse_date.re" +#line 1492 "parse_date.re" { int tz_not_found; DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif"); @@ -13122,7 +13120,7 @@ yy807: TIMELIB_DEINIT; return TIMELIB_XMLRPC_SOAP; } -#line 13126 "<stdout>" +#line 13124 "<stdout>" yy808: YYDEBUG(808, *YYCURSOR); yych = *++YYCURSOR; @@ -13417,7 +13415,7 @@ yy812: } yy813: YYDEBUG(813, *YYCURSOR); -#line 1482 "parse_date.re" +#line 1480 "parse_date.re" { DEBUG_OUTPUT("datenocolon"); TIMELIB_INIT; @@ -13428,7 +13426,7 @@ yy813: TIMELIB_DEINIT; return TIMELIB_DATE_NOCOLON; } -#line 13432 "<stdout>" +#line 13430 "<stdout>" yy814: YYDEBUG(814, *YYCURSOR); yych = *++YYCURSOR; @@ -14347,7 +14345,7 @@ yy937: if (yych <= '9') goto yy960; yy938: YYDEBUG(938, *YYCURSOR); -#line 1359 "parse_date.re" +#line 1357 "parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshorter"); @@ -14360,7 +14358,7 @@ yy938: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 14364 "<stdout>" +#line 14362 "<stdout>" yy939: YYDEBUG(939, *YYCURSOR); yyaccept = 21; @@ -15453,7 +15451,7 @@ yy1030: } yy1032: YYDEBUG(1032, *YYCURSOR); -#line 1251 "parse_date.re" +#line 1249 "parse_date.re" { DEBUG_OUTPUT("gnunocolon"); TIMELIB_INIT; @@ -15475,7 +15473,7 @@ yy1032: TIMELIB_DEINIT; return TIMELIB_GNU_NOCOLON; } -#line 15479 "<stdout>" +#line 15477 "<stdout>" yy1033: YYDEBUG(1033, *YYCURSOR); yych = *++YYCURSOR; @@ -15573,7 +15571,7 @@ yy1039: } yy1040: YYDEBUG(1040, *YYCURSOR); -#line 1297 "parse_date.re" +#line 1295 "parse_date.re" { int tz_not_found; DEBUG_OUTPUT("iso8601nocolon"); @@ -15592,7 +15590,7 @@ yy1040: TIMELIB_DEINIT; return TIMELIB_ISO_NOCOLON; } -#line 15596 "<stdout>" +#line 15594 "<stdout>" yy1041: YYDEBUG(1041, *YYCURSOR); yyaccept = 24; @@ -16568,7 +16566,7 @@ yy1083: } yy1084: YYDEBUG(1084, *YYCURSOR); -#line 1693 "parse_date.re" +#line 1691 "parse_date.re" { timelib_sll i; int behavior = 0; @@ -16584,7 +16582,7 @@ yy1084: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16588 "<stdout>" +#line 16586 "<stdout>" yy1085: YYDEBUG(1085, *YYCURSOR); ++YYCURSOR; @@ -16635,7 +16633,7 @@ yy1092: YYDEBUG(1092, *YYCURSOR); ++YYCURSOR; YYDEBUG(1093, *YYCURSOR); -#line 1166 "parse_date.re" +#line 1164 "parse_date.re" { timelib_sll i; int behavior = 0; @@ -16656,7 +16654,7 @@ yy1092: TIMELIB_DEINIT; return TIMELIB_WEEK_DAY_OF_MONTH; } -#line 16660 "<stdout>" +#line 16658 "<stdout>" yy1094: YYDEBUG(1094, *YYCURSOR); yyaccept = 25; @@ -16764,7 +16762,7 @@ yy1107: } yy1108: YYDEBUG(1108, *YYCURSOR); -#line 1669 "parse_date.re" +#line 1667 "parse_date.re" { timelib_sll i; int behavior = 0; @@ -16787,7 +16785,7 @@ yy1108: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16791 "<stdout>" +#line 16789 "<stdout>" yy1109: YYDEBUG(1109, *YYCURSOR); yych = *++YYCURSOR; @@ -19636,7 +19634,7 @@ yy1283: } yy1284: YYDEBUG(1284, *YYCURSOR); -#line 1143 "parse_date.re" +#line 1141 "parse_date.re" { DEBUG_OUTPUT("backof | frontof"); TIMELIB_INIT; @@ -19658,7 +19656,7 @@ yy1284: TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 19662 "<stdout>" +#line 19660 "<stdout>" yy1285: YYDEBUG(1285, *YYCURSOR); yyaccept = 27; @@ -19957,7 +19955,7 @@ yy1306: YYDEBUG(1306, *YYCURSOR); ++YYCURSOR; YYDEBUG(1307, *YYCURSOR); -#line 1126 "parse_date.re" +#line 1124 "parse_date.re" { DEBUG_OUTPUT("firstdayof | lastdayof"); TIMELIB_INIT; @@ -19973,7 +19971,7 @@ yy1306: TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 19977 "<stdout>" +#line 19975 "<stdout>" yy1308: YYDEBUG(1308, *YYCURSOR); yyaccept = 0; @@ -21462,7 +21460,7 @@ yy1377: if (yych <= '9') goto yy1377; yy1379: YYDEBUG(1379, *YYCURSOR); -#line 1072 "parse_date.re" +#line 1070 "parse_date.re" { timelib_ull i; @@ -21487,7 +21485,7 @@ yy1379: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21491 "<stdout>" +#line 21489 "<stdout>" yy1380: YYDEBUG(1380, *YYCURSOR); yych = *++YYCURSOR; @@ -21516,7 +21514,7 @@ yy1380: YYDEBUG(1386, *YYCURSOR); ++YYCURSOR; YYDEBUG(1387, *YYCURSOR); -#line 1098 "parse_date.re" +#line 1096 "parse_date.re" { timelib_ull i, us; @@ -21543,7 +21541,7 @@ yy1380: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21547 "<stdout>" +#line 21545 "<stdout>" yy1388: YYDEBUG(1388, *YYCURSOR); yych = *++YYCURSOR; @@ -21979,7 +21977,7 @@ yy1416: ++YYCURSOR; yy1417: YYDEBUG(1417, *YYCURSOR); -#line 1060 "parse_date.re" +#line 1058 "parse_date.re" { DEBUG_OUTPUT("tomorrow"); TIMELIB_INIT; @@ -21990,7 +21988,7 @@ yy1417: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21994 "<stdout>" +#line 21992 "<stdout>" yy1418: YYDEBUG(1418, *YYCURSOR); yych = *++YYCURSOR; @@ -22025,7 +22023,7 @@ yy1419: } yy1420: YYDEBUG(1420, *YYCURSOR); -#line 1050 "parse_date.re" +#line 1048 "parse_date.re" { DEBUG_OUTPUT("midnight | today"); TIMELIB_INIT; @@ -22034,7 +22032,7 @@ yy1420: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 22038 "<stdout>" +#line 22036 "<stdout>" yy1421: YYDEBUG(1421, *YYCURSOR); yych = *++YYCURSOR; @@ -24046,7 +24044,7 @@ yy1499: } yy1500: YYDEBUG(1500, *YYCURSOR); -#line 1029 "parse_date.re" +#line 1027 "parse_date.re" { DEBUG_OUTPUT("now"); TIMELIB_INIT; @@ -24054,7 +24052,7 @@ yy1500: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24058 "<stdout>" +#line 24056 "<stdout>" yy1501: YYDEBUG(1501, *YYCURSOR); yych = *++YYCURSOR; @@ -24193,7 +24191,7 @@ yy1507: } yy1508: YYDEBUG(1508, *YYCURSOR); -#line 1038 "parse_date.re" +#line 1036 "parse_date.re" { DEBUG_OUTPUT("noon"); TIMELIB_INIT; @@ -24204,7 +24202,7 @@ yy1508: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24208 "<stdout>" +#line 24206 "<stdout>" yy1509: YYDEBUG(1509, *YYCURSOR); yyaccept = 0; @@ -24737,7 +24735,7 @@ yy1530: ++YYCURSOR; yy1531: YYDEBUG(1531, *YYCURSOR); -#line 1017 "parse_date.re" +#line 1015 "parse_date.re" { DEBUG_OUTPUT("yesterday"); TIMELIB_INIT; @@ -24748,7 +24746,7 @@ yy1531: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24752 "<stdout>" +#line 24750 "<stdout>" yy1532: YYDEBUG(1532, *YYCURSOR); yyaccept = 0; @@ -24921,7 +24919,7 @@ yy1537: goto yy1531; } } -#line 1819 "parse_date.re" +#line 1817 "parse_date.re" } diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 6c84a71917..815d417d02 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -22,8 +22,6 @@ * THE SOFTWARE. */ -/* $Id$ */ - #include "timelib.h" #include "timelib_private.h" diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index e3677c2bf6..64d2d29553 100644 --- a/ext/date/lib/parse_iso_intervals.c +++ b/ext/date/lib/parse_iso_intervals.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.15.3 on Tue Oct 9 10:50:29 2018 */ +/* Generated by re2c 0.15.3 on Fri Oct 12 11:47:32 2018 */ #line 1 "parse_iso_intervals.re" /* * The MIT License (MIT) @@ -24,8 +24,6 @@ * THE SOFTWARE. */ -/* $Id$ */ - #include "timelib.h" #include "timelib_private.h" @@ -176,11 +174,11 @@ static int scan(Scanner *s) std: s->tok = cursor; s->len = 0; -#line 204 "parse_iso_intervals.re" +#line 202 "parse_iso_intervals.re" -#line 184 "<stdout>" +#line 182 "<stdout>" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -249,12 +247,12 @@ std: if (yych <= '9') goto yy98; yy3: YYDEBUG(3, *YYCURSOR); -#line 317 "parse_iso_intervals.re" +#line 315 "parse_iso_intervals.re" { add_error(s, "Unexpected character"); goto std; } -#line 258 "<stdout>" +#line 256 "<stdout>" yy4: YYDEBUG(4, *YYCURSOR); yyaccept = 0; @@ -271,7 +269,7 @@ yy5: if (yych == 'T') goto yy14; yy6: YYDEBUG(6, *YYCURSOR); -#line 244 "parse_iso_intervals.re" +#line 242 "parse_iso_intervals.re" { timelib_sll nr; int in_time = 0; @@ -312,26 +310,26 @@ yy6: TIMELIB_DEINIT; return TIMELIB_PERIOD; } -#line 316 "<stdout>" +#line 314 "<stdout>" yy7: YYDEBUG(7, *YYCURSOR); ++YYCURSOR; YYDEBUG(8, *YYCURSOR); -#line 306 "parse_iso_intervals.re" +#line 304 "parse_iso_intervals.re" { goto std; } -#line 325 "<stdout>" +#line 323 "<stdout>" yy9: YYDEBUG(9, *YYCURSOR); ++YYCURSOR; YYDEBUG(10, *YYCURSOR); -#line 311 "parse_iso_intervals.re" +#line 309 "parse_iso_intervals.re" { s->pos = cursor; s->line++; goto std; } -#line 335 "<stdout>" +#line 333 "<stdout>" yy11: YYDEBUG(11, *YYCURSOR); yych = *++YYCURSOR; @@ -661,7 +659,7 @@ yy51: YYDEBUG(57, *YYCURSOR); ++YYCURSOR; YYDEBUG(58, *YYCURSOR); -#line 286 "parse_iso_intervals.re" +#line 284 "parse_iso_intervals.re" { DEBUG_OUTPUT("combinedrep"); TIMELIB_INIT; @@ -680,7 +678,7 @@ yy51: TIMELIB_DEINIT; return TIMELIB_PERIOD; } -#line 684 "<stdout>" +#line 682 "<stdout>" yy59: YYDEBUG(59, *YYCURSOR); yych = *++YYCURSOR; @@ -809,7 +807,7 @@ yy83: YYDEBUG(83, *YYCURSOR); ++YYCURSOR; YYDEBUG(84, *YYCURSOR); -#line 220 "parse_iso_intervals.re" +#line 218 "parse_iso_intervals.re" { timelib_time *current; @@ -832,7 +830,7 @@ yy83: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 836 "<stdout>" +#line 834 "<stdout>" yy85: YYDEBUG(85, *YYCURSOR); yych = *++YYCURSOR; @@ -910,7 +908,7 @@ yy98: if (yych <= '9') goto yy98; yy100: YYDEBUG(100, *YYCURSOR); -#line 209 "parse_iso_intervals.re" +#line 207 "parse_iso_intervals.re" { DEBUG_OUTPUT("recurrences"); TIMELIB_INIT; @@ -920,9 +918,9 @@ yy100: s->have_recurrences = 1; return TIMELIB_PERIOD; } -#line 924 "<stdout>" +#line 922 "<stdout>" } -#line 321 "parse_iso_intervals.re" +#line 319 "parse_iso_intervals.re" } #ifdef PHP_WIN32 diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index 95d8abf9ea..cde4475da1 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -22,8 +22,6 @@ * THE SOFTWARE. */ -/* $Id$ */ - #include "timelib.h" #include "timelib_private.h" diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 3ab2267608..e272cfcd13 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -322,8 +322,8 @@ typedef struct _timelib_tzdb { #endif #define TIMELIB_VERSION 201801 -#define TIMELIB_EXTENDED_VERSION 20180002 -#define TIMELIB_ASCII_VERSION "2018.01alpha2" +#define TIMELIB_EXTENDED_VERSION 20180103 +#define TIMELIB_ASCII_VERSION "2018.01RC1" #define TIMELIB_NONE 0x00 #define TIMELIB_OVERRIDE_TIME 0x01 @@ -452,7 +452,7 @@ int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d); * If the **errors points to a timelib_error_container variable, warnings * and errors will be recorded. You are responsible for freeing the stored * information with timelib_error_container_dtor(). To see whether errors have - * occured, inspect errors->errors_count. To see whether warnings have occured, + * occurred, inspect errors->errors_count. To see whether warnings have occurred, * inspect errors->warnings_count. * * The returned timelib_time* value is dynamically allocated and should be @@ -473,7 +473,7 @@ timelib_time *timelib_strtotime(char *s, size_t len, timelib_error_container **e * If the **errors points to a timelib_error_container variable, warnings * and errors will be recorded. You are responsible for freeing the stored * information with timelib_error_container_dtor(). To see whether errors have - * occured, inspect errors->errors_count. To see whether warnings have occured, + * occurred, inspect errors->errors_count. To see whether warnings have occurred, * inspect errors->warnings_count. * * The returned timelib_time* value is dynamically allocated and should be @@ -562,7 +562,7 @@ timelib_long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_n * If the **errors points to a timelib_error_container variable, warnings * and errors will be recorded. You are responsible for freeing the stored * information with timelib_error_container_dtor(). To see whether errors have - * occured, inspect errors->errors_count. To see whether warnings have occured, + * occurred, inspect errors->errors_count. To see whether warnings have occurred, * inspect errors->warnings_count. */ void timelib_strtointerval(char *s, size_t len, diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4 index e112380da0..ad21eab38a 100644 --- a/ext/date/lib/timelib.m4 +++ b/ext/date/lib/timelib.m4 @@ -1,7 +1,4 @@ dnl -dnl $Id$ -dnl -dnl dnl TL_DEF_HAVE(what [, why]) dnl dnl Generates 'AC_DEFINE(HAVE_WHAT, 1, [WHY])' diff --git a/ext/date/lib/timezonemap.h b/ext/date/lib/timezonemap.h index e4a96ea57a..b948ee0523 100644 --- a/ext/date/lib/timezonemap.h +++ b/ext/date/lib/timezonemap.h @@ -155,9 +155,9 @@ { "bmt", 0, 25632, "Asia/Jakarta" }, { "bmt", 0, 6264, "Europe/Bucharest" }, { "bmt", 0, 6264, "Europe/Chisinau" }, + { "bost", 1, -12756, "America/La_Paz" }, { "bst", 1, 3600, "Europe/London" }, { "bst", 0, 3600, "Europe/London" }, - { "bst", 1, -12756, "America/La_Paz" }, { "bst", 0, -39600, "America/Adak" }, { "bst", 0, -39600, "America/Atka" }, { "bst", 0, -39600, "America/Nome" }, @@ -672,9 +672,6 @@ { "gmt", 0, 0, "Europe/Jersey" }, { "gmt", 0, 0, "Europe/London" }, { "gmt", 0, 0, "GB" }, - { "gmt", 1, 0, "Europe/Bratislava" }, - { "gmt", 1, 0, "Europe/Dublin" }, - { "gmt", 1, 0, "Europe/Prague" }, { "gst", 0, 36000, "Pacific/Guam" }, { "gst", 0, 36000, "Pacific/Saipan" }, { "hdt", 1, -34200, "Pacific/Honolulu" }, @@ -731,8 +728,8 @@ { "kdt", 1, 34200, "ROK" }, { "kdt", 1, 36000, "ROK" }, { "kmt", 0, 5736, "Europe/Vilnius" }, - { "kmt", 0, -18430, "America/Grand_Turk" }, - { "kmt", 0, -18430, "America/Jamaica" }, + { "kmt", 0, -18431, "America/Grand_Turk" }, + { "kmt", 0, -18431, "America/Jamaica" }, { "kmt", 0, 7324, "Europe/Kiev" }, { "kst", 0, 30600, "Asia/Seoul" }, { "kst", 0, 32400, "Asia/Pyongyang" }, @@ -765,9 +762,11 @@ { "mdt", 1, -21600, "Canada/Mountain" }, { "mdt", 1, -21600, "Canada/Saskatchewan" }, { "mdt", 1, -21600, "Mexico/BajaSur" }, + { "mest", 1, 7200, "MET" }, + { "met", 0, 3600, "MET" }, { "mmt", 0, 9017, "Europe/Moscow" }, { "mmt", 0, 9079, "Europe/Moscow" }, - { "mmt", 0, -13491, "America/Montevideo" }, + { "mmt", 0, -13484, "America/Montevideo" }, { "mmt", 0, -20712, "America/Managua" }, { "mmt", 0, -2588, "Africa/Monrovia" }, { "mmt", 0, -2670, "Africa/Monrovia" }, @@ -1045,8 +1044,7 @@ { "wat", 0, 3600, "Africa/Ndjamena" }, { "wat", 0, 3600, "Africa/Niamey" }, { "wat", 0, 3600, "Africa/Porto-Novo" }, - { "wat", 0, 3600, "Africa/Sao_Tome" }, - { "wat", 1, 3600, "Africa/Windhoek" }, + { "wat", 0, 3600, "Africa/Windhoek" }, { "wemt", 1, 7200, "Europe/Lisbon" }, { "wemt", 1, 7200, "Europe/Madrid" }, { "wemt", 1, 7200, "Europe/Monaco" }, diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index 7d6b7d8844..bfb9ba1d2b 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -194,6 +194,7 @@ static void do_adjust_for_weekday(timelib_time* time) void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt) { + do_range_limit_fraction(&rt->us, &rt->s); do_range_limit(0, 60, 60, &rt->s, &rt->i); do_range_limit(0, 60, 60, &rt->i, &rt->h); do_range_limit(0, 24, 24, &rt->h, &rt->d); |