derick          Sat Aug  2 13:50:31 2008 UTC

  Modified files:              
    /php-src/ext/date/lib       parse_iso_intervals.c parse_iso_intervals.re 
  Log:
  - Fixed bug #45545 (DateInterval has a limitation of 4 chars for ISO
    durations). 
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_iso_intervals.c?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/date/lib/parse_iso_intervals.c
diff -u php-src/ext/date/lib/parse_iso_intervals.c:1.5 
php-src/ext/date/lib/parse_iso_intervals.c:1.6
--- php-src/ext/date/lib/parse_iso_intervals.c:1.5      Tue Jul  8 18:27:07 2008
+++ php-src/ext/date/lib/parse_iso_intervals.c  Sat Aug  2 13:50:30 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.4 on Tue Jul  8 20:26:31 2008 */
+/* Generated by re2c 0.13.5 on Sat Aug  2 15:43:19 2008 */
 #line 1 "ext/date/lib/parse_iso_intervals.re"
 /*
    +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: parse_iso_intervals.c,v 1.5 2008/07/08 18:27:07 derick Exp $ */
+/* $Id: parse_iso_intervals.c,v 1.6 2008/08/02 13:50:30 derick Exp $ */
 
 #include "timelib.h"
 
@@ -278,7 +278,7 @@
 std:
        s->tok = cursor;
        s->len = 0;
-#line 303 "ext/date/lib/parse_iso_intervals.re"
+#line 306 "ext/date/lib/parse_iso_intervals.re"
 
 
 
@@ -349,10 +349,10 @@
        YYDEBUG(2, *YYCURSOR);
        ++YYCURSOR;
        if ((yych = *YYCURSOR) <= '/') goto yy3;
-       if (yych <= '9') goto yy74;
+       if (yych <= '9') goto yy98;
 yy3:
        YYDEBUG(3, *YYCURSOR);
