From: Derick Rethans Date: Sun, 31 Mar 2013 09:55:45 +0000 (+0100) Subject: Added the new .c files as well as they are not automatically regenerated. X-Git-Tag: php-5.5.0beta3~8^2~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84208d9dc550e7feab7c44d5e4ea3061a5952dab;p=php Added the new .c files as well as they are not automatically regenerated. --- diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 90622f956f..e8f393f322 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 */ +/* Generated by re2c 0.13.5 on Sun Mar 31 10:47:54 2013 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -170,8 +170,6 @@ typedef struct _timelib_relunit { int multiplier; } timelib_relunit; -#define HOUR(a) (int)(a * 60) - /* The timezone table. */ const static timelib_tz_lookup_table timelib_timezone_lookup[] = { #include "timezonemap.h" @@ -532,39 +530,6 @@ static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) return dir * timelib_get_nr(ptr, max_length); } -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (isdigit(**ptr) || **ptr == ':') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - if (begin[1] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10); - return tmp; - } else if (begin[2] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } else { - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - } - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior) { char *word; @@ -871,11 +836,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) std: s->tok = cursor; s->len = 0; -#line 997 "ext/date/lib/parse_date.re" +#line 962 "ext/date/lib/parse_date.re" -#line 879 "ext/date/lib/parse_date.c" +#line 844 "ext/date/lib/parse_date.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -995,7 +960,7 @@ std: } yy2: YYDEBUG(2, *YYCURSOR); -#line 1083 "ext/date/lib/parse_date.re" +#line 1048 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("firstdayof | lastdayof"); TIMELIB_INIT; @@ -1011,7 +976,7 @@ yy2: TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 1015 "ext/date/lib/parse_date.c" +#line 980 "ext/date/lib/parse_date.c" yy3: YYDEBUG(3, *YYCURSOR); ++YYCURSOR; @@ -1034,7 +999,7 @@ yy3: } yy4: YYDEBUG(4, *YYCURSOR); -#line 1677 "ext/date/lib/parse_date.re" +#line 1642 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("tzcorrection | tz"); @@ -1047,7 +1012,7 @@ yy4: TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 1051 "ext/date/lib/parse_date.c" +#line 1016 "ext/date/lib/parse_date.c" yy5: YYDEBUG(5, *YYCURSOR); yych = *++YYCURSOR; @@ -1358,12 +1323,12 @@ yy12: if (yych <= '9') goto yy1385; yy13: YYDEBUG(13, *YYCURSOR); -#line 1772 "ext/date/lib/parse_date.re" +#line 1737 "ext/date/lib/parse_date.re" { add_error(s, "Unexpected character"); goto std; } -#line 1367 "ext/date/lib/parse_date.c" +#line 1332 "ext/date/lib/parse_date.c" yy14: YYDEBUG(14, *YYCURSOR); yych = *++YYCURSOR; @@ -2420,11 +2385,11 @@ yy49: if (yych <= '9') goto yy55; yy50: YYDEBUG(50, *YYCURSOR); -#line 1761 "ext/date/lib/parse_date.re" +#line 1726 "ext/date/lib/parse_date.re" { goto std; } -#line 2428 "ext/date/lib/parse_date.c" +#line 2393 "ext/date/lib/parse_date.c" yy51: YYDEBUG(51, *YYCURSOR); yych = *++YYCURSOR; @@ -2433,12 +2398,12 @@ yy52: YYDEBUG(52, *YYCURSOR); ++YYCURSOR; YYDEBUG(53, *YYCURSOR); -#line 1766 "ext/date/lib/parse_date.re" +#line 1731 "ext/date/lib/parse_date.re" { s->pos = cursor; s->line++; goto std; } -#line 2442 "ext/date/lib/parse_date.c" +#line 2407 "ext/date/lib/parse_date.c" yy54: YYDEBUG(54, *YYCURSOR); yych = *++YYCURSOR; @@ -2825,7 +2790,7 @@ yy72: if (yych == 's') goto yy74; yy73: YYDEBUG(73, *YYCURSOR); -#line 1745 "ext/date/lib/parse_date.re" +#line 1710 "ext/date/lib/parse_date.re" { timelib_ull i; DEBUG_OUTPUT("relative"); @@ -2840,7 +2805,7 @@ yy73: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 2844 "ext/date/lib/parse_date.c" +#line 2809 "ext/date/lib/parse_date.c" yy74: YYDEBUG(74, *YYCURSOR); yych = *++YYCURSOR; @@ -3602,7 +3567,7 @@ yy166: } yy167: YYDEBUG(167, *YYCURSOR); -#line 1608 "ext/date/lib/parse_date.re" +#line 1573 "ext/date/lib/parse_date.re" { const timelib_relunit* relunit; DEBUG_OUTPUT("daytext"); @@ -3619,7 +3584,7 @@ yy167: TIMELIB_DEINIT; return TIMELIB_WEEKDAY; } -#line 3623 "ext/date/lib/parse_date.c" +#line 3588 "ext/date/lib/parse_date.c" yy168: YYDEBUG(168, *YYCURSOR); yych = *++YYCURSOR; @@ -4139,7 +4104,7 @@ yy193: } yy194: YYDEBUG(194, *YYCURSOR); -#line 1667 "ext/date/lib/parse_date.re" +#line 1632 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("monthtext"); TIMELIB_INIT; @@ -4148,7 +4113,7 @@ yy194: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4152 "ext/date/lib/parse_date.c" +#line 4117 "ext/date/lib/parse_date.c" yy195: YYDEBUG(195, *YYCURSOR); ++YYCURSOR; @@ -4199,7 +4164,7 @@ yy198: } yy199: YYDEBUG(199, *YYCURSOR); -#line 1413 "ext/date/lib/parse_date.re" +#line 1378 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datetextual | datenoyear"); @@ -4212,7 +4177,7 @@ yy199: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4216 "ext/date/lib/parse_date.c" +#line 4181 "ext/date/lib/parse_date.c" yy200: YYDEBUG(200, *YYCURSOR); yyaccept = 6; @@ -4481,7 +4446,7 @@ yy222: } yy223: YYDEBUG(223, *YYCURSOR); -#line 1715 "ext/date/lib/parse_date.re" +#line 1680 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz"); @@ -4510,7 +4475,7 @@ yy223: TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 4514 "ext/date/lib/parse_date.c" +#line 4479 "ext/date/lib/parse_date.c" yy224: YYDEBUG(224, *YYCURSOR); yyaccept = 7; @@ -5208,7 +5173,7 @@ yy278: YYDEBUG(278, *YYCURSOR); ++YYCURSOR; YYDEBUG(279, *YYCURSOR); -#line 1691 "ext/date/lib/parse_date.re" +#line 1656 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); TIMELIB_INIT; @@ -5231,7 +5196,7 @@ yy278: TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 5235 "ext/date/lib/parse_date.c" +#line 5200 "ext/date/lib/parse_date.c" yy280: YYDEBUG(280, *YYCURSOR); yych = *++YYCURSOR; @@ -5409,7 +5374,7 @@ yy294: ++YYCURSOR; yy295: YYDEBUG(295, *YYCURSOR); -#line 1385 "ext/date/lib/parse_date.re" +#line 1350 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datenoday"); @@ -5422,7 +5387,7 @@ yy295: TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 5426 "ext/date/lib/parse_date.c" +#line 5391 "ext/date/lib/parse_date.c" yy296: YYDEBUG(296, *YYCURSOR); yych = *++YYCURSOR; @@ -6642,7 +6607,7 @@ yy362: if (yych <= '9') goto yy365; yy364: YYDEBUG(364, *YYCURSOR); -#line 1529 "ext/date/lib/parse_date.re" +#line 1494 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextshort"); @@ -6655,7 +6620,7 @@ yy364: TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 6659 "ext/date/lib/parse_date.c" +#line 6624 "ext/date/lib/parse_date.c" yy365: YYDEBUG(365, *YYCURSOR); yych = *++YYCURSOR; @@ -7293,7 +7258,7 @@ yy392: } yy393: YYDEBUG(393, *YYCURSOR); -#line 1587 "ext/date/lib/parse_date.re" +#line 1552 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("ago"); TIMELIB_INIT; @@ -7313,7 +7278,7 @@ yy393: TIMELIB_DEINIT; return TIMELIB_AGO; } -#line 7317 "ext/date/lib/parse_date.c" +#line 7282 "ext/date/lib/parse_date.c" yy394: YYDEBUG(394, *YYCURSOR); yyaccept = 5; @@ -9063,7 +9028,7 @@ yy454: ++YYCURSOR; yy455: YYDEBUG(455, *YYCURSOR); -#line 1290 "ext/date/lib/parse_date.re" +#line 1255 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash"); TIMELIB_INIT; @@ -9074,7 +9039,7 @@ yy455: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 9078 "ext/date/lib/parse_date.c" +#line 9043 "ext/date/lib/parse_date.c" yy456: YYDEBUG(456, *YYCURSOR); yyaccept = 0; @@ -9634,7 +9599,7 @@ yy475: } yy476: YYDEBUG(476, *YYCURSOR); -#line 1427 "ext/date/lib/parse_date.re" +#line 1392 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenoyearrev"); TIMELIB_INIT; @@ -9645,7 +9610,7 @@ yy476: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 9649 "ext/date/lib/parse_date.c" +#line 9614 "ext/date/lib/parse_date.c" yy477: YYDEBUG(477, *YYCURSOR); yyaccept = 10; @@ -9786,7 +9751,7 @@ yy488: YYDEBUG(488, *YYCURSOR); ++YYCURSOR; YYDEBUG(489, *YYCURSOR); -#line 1145 "ext/date/lib/parse_date.re" +#line 1110 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); TIMELIB_INIT; @@ -9802,7 +9767,7 @@ yy488: TIMELIB_DEINIT; return TIMELIB_TIME12; } -#line 9806 "ext/date/lib/parse_date.c" +#line 9771 "ext/date/lib/parse_date.c" yy490: YYDEBUG(490, *YYCURSOR); yyaccept = 11; @@ -9815,7 +9780,7 @@ yy490: } yy491: YYDEBUG(491, *YYCURSOR); -#line 1182 "ext/date/lib/parse_date.re" +#line 1147 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long"); @@ -9840,7 +9805,7 @@ yy491: TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 9844 "ext/date/lib/parse_date.c" +#line 9809 "ext/date/lib/parse_date.c" yy492: YYDEBUG(492, *YYCURSOR); yyaccept = 11; @@ -10150,7 +10115,7 @@ yy523: YYDEBUG(523, *YYCURSOR); ++YYCURSOR; YYDEBUG(524, *YYCURSOR); -#line 1162 "ext/date/lib/parse_date.re" +#line 1127 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("mssqltime"); TIMELIB_INIT; @@ -10169,7 +10134,7 @@ yy523: TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 10173 "ext/date/lib/parse_date.c" +#line 10138 "ext/date/lib/parse_date.c" yy525: YYDEBUG(525, *YYCURSOR); yyaccept = 11; @@ -10275,7 +10240,7 @@ yy534: if (yych <= '9') goto yy541; yy535: YYDEBUG(535, *YYCURSOR); -#line 1344 "ext/date/lib/parse_date.re" +#line 1309 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datefull"); @@ -10289,7 +10254,7 @@ yy535: TIMELIB_DEINIT; return TIMELIB_DATE_FULL; } -#line 10293 "ext/date/lib/parse_date.c" +#line 10258 "ext/date/lib/parse_date.c" yy536: YYDEBUG(536, *YYCURSOR); yych = *++YYCURSOR; @@ -11026,7 +10991,7 @@ yy605: YYDEBUG(606, *YYCURSOR); ++YYCURSOR; YYDEBUG(607, *YYCURSOR); -#line 1359 "ext/date/lib/parse_date.re" +#line 1324 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pointed date YYYY"); TIMELIB_INIT; @@ -11037,7 +11002,7 @@ yy605: TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 11041 "ext/date/lib/parse_date.c" +#line 11006 "ext/date/lib/parse_date.c" yy608: YYDEBUG(608, *YYCURSOR); yyaccept = 11; @@ -11073,7 +11038,7 @@ yy611: if (yych <= '9') goto yy605; yy612: YYDEBUG(612, *YYCURSOR); -#line 1371 "ext/date/lib/parse_date.re" +#line 1336 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pointed date YY"); @@ -11086,7 +11051,7 @@ yy612: TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 11090 "ext/date/lib/parse_date.c" +#line 11055 "ext/date/lib/parse_date.c" yy613: YYDEBUG(613, *YYCURSOR); yyaccept = 11; @@ -11727,7 +11692,7 @@ yy656: } yy657: YYDEBUG(657, *YYCURSOR); -#line 1330 "ext/date/lib/parse_date.re" +#line 1295 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshort"); @@ -11740,7 +11705,7 @@ yy657: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 11744 "ext/date/lib/parse_date.c" +#line 11709 "ext/date/lib/parse_date.c" yy658: YYDEBUG(658, *YYCURSOR); yyaccept = 13; @@ -11846,7 +11811,7 @@ yy666: } yy667: YYDEBUG(667, *YYCURSOR); -#line 1274 "ext/date/lib/parse_date.re" +#line 1239 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("americanshort | american"); @@ -11861,7 +11826,7 @@ yy667: TIMELIB_DEINIT; return TIMELIB_AMERICAN; } -#line 11865 "ext/date/lib/parse_date.c" +#line 11830 "ext/date/lib/parse_date.c" yy668: YYDEBUG(668, *YYCURSOR); yyaccept = 14; @@ -12094,7 +12059,7 @@ yy700: if (yych <= ':') goto yy704; yy701: YYDEBUG(701, *YYCURSOR); -#line 1557 "ext/date/lib/parse_date.re" +#line 1522 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("clf"); @@ -12114,7 +12079,7 @@ yy701: TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12118 "ext/date/lib/parse_date.c" +#line 12083 "ext/date/lib/parse_date.c" yy702: YYDEBUG(702, *YYCURSOR); yych = *++YYCURSOR; @@ -12666,7 +12631,7 @@ yy763: } yy764: YYDEBUG(764, *YYCURSOR); -#line 1302 "ext/date/lib/parse_date.re" +#line 1267 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("iso8601date2"); @@ -12679,7 +12644,7 @@ yy764: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 12683 "ext/date/lib/parse_date.c" +#line 12648 "ext/date/lib/parse_date.c" yy765: YYDEBUG(765, *YYCURSOR); yych = *++YYCURSOR; @@ -12718,7 +12683,7 @@ yy771: YYDEBUG(771, *YYCURSOR); ++YYCURSOR; YYDEBUG(772, *YYCURSOR); -#line 1543 "ext/date/lib/parse_date.re" +#line 1508 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgtextreverse"); @@ -12731,7 +12696,7 @@ yy771: TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 12735 "ext/date/lib/parse_date.c" +#line 12700 "ext/date/lib/parse_date.c" yy773: YYDEBUG(773, *YYCURSOR); yych = *++YYCURSOR; @@ -12869,7 +12834,7 @@ yy783: } yy784: YYDEBUG(784, *YYCURSOR); -#line 1578 "ext/date/lib/parse_date.re" +#line 1543 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("year4"); TIMELIB_INIT; @@ -12877,7 +12842,7 @@ yy784: TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12881 "ext/date/lib/parse_date.c" +#line 12846 "ext/date/lib/parse_date.c" yy785: YYDEBUG(785, *YYCURSOR); yych = *++YYCURSOR; @@ -13028,7 +12993,7 @@ yy793: } yy794: YYDEBUG(794, *YYCURSOR); -#line 1399 "ext/date/lib/parse_date.re" +#line 1364 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("datenodayrev"); @@ -13041,7 +13006,7 @@ yy794: TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 13045 "ext/date/lib/parse_date.c" +#line 13010 "ext/date/lib/parse_date.c" yy795: YYDEBUG(795, *YYCURSOR); yych = *++YYCURSOR; @@ -13256,7 +13221,7 @@ yy814: if (yych <= '7') goto yy817; yy815: YYDEBUG(815, *YYCURSOR); -#line 1510 "ext/date/lib/parse_date.re" +#line 1475 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweek"); @@ -13274,7 +13239,7 @@ yy815: TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 13278 "ext/date/lib/parse_date.c" +#line 13243 "ext/date/lib/parse_date.c" yy816: YYDEBUG(816, *YYCURSOR); yych = *++YYCURSOR; @@ -13284,7 +13249,7 @@ yy817: YYDEBUG(817, *YYCURSOR); ++YYCURSOR; YYDEBUG(818, *YYCURSOR); -#line 1491 "ext/date/lib/parse_date.re" +#line 1456 "ext/date/lib/parse_date.re" { timelib_sll w, d; DEBUG_OUTPUT("isoweekday"); @@ -13302,7 +13267,7 @@ yy817: TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 13306 "ext/date/lib/parse_date.c" +#line 13271 "ext/date/lib/parse_date.c" yy819: YYDEBUG(819, *YYCURSOR); yych = *++YYCURSOR; @@ -13366,7 +13331,7 @@ yy821: } yy822: YYDEBUG(822, *YYCURSOR); -#line 1477 "ext/date/lib/parse_date.re" +#line 1442 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("pgydotd"); @@ -13379,7 +13344,7 @@ yy822: TIMELIB_DEINIT; return TIMELIB_PG_YEARDAY; } -#line 13383 "ext/date/lib/parse_date.c" +#line 13348 "ext/date/lib/parse_date.c" yy823: YYDEBUG(823, *YYCURSOR); yych = *++YYCURSOR; @@ -13482,7 +13447,7 @@ yy842: ++YYCURSOR; yy843: YYDEBUG(843, *YYCURSOR); -#line 1451 "ext/date/lib/parse_date.re" +#line 1416 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif"); @@ -13507,7 +13472,7 @@ yy843: TIMELIB_DEINIT; return TIMELIB_XMLRPC_SOAP; } -#line 13511 "ext/date/lib/parse_date.c" +#line 13476 "ext/date/lib/parse_date.c" yy844: YYDEBUG(844, *YYCURSOR); yych = *++YYCURSOR; @@ -13769,7 +13734,7 @@ yy848: } yy849: YYDEBUG(849, *YYCURSOR); -#line 1439 "ext/date/lib/parse_date.re" +#line 1404 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenocolon"); TIMELIB_INIT; @@ -13780,7 +13745,7 @@ yy849: TIMELIB_DEINIT; return TIMELIB_DATE_NOCOLON; } -#line 13784 "ext/date/lib/parse_date.c" +#line 13749 "ext/date/lib/parse_date.c" yy850: YYDEBUG(850, *YYCURSOR); yych = *++YYCURSOR; @@ -14700,7 +14665,7 @@ yy973: if (yych <= '9') goto yy996; yy974: YYDEBUG(974, *YYCURSOR); -#line 1316 "ext/date/lib/parse_date.re" +#line 1281 "ext/date/lib/parse_date.re" { int length = 0; DEBUG_OUTPUT("gnudateshorter"); @@ -14713,7 +14678,7 @@ yy974: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 14717 "ext/date/lib/parse_date.c" +#line 14682 "ext/date/lib/parse_date.c" yy975: YYDEBUG(975, *YYCURSOR); yyaccept = 22; @@ -15722,7 +15687,7 @@ yy1066: } yy1068: YYDEBUG(1068, *YYCURSOR); -#line 1208 "ext/date/lib/parse_date.re" +#line 1173 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("gnunocolon"); TIMELIB_INIT; @@ -15744,7 +15709,7 @@ yy1068: TIMELIB_DEINIT; return TIMELIB_GNU_NOCOLON; } -#line 15748 "ext/date/lib/parse_date.c" +#line 15713 "ext/date/lib/parse_date.c" yy1069: YYDEBUG(1069, *YYCURSOR); yych = *++YYCURSOR; @@ -15836,7 +15801,7 @@ yy1075: } yy1076: YYDEBUG(1076, *YYCURSOR); -#line 1254 "ext/date/lib/parse_date.re" +#line 1219 "ext/date/lib/parse_date.re" { int tz_not_found; DEBUG_OUTPUT("iso8601nocolon"); @@ -15855,7 +15820,7 @@ yy1076: TIMELIB_DEINIT; return TIMELIB_ISO_NOCOLON; } -#line 15859 "ext/date/lib/parse_date.c" +#line 15824 "ext/date/lib/parse_date.c" yy1077: YYDEBUG(1077, *YYCURSOR); yyaccept = 25; @@ -16753,7 +16718,7 @@ yy1117: } yy1118: YYDEBUG(1118, *YYCURSOR); -#line 1650 "ext/date/lib/parse_date.re" +#line 1615 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -16769,7 +16734,7 @@ yy1118: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16773 "ext/date/lib/parse_date.c" +#line 16738 "ext/date/lib/parse_date.c" yy1119: YYDEBUG(1119, *YYCURSOR); ++YYCURSOR; @@ -16820,7 +16785,7 @@ yy1126: YYDEBUG(1126, *YYCURSOR); ++YYCURSOR; YYDEBUG(1127, *YYCURSOR); -#line 1123 "ext/date/lib/parse_date.re" +#line 1088 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -16841,7 +16806,7 @@ yy1126: TIMELIB_DEINIT; return TIMELIB_WEEK_DAY_OF_MONTH; } -#line 16845 "ext/date/lib/parse_date.c" +#line 16810 "ext/date/lib/parse_date.c" yy1128: YYDEBUG(1128, *YYCURSOR); yyaccept = 26; @@ -16949,7 +16914,7 @@ yy1141: } yy1142: YYDEBUG(1142, *YYCURSOR); -#line 1626 "ext/date/lib/parse_date.re" +#line 1591 "ext/date/lib/parse_date.re" { timelib_sll i; int behavior = 0; @@ -16972,7 +16937,7 @@ yy1142: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16976 "ext/date/lib/parse_date.c" +#line 16941 "ext/date/lib/parse_date.c" yy1143: YYDEBUG(1143, *YYCURSOR); yych = *++YYCURSOR; @@ -19649,7 +19614,7 @@ yy1294: goto yy1298; yy1295: YYDEBUG(1295, *YYCURSOR); -#line 1100 "ext/date/lib/parse_date.re" +#line 1065 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("backof | frontof"); TIMELIB_INIT; @@ -19671,7 +19636,7 @@ yy1295: TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 19675 "ext/date/lib/parse_date.c" +#line 19640 "ext/date/lib/parse_date.c" yy1296: YYDEBUG(1296, *YYCURSOR); yyaccept = 28; @@ -21362,7 +21327,7 @@ yy1385: if (yych <= '9') goto yy1385; yy1387: YYDEBUG(1387, *YYCURSOR); -#line 1057 "ext/date/lib/parse_date.re" +#line 1022 "ext/date/lib/parse_date.re" { timelib_ull i; @@ -21387,7 +21352,7 @@ yy1387: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21391 "ext/date/lib/parse_date.c" +#line 21356 "ext/date/lib/parse_date.c" yy1388: YYDEBUG(1388, *YYCURSOR); yych = *++YYCURSOR; @@ -21823,7 +21788,7 @@ yy1416: ++YYCURSOR; yy1417: YYDEBUG(1417, *YYCURSOR); -#line 1045 "ext/date/lib/parse_date.re" +#line 1010 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("tomorrow"); TIMELIB_INIT; @@ -21834,7 +21799,7 @@ yy1417: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21838 "ext/date/lib/parse_date.c" +#line 21803 "ext/date/lib/parse_date.c" yy1418: YYDEBUG(1418, *YYCURSOR); yych = *++YYCURSOR; @@ -21869,7 +21834,7 @@ yy1419: } yy1420: YYDEBUG(1420, *YYCURSOR); -#line 1035 "ext/date/lib/parse_date.re" +#line 1000 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("midnight | today"); TIMELIB_INIT; @@ -21878,7 +21843,7 @@ yy1420: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21882 "ext/date/lib/parse_date.c" +#line 21847 "ext/date/lib/parse_date.c" yy1421: YYDEBUG(1421, *YYCURSOR); yych = *++YYCURSOR; @@ -23890,7 +23855,7 @@ yy1499: } yy1500: YYDEBUG(1500, *YYCURSOR); -#line 1014 "ext/date/lib/parse_date.re" +#line 979 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("now"); TIMELIB_INIT; @@ -23898,7 +23863,7 @@ yy1500: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 23902 "ext/date/lib/parse_date.c" +#line 23867 "ext/date/lib/parse_date.c" yy1501: YYDEBUG(1501, *YYCURSOR); yych = *++YYCURSOR; @@ -24037,7 +24002,7 @@ yy1507: } yy1508: YYDEBUG(1508, *YYCURSOR); -#line 1023 "ext/date/lib/parse_date.re" +#line 988 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("noon"); TIMELIB_INIT; @@ -24048,7 +24013,7 @@ yy1508: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24052 "ext/date/lib/parse_date.c" +#line 24017 "ext/date/lib/parse_date.c" yy1509: YYDEBUG(1509, *YYCURSOR); yyaccept = 0; @@ -24581,7 +24546,7 @@ yy1530: ++YYCURSOR; yy1531: YYDEBUG(1531, *YYCURSOR); -#line 1002 "ext/date/lib/parse_date.re" +#line 967 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("yesterday"); TIMELIB_INIT; @@ -24592,7 +24557,7 @@ yy1531: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24596 "ext/date/lib/parse_date.c" +#line 24561 "ext/date/lib/parse_date.c" yy1532: YYDEBUG(1532, *YYCURSOR); yyaccept = 0; @@ -24765,7 +24730,7 @@ yy1537: goto yy1531; } } -#line 1776 "ext/date/lib/parse_date.re" +#line 1741 "ext/date/lib/parse_date.re" } diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index 7d05e324a3..fedad043c4 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.13.5 */ +/* Generated by re2c 0.13.5 on Sun Mar 31 10:48:17 2013 */ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +----------------------------------------------------------------------+ @@ -104,8 +104,6 @@ typedef struct Scanner { int have_end_date; } Scanner; -#define HOUR(a) (int)(a * 60) - static void add_warning(Scanner *s, char *error) { s->errors->warning_count++; @@ -178,39 +176,6 @@ static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) return dir * timelib_get_nr(ptr, max_length); } -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (isdigit(**ptr) || **ptr == ':') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - if (begin[1] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10); - return tmp; - } else if (begin[2] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } else { - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - } - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - static void timelib_eat_spaces(char **ptr) { while (**ptr == ' ' || **ptr == '\t') { @@ -283,11 +248,11 @@ static int scan(Scanner *s) std: s->tok = cursor; s->len = 0; -#line 311 "ext/date/lib/parse_iso_intervals.re" +#line 276 "ext/date/lib/parse_iso_intervals.re" -#line 291 "ext/date/lib/parse_iso_intervals.c" +#line 256 "ext/date/lib/parse_iso_intervals.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -357,12 +322,12 @@ std: if (yych <= '9') goto yy98; yy3: YYDEBUG(3, *YYCURSOR); -#line 424 "ext/date/lib/parse_iso_intervals.re" +#line 389 "ext/date/lib/parse_iso_intervals.re" { add_error(s, "Unexpected character"); goto std; } -#line 366 "ext/date/lib/parse_iso_intervals.c" +#line 331 "ext/date/lib/parse_iso_intervals.c" yy4: YYDEBUG(4, *YYCURSOR); yyaccept = 0; @@ -379,7 +344,7 @@ yy5: if (yych == 'T') goto yy14; yy6: YYDEBUG(6, *YYCURSOR); -#line 351 "ext/date/lib/parse_iso_intervals.re" +#line 316 "ext/date/lib/parse_iso_intervals.re" { timelib_sll nr; int in_time = 0; @@ -420,26 +385,26 @@ yy6: TIMELIB_DEINIT; return TIMELIB_PERIOD; } -#line 424 "ext/date/lib/parse_iso_intervals.c" +#line 389 "ext/date/lib/parse_iso_intervals.c" yy7: YYDEBUG(7, *YYCURSOR); ++YYCURSOR; YYDEBUG(8, *YYCURSOR); -#line 413 "ext/date/lib/parse_iso_intervals.re" +#line 378 "ext/date/lib/parse_iso_intervals.re" { goto std; } -#line 433 "ext/date/lib/parse_iso_intervals.c" +#line 398 "ext/date/lib/parse_iso_intervals.c" yy9: YYDEBUG(9, *YYCURSOR); ++YYCURSOR; YYDEBUG(10, *YYCURSOR); -#line 418 "ext/date/lib/parse_iso_intervals.re" +#line 383 "ext/date/lib/parse_iso_intervals.re" { s->pos = cursor; s->line++; goto std; } -#line 443 "ext/date/lib/parse_iso_intervals.c" +#line 408 "ext/date/lib/parse_iso_intervals.c" yy11: YYDEBUG(11, *YYCURSOR); yych = *++YYCURSOR; @@ -769,7 +734,7 @@ yy51: YYDEBUG(57, *YYCURSOR); ++YYCURSOR; YYDEBUG(58, *YYCURSOR); -#line 393 "ext/date/lib/parse_iso_intervals.re" +#line 358 "ext/date/lib/parse_iso_intervals.re" { DEBUG_OUTPUT("combinedrep"); TIMELIB_INIT; @@ -788,7 +753,7 @@ yy51: TIMELIB_DEINIT; return TIMELIB_PERIOD; } -#line 792 "ext/date/lib/parse_iso_intervals.c" +#line 757 "ext/date/lib/parse_iso_intervals.c" yy59: YYDEBUG(59, *YYCURSOR); yych = *++YYCURSOR; @@ -917,7 +882,7 @@ yy83: YYDEBUG(83, *YYCURSOR); ++YYCURSOR; YYDEBUG(84, *YYCURSOR); -#line 327 "ext/date/lib/parse_iso_intervals.re" +#line 292 "ext/date/lib/parse_iso_intervals.re" { timelib_time *current; @@ -940,7 +905,7 @@ yy83: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 944 "ext/date/lib/parse_iso_intervals.c" +#line 909 "ext/date/lib/parse_iso_intervals.c" yy85: YYDEBUG(85, *YYCURSOR); yych = *++YYCURSOR; @@ -1018,7 +983,7 @@ yy98: if (yych <= '9') goto yy98; yy100: YYDEBUG(100, *YYCURSOR); -#line 316 "ext/date/lib/parse_iso_intervals.re" +#line 281 "ext/date/lib/parse_iso_intervals.re" { DEBUG_OUTPUT("recurrences"); TIMELIB_INIT; @@ -1028,9 +993,9 @@ yy100: s->have_recurrences = 1; return TIMELIB_PERIOD; } -#line 1032 "ext/date/lib/parse_iso_intervals.c" +#line 997 "ext/date/lib/parse_iso_intervals.c" } -#line 428 "ext/date/lib/parse_iso_intervals.re" +#line 393 "ext/date/lib/parse_iso_intervals.re" } #ifdef PHP_WIN32