-/* Generated by re2c 0.12.1 on Sun Feb 17 19:15:32 2008 */
+/* Generated by re2c 0.12.1 on Sun Feb 24 19:24:27 2008 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
long value = 0;
const timelib_tz_lookup_table *tp;
- while (**ptr != '\0' && **ptr != ')') {
+ while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
++*ptr;
}
end = *ptr;
}
break;
+ case ';':
+ case ':':
+ case '/':
+ case '.':
+ case ',':
+ case '-':
+ if (*ptr == *fptr) {
+ ++ptr;
+ } else {
+ add_pbf_error(s, "The separation symbol could not be found", string, begin);
+ }
+ break;
+
+ case '!': // reset all fields to default
+ s->time->y = 1970;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->h = s->time->i = s->time->s = 0;
+ s->time->f = 0.0;
+ s->time->tz_info = NULL;
+ break; // break intentionally not missing
+
+ case '|': // reset all fields to default when not set
+ if (s->time->y == TIMELIB_UNSET ) s->time->y = 1970;
+ if (s->time->m == TIMELIB_UNSET ) s->time->m = 1;
+ if (s->time->d == TIMELIB_UNSET ) s->time->d = 1;
+ if (s->time->h == TIMELIB_UNSET ) s->time->h = 0;
+ if (s->time->i == TIMELIB_UNSET ) s->time->i = 0;
+ if (s->time->s == TIMELIB_UNSET ) s->time->s = 0;
+ if (s->time->f == TIMELIB_UNSET ) s->time->f = 0.0;
+
+ break; // break intentionally not missing
+
case '?': // random char
++ptr;
break;
add_pbf_error(s, "Data missing", string, ptr);
}
+ // clean up a bit
+ if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) {
+ if (s->time->h == TIMELIB_UNSET ) {
+ s->time->h = 0;
+ }
+ if (s->time->i == TIMELIB_UNSET ) {
+ s->time->i = 0;
+ }
+ if (s->time->s == TIMELIB_UNSET ) {
+ s->time->s = 0;
+ }
+ }
+
+
if (errors) {
*errors = in.errors;
} else {
long value = 0;
const timelib_tz_lookup_table *tp;
- while (**ptr != '\0' && **ptr != ')') {
+ while (**ptr != '\0' && **ptr != ')' && **ptr != ' ') {
++*ptr;
}
end = *ptr;
}
break;
+ case ';':
+ case ':':
+ case '/':
+ case '.':
+ case ',':
+ case '-':
+ if (*ptr == *fptr) {
+ ++ptr;
+ } else {
+ add_pbf_error(s, "The separation symbol could not be found", string, begin);
+ }
+ break;
+
+ case '!': // reset all fields to default
+ s->time->y = 1970;
+ s->time->m = 1;
+ s->time->d = 1;
+ s->time->h = s->time->i = s->time->s = 0;
+ s->time->f = 0.0;
+ s->time->tz_info = NULL;
+ break; // break intentionally not missing
+
+ case '|': // reset all fields to default when not set
+ if (s->time->y == TIMELIB_UNSET ) s->time->y = 1970;
+ if (s->time->m == TIMELIB_UNSET ) s->time->m = 1;
+ if (s->time->d == TIMELIB_UNSET ) s->time->d = 1;
+ if (s->time->h == TIMELIB_UNSET ) s->time->h = 0;
+ if (s->time->i == TIMELIB_UNSET ) s->time->i = 0;
+ if (s->time->s == TIMELIB_UNSET ) s->time->s = 0;
+ if (s->time->f == TIMELIB_UNSET ) s->time->f = 0.0;
+
+ break; // break intentionally not missing
+
case '?': // random char
++ptr;
break;
add_pbf_error(s, "Data missing", string, ptr);
}
+ // clean up a bit
+ if (s->time->h != TIMELIB_UNSET || s->time->i != TIMELIB_UNSET || s->time->s != TIMELIB_UNSET) {
+ if (s->time->h == TIMELIB_UNSET ) {
+ s->time->h = 0;
+ }
+ if (s->time->i == TIMELIB_UNSET ) {
+ s->time->i = 0;
+ }
+ if (s->time->s == TIMELIB_UNSET ) {
+ s->time->s = 0;
+ }
+ }
+
+
if (errors) {
*errors = in.errors;
} else {