-#line 396 "ext/date/lib/parse_iso_intervals.re"
+#line 419 "ext/date/lib/parse_iso_intervals.re"
        {
                add_error(s, "Unexpected character");
                goto std;
@@ -363,19 +363,18 @@
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        if (yych <= '/') goto yy3;
-       if (yych <= '9') goto yy35;
+       if (yych <= '9') goto yy59;
        goto yy3;
 yy5:
        YYDEBUG(5, *YYCURSOR);
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
-       if (yybm[0+yych] & 128) {
-               goto yy12;
-       }
-       if (yych == 'T') goto yy15;
+       if (yych <= '/') goto yy6;
+       if (yych <= '9') goto yy12;
+       if (yych == 'T') goto yy14;
 yy6:
        YYDEBUG(6, *YYCURSOR);
-#line 343 "ext/date/lib/parse_iso_intervals.re"
+#line 346 "ext/date/lib/parse_iso_intervals.re"
        {
                timelib_sll nr;
                int         in_time = 0;
@@ -392,7 +391,7 @@
                                break;
                        }
 
-                       nr = timelib_get_unsigned_nr((char **) &ptr, 4);
+                       nr = timelib_get_unsigned_nr((char **) &ptr, 9);
                        switch (*ptr) {
                                case 'Y': s->period->y = nr; break;
                                case 'W': s->period->d = nr * 7; break;
@@ -416,136 +415,153 @@
                TIMELIB_DEINIT;
                return TIMELIB_PERIOD;
        }
-#line 420 "ext/date/lib/parse_iso_intervals.c"
+#line 419 "ext/date/lib/parse_iso_intervals.c"
 yy7:
        YYDEBUG(7, *YYCURSOR);
        ++YYCURSOR;
        YYDEBUG(8, *YYCURSOR);
-#line 385 "ext/date/lib/parse_iso_intervals.re"
+#line 408 "ext/date/lib/parse_iso_intervals.re"
        {
                goto std;
        }
-#line 429 "ext/date/lib/parse_iso_intervals.c"
+#line 428 "ext/date/lib/parse_iso_intervals.c"
 yy9:
        YYDEBUG(9, *YYCURSOR);
        ++YYCURSOR;
        YYDEBUG(10, *YYCURSOR);
-#line 390 "ext/date/lib/parse_iso_intervals.re"
+#line 413 "ext/date/lib/parse_iso_intervals.re"
        {
                s->pos = cursor; s->line++;
                goto std;
        }
-#line 439 "ext/date/lib/parse_iso_intervals.c"
+#line 438 "ext/date/lib/parse_iso_intervals.c"
 yy11:
        YYDEBUG(11, *YYCURSOR);
        yych = *++YYCURSOR;
        goto yy3;
 yy12:
        YYDEBUG(12, *YYCURSOR);
-       ++YYCURSOR;
-       if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
-       yych = *YYCURSOR;
-       YYDEBUG(13, *YYCURSOR);
-       if (yybm[0+yych] & 128) {
-               goto yy12;
-       }
-       if (yych <= 'M') {
-               if (yych == 'D') goto yy25;
-               if (yych >= 'M') goto yy27;
+       yych = *++YYCURSOR;
+       if (yych <= 'L') {
+               if (yych <= '9') {
+                       if (yych >= '0') goto yy25;
+               } else {
+                       if (yych == 'D') goto yy24;
+               }
        } else {
                if (yych <= 'W') {
+                       if (yych <= 'M') goto yy27;
                        if (yych >= 'W') goto yy26;
                } else {
                        if (yych == 'Y') goto yy28;
                }
        }
-yy14:
-       YYDEBUG(14, *YYCURSOR);
+yy13:
+       YYDEBUG(13, *YYCURSOR);
        YYCURSOR = YYMARKER;
        if (yyaccept <= 0) {
                goto yy3;
        } else {
                goto yy6;
        }
-yy15:
-       YYDEBUG(15, *YYCURSOR);
+yy14:
+       YYDEBUG(14, *YYCURSOR);
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
-       if (yych <= '/') goto yy6;
-       if (yych >= ':') goto yy6;
-yy16:
-       YYDEBUG(16, *YYCURSOR);
+       if (yybm[0+yych] & 128) {
+               goto yy15;
+       }
+       goto yy6;
+yy15:
+       YYDEBUG(15, *YYCURSOR);
        ++YYCURSOR;
        if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
-       YYDEBUG(17, *YYCURSOR);
-       if (yych <= 'H') {
-               if (yych <= '/') goto yy14;
-               if (yych <= '9') goto yy16;
-               if (yych <= 'G') goto yy14;
-               goto yy20;
+       YYDEBUG(16, *YYCURSOR);
+       if (yybm[0+yych] & 128) {
+               goto yy15;
+       }
+       if (yych <= 'L') {
+               if (yych == 'H') goto yy19;
+               goto yy13;
        } else {
-               if (yych <= 'M') {
-                       if (yych <= 'L') goto yy14;
-                       goto yy19;
-               } else {
-                       if (yych != 'S') goto yy14;
-               }
+               if (yych <= 'M') goto yy18;
+               if (yych != 'S') goto yy13;
        }
-yy18:
-       YYDEBUG(18, *YYCURSOR);
+yy17:
+       YYDEBUG(17, *YYCURSOR);
        yych = *++YYCURSOR;
        goto yy6;
-yy19:
-       YYDEBUG(19, *YYCURSOR);
+yy18:
+       YYDEBUG(18, *YYCURSOR);
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
        if (yych <= '/') goto yy6;
-       if (yych <= '9') goto yy23;
+       if (yych <= '9') goto yy22;
        goto yy6;
-yy20:
-       YYDEBUG(20, *YYCURSOR);
+yy19:
+       YYDEBUG(19, *YYCURSOR);
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
        if (yych <= '/') goto yy6;
        if (yych >= ':') goto yy6;
-yy21:
-       YYDEBUG(21, *YYCURSOR);
+yy20:
+       YYDEBUG(20, *YYCURSOR);
        ++YYCURSOR;
        if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
-       YYDEBUG(22, *YYCURSOR);
+       YYDEBUG(21, *YYCURSOR);
        if (yych <= 'L') {
-               if (yych <= '/') goto yy14;
-               if (yych <= '9') goto yy21;
-               goto yy14;
-       } else {
-               if (yych <= 'M') goto yy19;
-               if (yych == 'S') goto yy18;
-               goto yy14;
+               if (yych <= '/') goto yy13;
+               if (yych <= '9') goto yy20;
+               goto yy13;
+       } else {
+               if (yych <= 'M') goto yy18;
+               if (yych == 'S') goto yy17;
+               goto yy13;
        }
-yy23:
-       YYDEBUG(23, *YYCURSOR);
+yy22:
+       YYDEBUG(22, *YYCURSOR);
        ++YYCURSOR;
        if (YYLIMIT <= YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
+       YYDEBUG(23, *YYCURSOR);
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy22;
+       if (yych == 'S') goto yy17;
+       goto yy13;
+yy24:
        YYDEBUG(24, *YYCURSOR);
-       if (yych <= '/') goto yy14;
-       if (yych <= '9') goto yy23;
-       if (yych == 'S') goto yy18;
-       goto yy14;
+       yych = *++YYCURSOR;
+       if (yych == 'T') goto yy14;
+       goto yy6;
 yy25:
        YYDEBUG(25, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych == 'T') goto yy15;
-       goto yy6;
+       if (yych <= 'L') {
+               if (yych <= '9') {
+                       if (yych <= '/') goto yy13;
+                       goto yy35;
+               } else {
+                       if (yych == 'D') goto yy24;
+                       goto yy13;
+               }
+       } else {
+               if (yych <= 'W') {
+                       if (yych <= 'M') goto yy27;
+                       if (yych <= 'V') goto yy13;
+               } else {
+                       if (yych == 'Y') goto yy28;
+                       goto yy13;
+               }
+       }
 yy26:
        YYDEBUG(26, *YYCURSOR);
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
        if (yych <= '/') goto yy6;
        if (yych <= '9') goto yy33;
-       if (yych == 'T') goto yy15;
+       if (yych == 'T') goto yy14;
        goto yy6;
 yy27:
        YYDEBUG(27, *YYCURSOR);
@@ -553,7 +569,7 @@
        yych = *(YYMARKER = ++YYCURSOR);
        if (yych <= '/') goto yy6;
        if (yych <= '9') goto yy31;
-       if (yych == 'T') goto yy15;
+       if (yych == 'T') goto yy14;
        goto yy6;
 yy28:
        YYDEBUG(28, *YYCURSOR);
@@ -561,7 +577,7 @@
        yych = *(YYMARKER = ++YYCURSOR);
        if (yych <= '/') goto yy6;
        if (yych <= '9') goto yy29;
-       if (yych == 'T') goto yy15;
+       if (yych == 'T') goto yy14;
        goto yy6;
 yy29:
        YYDEBUG(29, *YYCURSOR);
@@ -570,17 +586,17 @@
        yych = *YYCURSOR;
        YYDEBUG(30, *YYCURSOR);
        if (yych <= 'D') {
-               if (yych <= '/') goto yy14;
+               if (yych <= '/') goto yy13;
                if (yych <= '9') goto yy29;
-               if (yych <= 'C') goto yy14;
-               goto yy25;
+               if (yych <= 'C') goto yy13;
+               goto yy24;
        } else {
                if (yych <= 'M') {
-                       if (yych <= 'L') goto yy14;
+                       if (yych <= 'L') goto yy13;
                        goto yy27;
                } else {
                        if (yych == 'W') goto yy26;
-                       goto yy14;
+                       goto yy13;
                }
        }
 yy31:
@@ -590,13 +606,13 @@
        yych = *YYCURSOR;
        YYDEBUG(32, *YYCURSOR);
        if (yych <= 'C') {
-               if (yych <= '/') goto yy14;
+               if (yych <= '/') goto yy13;
                if (yych <= '9') goto yy31;
-               goto yy14;
+               goto yy13;
        } else {
-               if (yych <= 'D') goto yy25;
+               if (yych <= 'D') goto yy24;
                if (yych == 'W') goto yy26;
-               goto yy14;
+               goto yy13;
        }
 yy33:
        YYDEBUG(33, *YYCURSOR);
@@ -604,240 +620,400 @@
        if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
        yych = *YYCURSOR;
        YYDEBUG(34, *YYCURSOR);
-       if (yych <= '/') goto yy14;
+       if (yych <= '/') goto yy13;
        if (yych <= '9') goto yy33;
-       if (yych == 'D') goto yy25;
-       goto yy14;
+       if (yych == 'D') goto yy24;
+       goto yy13;
 yy35:
        YYDEBUG(35, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= ':') goto yy14;
+       if (yych <= 'L') {
+               if (yych <= '9') {
+                       if (yych <= '/') goto yy13;
+               } else {
+                       if (yych == 'D') goto yy24;
+                       goto yy13;
+               }
+       } else {
+               if (yych <= 'W') {
+                       if (yych <= 'M') goto yy27;
+                       if (yych <= 'V') goto yy13;
+                       goto yy26;
+               } else {
+                       if (yych == 'Y') goto yy28;
+                       goto yy13;
+               }
+       }
        YYDEBUG(36, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= ':') goto yy14;
+       if (yych != '-') goto yy39;
        YYDEBUG(37, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') {
-               if (yych == '-') goto yy40;
-               goto yy14;
-       } else {
-               if (yych <= '0') goto yy38;
-               if (yych <= '1') goto yy39;
-               goto yy14;
-       }
+       if (yych <= '/') goto yy13;
+       if (yych <= '0') goto yy40;
+       if (yych <= '1') goto yy41;
+       goto yy13;
 yy38:
        YYDEBUG(38, *YYCURSOR);
-       yych = *++YYCURSOR;
-       if (yych <= '0') goto yy14;
-       if (yych <= '9') goto yy61;
-       goto yy14;
+       ++YYCURSOR;
+       if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+       yych = *YYCURSOR;
 yy39:
        YYDEBUG(39, *YYCURSOR);
-       yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '2') goto yy61;
-       goto yy14;
+       if (yych <= 'L') {
+               if (yych <= '9') {
+                       if (yych <= '/') goto yy13;
+                       goto yy38;
+               } else {
+                       if (yych == 'D') goto yy24;
+                       goto yy13;
+               }
+       } else {
+               if (yych <= 'W') {
+                       if (yych <= 'M') goto yy27;
+                       if (yych <= 'V') goto yy13;
+                       goto yy26;
+               } else {
+                       if (yych == 'Y') goto yy28;
+                       goto yy13;
+               }
+       }
 yy40:
        YYDEBUG(40, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '0') goto yy41;
-       if (yych <= '1') goto yy42;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy42;
+       goto yy13;
 yy41:
        YYDEBUG(41, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '0') goto yy14;
-       if (yych <= '9') goto yy43;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= '3') goto yy13;
 yy42:
        YYDEBUG(42, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '3') goto yy14;
-yy43:
+       if (yych != '-') goto yy13;
        YYDEBUG(43, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych != '-') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '0') goto yy44;
+       if (yych <= '2') goto yy45;
+       if (yych <= '3') goto yy46;
+       goto yy13;
+yy44:
        YYDEBUG(44, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '0') goto yy45;
-       if (yych <= '2') goto yy46;
-       if (yych <= '3') goto yy47;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy47;
+       goto yy13;
 yy45:
        YYDEBUG(45, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '0') goto yy14;
-       if (yych <= '9') goto yy48;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy47;
+       goto yy13;
 yy46:
        YYDEBUG(46, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '9') goto yy48;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= '2') goto yy13;
 yy47:
        YYDEBUG(47, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '2') goto yy14;
-yy48:
+       if (yych != 'T') goto yy13;
        YYDEBUG(48, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych != 'T') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '1') goto yy49;
+       if (yych <= '2') goto yy50;
+       goto yy13;
+yy49:
        YYDEBUG(49, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '1') goto yy50;
-       if (yych <= '2') goto yy51;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy51;
+       goto yy13;
 yy50:
        YYDEBUG(50, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '9') goto yy52;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= '5') goto yy13;
 yy51:
        YYDEBUG(51, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '5') goto yy14;
-yy52:
+       if (yych != ':') goto yy13;
        YYDEBUG(52, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych != ':') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= '6') goto yy13;
        YYDEBUG(53, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '6') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
        YYDEBUG(54, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= ':') goto yy14;
+       if (yych != ':') goto yy13;
        YYDEBUG(55, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych != ':') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= '6') goto yy13;
        YYDEBUG(56, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '6') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
        YYDEBUG(57, *YYCURSOR);
-       yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= ':') goto yy14;
-       YYDEBUG(58, *YYCURSOR);
-       yych = *++YYCURSOR;
-       if (yych != 'Z') goto yy14;
-yy59:
-       YYDEBUG(59, *YYCURSOR);
        ++YYCURSOR;
-       YYDEBUG(60, *YYCURSOR);
-#line 319 "ext/date/lib/parse_iso_intervals.re"
+       YYDEBUG(58, *YYCURSOR);
+#line 388 "ext/date/lib/parse_iso_intervals.re"
        {
-               timelib_time *current;
-
-               if (s->have_date || s->have_period) {
-                       current = s->end;
-                       s->have_end_date = 1;
-               } else {
-                       current = s->begin;
-                       s->have_begin_date = 1;
-               }
-               DEBUG_OUTPUT("datetimebasic | datetimeextended");
+               DEBUG_OUTPUT("combinedrep");
                TIMELIB_INIT;
-               current->y = timelib_get_nr((char **) &ptr, 4);
-               current->m = timelib_get_nr((char **) &ptr, 2);
-               current->d = timelib_get_nr((char **) &ptr, 2);
-               current->h = timelib_get_nr((char **) &ptr, 2);
-               current->i = timelib_get_nr((char **) &ptr, 2);
-               current->s = timelib_get_nr((char **) &ptr, 2);
-               s->have_date = 1;
+               s->period->y = timelib_get_unsigned_nr((char **) &ptr, 4);
+               ptr++;
+               s->period->m = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->d = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->h = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->i = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->s = timelib_get_unsigned_nr((char **) &ptr, 2);
+               s->have_period = 1;
                TIMELIB_DEINIT;
-               return TIMELIB_ISO_DATE;
+               return TIMELIB_PERIOD;
        }
-#line 763 "ext/date/lib/parse_iso_intervals.c"
-yy61:
+#line 787 "ext/date/lib/parse_iso_intervals.c"
+yy59:
+       YYDEBUG(59, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
+       YYDEBUG(60, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
        YYDEBUG(61, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '0') goto yy62;
-       if (yych <= '2') goto yy63;
-       if (yych <= '3') goto yy64;
-       goto yy14;
+       if (yych <= '/') {
+               if (yych == '-') goto yy64;
+               goto yy13;
+       } else {
+               if (yych <= '0') goto yy62;
+               if (yych <= '1') goto yy63;
+               goto yy13;
+       }
 yy62:
        YYDEBUG(62, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '0') goto yy14;
-       if (yych <= '9') goto yy65;
-       goto yy14;
+       if (yych <= '0') goto yy13;
+       if (yych <= '9') goto yy85;
+       goto yy13;
 yy63:
        YYDEBUG(63, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '9') goto yy65;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '2') goto yy85;
+       goto yy13;
 yy64:
        YYDEBUG(64, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '2') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '0') goto yy65;
+       if (yych <= '1') goto yy66;
+       goto yy13;
 yy65:
        YYDEBUG(65, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych != 'T') goto yy14;
+       if (yych <= '0') goto yy13;
+       if (yych <= '9') goto yy67;
+       goto yy13;
+yy66:
        YYDEBUG(66, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '1') goto yy67;
-       if (yych <= '2') goto yy68;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= '3') goto yy13;
 yy67:
        YYDEBUG(67, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych <= '9') goto yy69;
-       goto yy14;
-yy68:
+       if (yych != '-') goto yy13;
        YYDEBUG(68, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '5') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '0') goto yy69;
+       if (yych <= '2') goto yy70;
+       if (yych <= '3') goto yy71;
+       goto yy13;
 yy69:
        YYDEBUG(69, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '6') goto yy14;
+       if (yych <= '0') goto yy13;
+       if (yych <= '9') goto yy72;
+       goto yy13;
+yy70:
        YYDEBUG(70, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= ':') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy72;
+       goto yy13;
+yy71:
        YYDEBUG(71, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= '6') goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych >= '2') goto yy13;
+yy72:
        YYDEBUG(72, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych <= '/') goto yy14;
-       if (yych >= ':') goto yy14;
+       if (yych != 'T') goto yy13;
        YYDEBUG(73, *YYCURSOR);
        yych = *++YYCURSOR;
-       if (yych == 'Z') goto yy59;
-       goto yy14;
+       if (yych <= '/') goto yy13;
+       if (yych <= '1') goto yy74;
+       if (yych <= '2') goto yy75;
+       goto yy13;
 yy74:
        YYDEBUG(74, *YYCURSOR);
-       ++YYCURSOR;
-       if (YYLIMIT <= YYCURSOR) YYFILL(1);
-       yych = *YYCURSOR;
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy76;
+       goto yy13;
+yy75:
        YYDEBUG(75, *YYCURSOR);
-       if (yych <= '/') goto yy76;
-       if (yych <= '9') goto yy74;
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= '5') goto yy13;
 yy76:
        YYDEBUG(76, *YYCURSOR);
-#line 308 "ext/date/lib/parse_iso_intervals.re"
+       yych = *++YYCURSOR;
+       if (yych != ':') goto yy13;
+       YYDEBUG(77, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= '6') goto yy13;
+       YYDEBUG(78, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
+       YYDEBUG(79, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych != ':') goto yy13;
+       YYDEBUG(80, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= '6') goto yy13;
+       YYDEBUG(81, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
+       YYDEBUG(82, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych != 'Z') goto yy13;
+yy83:
+       YYDEBUG(83, *YYCURSOR);
+       ++YYCURSOR;
+       YYDEBUG(84, *YYCURSOR);
+#line 322 "ext/date/lib/parse_iso_intervals.re"
+       {
+               timelib_time *current;
+
+               if (s->have_date || s->have_period) {
+                       current = s->end;
+                       s->have_end_date = 1;
+               } else {
+                       current = s->begin;
+                       s->have_begin_date = 1;
+               }
+               DEBUG_OUTPUT("datetimebasic | datetimeextended");
+               TIMELIB_INIT;
+               current->y = timelib_get_nr((char **) &ptr, 4);
+               current->m = timelib_get_nr((char **) &ptr, 2);
+               current->d = timelib_get_nr((char **) &ptr, 2);
+               current->h = timelib_get_nr((char **) &ptr, 2);
+               current->i = timelib_get_nr((char **) &ptr, 2);
+               current->s = timelib_get_nr((char **) &ptr, 2);
+               s->have_date = 1;
+               TIMELIB_DEINIT;
+               return TIMELIB_ISO_DATE;
+       }
+#line 939 "ext/date/lib/parse_iso_intervals.c"
+yy85:
+       YYDEBUG(85, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych <= '0') goto yy86;
+       if (yych <= '2') goto yy87;
+       if (yych <= '3') goto yy88;
+       goto yy13;
+yy86:
+       YYDEBUG(86, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '0') goto yy13;
+       if (yych <= '9') goto yy89;
+       goto yy13;
+yy87:
+       YYDEBUG(87, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy89;
+       goto yy13;
+yy88:
+       YYDEBUG(88, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= '2') goto yy13;
+yy89:
+       YYDEBUG(89, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych != 'T') goto yy13;
+       YYDEBUG(90, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych <= '1') goto yy91;
+       if (yych <= '2') goto yy92;
+       goto yy13;
+yy91:
+       YYDEBUG(91, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych <= '9') goto yy93;
+       goto yy13;
+yy92:
+       YYDEBUG(92, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= '5') goto yy13;
+yy93:
+       YYDEBUG(93, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= '6') goto yy13;
+       YYDEBUG(94, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
+       YYDEBUG(95, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= '6') goto yy13;
+       YYDEBUG(96, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych <= '/') goto yy13;
+       if (yych >= ':') goto yy13;
+       YYDEBUG(97, *YYCURSOR);
+       yych = *++YYCURSOR;
+       if (yych == 'Z') goto yy83;
+       goto yy13;
+yy98:
+       YYDEBUG(98, *YYCURSOR);
+       ++YYCURSOR;
+       if (YYLIMIT <= YYCURSOR) YYFILL(1);
+       yych = *YYCURSOR;
+       YYDEBUG(99, *YYCURSOR);
+       if (yych <= '/') goto yy100;
+       if (yych <= '9') goto yy98;
+yy100:
+       YYDEBUG(100, *YYCURSOR);
+#line 311 "ext/date/lib/parse_iso_intervals.re"
        {
                DEBUG_OUTPUT("recurrences");
                TIMELIB_INIT;
@@ -847,9 +1023,9 @@
                s->have_recurrences = 1;
                return TIMELIB_PERIOD;
        }
-#line 851 "ext/date/lib/parse_iso_intervals.c"
+#line 1027 "ext/date/lib/parse_iso_intervals.c"
 }
-#line 400 "ext/date/lib/parse_iso_intervals.re"
+#line 423 "ext/date/lib/parse_iso_intervals.re"
 
 }
 
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_iso_intervals.re?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/date/lib/parse_iso_intervals.re
diff -u php-src/ext/date/lib/parse_iso_intervals.re:1.3 
php-src/ext/date/lib/parse_iso_intervals.re:1.4
--- php-src/ext/date/lib/parse_iso_intervals.re:1.3     Sun May  4 09:59:42 2008
+++ php-src/ext/date/lib/parse_iso_intervals.re Sat Aug  2 13:50:30 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: parse_iso_intervals.re,v 1.3 2008/05/04 09:59:42 derick Exp $ */
+/* $Id: parse_iso_intervals.re,v 1.4 2008/08/02 13:50:30 derick Exp $ */
 
 #include "timelib.h"
 
@@ -285,7 +285,9 @@
 hour24lz = [01][0-9] | "2"[0-4];
 minutelz = [0-5][0-9];
 monthlz = "0" [1-9] | "1" [0-2];
+monthlzz = "0" [0-9] | "1" [0-2];
 daylz   = "0" [1-9] | [1-2][0-9] | "3" [01];
+daylzz  = "0" [0-9] | [1-2][0-9] | "3" [01];
 secondlz = minutelz;
 year4 = [0-9]{4};
 weekofyear = "0"[1-9] | [1-4][0-9] | "5"[0-3];
@@ -294,6 +296,7 @@
 datetimebasic  = year4 monthlz daylz "T" hour24lz minutelz secondlz "Z";
 datetimeextended  = year4 "-" monthlz "-" daylz "T" hour24lz ':' minutelz ':' 
secondlz "Z";
 period   = "P" (number "Y")? (number "M")? (number "W")? (number "D")? ("T" 
(number "H")? (number "M")? (number "S")?)?;
+combinedrep = "P" year4 "-" monthlzz "-" daylzz "T" hour24lz ':' minutelz ':' 
secondlz;
 
 recurrences = "R" number;
 
@@ -356,7 +359,7 @@
                                break;
                        }
 
-                       nr = timelib_get_unsigned_nr((char **) &ptr, 4);
+                       nr = timelib_get_unsigned_nr((char **) &ptr, 9);
                        switch (*ptr) {
                                case 'Y': s->period->y = nr; break;
                                case 'W': s->period->d = nr * 7; break;
@@ -381,6 +384,26 @@
                return TIMELIB_PERIOD;
        }
 
+       combinedrep
+       {
+               DEBUG_OUTPUT("combinedrep");
+               TIMELIB_INIT;
+               s->period->y = timelib_get_unsigned_nr((char **) &ptr, 4);
+               ptr++;
+               s->period->m = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->d = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->h = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->i = timelib_get_unsigned_nr((char **) &ptr, 2);
+               ptr++;
+               s->period->s = timelib_get_unsigned_nr((char **) &ptr, 2);
+               s->have_period = 1;
+               TIMELIB_DEINIT;
+               return TIMELIB_PERIOD;
+       }
+
        [ .,\t/]
        {
                goto std;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to