15#define sizeof_array(o) (sizeof o / sizeof o[0])
17#define f_negate(x) rb_funcall(x, rb_intern("-@"), 0)
18#define f_add(x,y) rb_funcall(x, '+', 1, y)
19#define f_sub(x,y) rb_funcall(x, '-', 1, y)
20#define f_mul(x,y) rb_funcall(x, '*', 1, y)
21#define f_div(x,y) rb_funcall(x, '/', 1, y)
22#define f_idiv(x,y) rb_funcall(x, rb_intern("div"), 1, y)
23#define f_mod(x,y) rb_funcall(x, '%', 1, y)
24#define f_expt(x,y) rb_funcall(x, rb_intern("**"), 1, y)
26#define f_lt_p(x,y) rb_funcall(x, '<', 1, y)
27#define f_gt_p(x,y) rb_funcall(x, '>', 1, y)
28#define f_le_p(x,y) rb_funcall(x, rb_intern("<="), 1, y)
29#define f_ge_p(x,y) rb_funcall(x, rb_intern(">="), 1, y)
31#define f_to_s(x) rb_funcall(x, rb_intern("to_s"), 0)
33#define f_match(r,s) rb_funcall(r, rb_intern("match"), 1, s)
34#define f_aref(o,i) rb_funcall(o, rb_intern("[]"), 1, i)
35#define f_aref2(o,i,j) rb_funcall(o, rb_intern("[]"), 2, i, j)
36#define f_begin(o,i) rb_funcall(o, rb_intern("begin"), 1, i)
37#define f_end(o,i) rb_funcall(o, rb_intern("end"), 1, i)
38#define f_aset(o,i,v) rb_funcall(o, rb_intern("[]="), 2, i, v)
39#define f_aset2(o,i,j,v) rb_funcall(o, rb_intern("[]="), 3, i, j, v)
40#define f_sub_bang(s,r,x) rb_funcall(s, rb_intern("sub!"), 2, r, x)
41#define f_gsub_bang(s,r,x) rb_funcall(s, rb_intern("gsub!"), 2, r, x)
43#define set_hash(k,v) rb_hash_aset(hash, ID2SYM(rb_intern(k"")), v)
44#define ref_hash(k) rb_hash_aref(hash, ID2SYM(rb_intern(k"")))
45#define del_hash(k) rb_hash_delete(hash, ID2SYM(rb_intern(k"")))
47#define cstr2num(s) rb_cstr_to_inum(s, 10, 0)
48#define str2num(s) rb_str_to_inum(s, 10, 0)
50static const char abbr_days[][4] = {
51 "sun",
"mon",
"tue",
"wed",
55static const char abbr_months[][4] = {
56 "jan",
"feb",
"mar",
"apr",
"may",
"jun",
57 "jul",
"aug",
"sep",
"oct",
"nov",
"dec"
60#define issign(c) ((c) == '-' || (c) == '+')
61#define asp_string() rb_str_new(" ", 1)
63#define asuba_string() rb_str_new("\001", 1)
64#define asubb_string() rb_str_new("\002", 1)
65#define asubw_string() rb_str_new("\027", 1)
66#define asubt_string() rb_str_new("\024", 1)
70digit_span(
const char *s,
const char *e)
73 while (s +
i < e && isdigit((
unsigned char)s[
i]))
i++;
108 const char *s, *
bp, *ep;
113 while (s < ep && !
issign(*s) && !isdigit((
unsigned char)*s))
115 if (s >= ep)
goto no_date;
117 if (
issign((
unsigned char)*s))
119 l = digit_span(s, ep);
158 const char *s, *
bp, *ep;
165 while (s < ep && !
issign(*s) && !isdigit((
unsigned char)*s))
167 if (s >= ep)
goto no_year;
175 l = digit_span(s, ep);
196 const char *s, *
bp, *ep;
202 while (s < ep && !isdigit((
unsigned char)*s))
204 if (s >= ep)
goto no_month;
206 l = digit_span(s, ep);
222 const char *s, *
bp, *ep;
228 while (s < ep && !isdigit((
unsigned char)*s))
230 if (s >= ep)
goto no_mday;
232 l = digit_span(s, ep);
251#define DAYS "sunday|monday|tuesday|wednesday|thursday|friday|saturday"
252#define MONTHS "january|february|march|april|may|june|july|august|september|october|november|december"
253#define ABBR_DAYS "sun|mon|tue|wed|thu|fri|sat"
254#define ABBR_MONTHS "jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec"
257#define VALID_DAYS "(?:" DAYS ")" "|(?:tues|wednes|thurs|thur|" ABBR_DAYS ")\\.?"
258#define VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")\\.?"
259#define DOTLESS_VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")"
265#define FPW_COM "\\s*(?:" FPW "\\s*,?)?\\s*"
266#define FPT_COM "\\s*(?:" FPT "\\s*,?)?\\s*"
267#define COM_FPW "\\s*(?:,?\\s*" FPW ")?\\s*"
268#define COM_FPT "\\s*(?:,?\\s*(?:@|\\b[aA][tT]\\b)?\\s*" FPT ")?\\s*"
269#define TEE_FPT "\\s*(?:[tT]?" FPT ")?"
274regcomp(
const char *source,
long len,
int opt)
283#define REGCOMP(pat,opt) \
286 pat = regcomp(pat##_source, sizeof pat##_source - 1, opt); \
289#define REGCOMP_0(pat) REGCOMP(pat, 0)
290#define REGCOMP_I(pat) REGCOMP(pat, ONIG_OPTION_IGNORECASE)
292#define MATCH(s,p,c) \
294 return match(s, p, hash, c); \
336 return subx(s, asp_string(), p, hash, c); \
342 return subx(s, asuba_string(), p, hash, c); \
347 return subx(s, asubb_string(), p, hash, c); \
352 return subx(s, asubw_string(), p, hash, c); \
357 return subx(s, asubt_string(), p, hash, c); \
364str_end_with_word(
const char *s,
long l,
const char *w)
367 if (l <=
n || !isspace((
unsigned char)s[l -
n - 1]))
return 0;
369 do ++
n;
while (l >
n && isspace((
unsigned char)s[l -
n - 1]));
374shrunk_size(
const char *s,
long l)
378 for (
i = ni = 0;
i < l; ++
i) {
379 if (!isspace((
unsigned char)s[
i])) {
388 return ni < l ? ni : 0;
392shrink_space(
char *d,
const char *s,
long l)
396 for (
i = ni = 0;
i < l; ++
i) {
397 if (!isspace((
unsigned char)s[
i])) {
398 if (sp) d[ni++] =
' ';
421 if ((w = str_end_with_word(s, l,
"time")) > 0) {
424 if ((w = str_end_with_word(s, l,
"standard")) > 0) {
427 else if ((w = str_end_with_word(s, l,
"daylight")) > 0) {
435 else if ((w = str_end_with_word(s, l,
"dst")) > 0) {
440 long sl = shrunk_size(s, l);
443 l = shrink_space(d, s, l);
448 const struct zone *z =
zonetab(s, (
unsigned int)l);
460 long hour = 0, min = 0, sec = 0;
483 if (*p ==
',' || *p ==
'.') {
486 min =
STRTOUL(p, &e, 10) * 3600;
509 sec += min * 60 + hour * 3600;
510 if (sign) sec = -sec;
556 static const char pat_source[] =
569 SUBW(
str, pat, parse_day_cb);
619 static const char pat_source[] =
621 "(?:\\s*:?\\s*(\\d+)m?"
623 "\\s*:?\\s*(\\d+)(?:[,.](\\d+))?s?"
626 "(?:\\s*([ap])(?:m\\b|\\.m\\.))?";
643 parse_time2_cb(m, hash);
652 static const char pat_source[] =
658 "\\s*:\\s*\\d+(?:[,.]\\d*)?"
660 "\\s*:\\s*\\d+(?:[,.]\\d+)?"
664 "\\d+\\s*h(?:\\s*\\d+m?(?:\\s*\\d+s?)?)?"
668 "[ap](?:m\\b|\\.m\\.)"
671 "\\d+\\s*[ap](?:m\\b|\\.m\\.)"
676 "(?:gmt|utc?)?[-+]\\d+(?:[,.:]\\d+(?::\\d+)?)?"
678 "(?-i:[[:alpha:].\\s]+)(?:standard|daylight)\\stime\\b"
680 "(?-i:[[:alpha:]]+)(?:\\sdst)?\\b"
689 SUBT(
str, pat, parse_time_cb);
703 static const char pat_source[] =
708 SUBA(
str, pat, parse_era1_cb);
726 static const char pat_source[] =
727 "(c(?:e|\\.e\\.)|b(?:ce|\\.c\\.e\\.)|b(?:c|\\.c\\.))";
731 SUBB(
str, pat, parse_era2_cb);
737 if (parse_era1(
str, hash))
739 if (parse_era2(
str, hash))
749check_year_width(
VALUE y)
757 if (!isdigit((
unsigned char)s[1]))
return 0;
758 return (l == 2 || !isdigit((
unsigned char)s[2]));
767 if (!check_year_width(a))
772 if (!check_year_width(b))
779 if (!check_year_width(c))
802 s3e(hash, y, mon, d, !
NIL_P(b) &&
812 if (!check_apost(d, mon, y))
817 s3e(hash, y, mon, d, 0);
825 static const char pat_source[] =
831 "('?\\d+)[^-\\d\\s]*"
833 "(\\d+)(?:(?:st|nd|rd|th)\\b)?"
844 "(c(?:e|\\.e\\.)|b(?:ce|\\.c\\.e\\.)|a(?:d|\\.d\\.)|b(?:c|\\.c\\.))?"
846 "('?-?\\d+(?:(?:st|nd|rd|th)\\b)?)"
852 "(?:" FPA
"|" FPB
")?"
880 s3e(hash, y, mon, d, !
NIL_P(b) &&
890 if (!check_apost(mon, d, y))
895 s3e(hash, y, mon, d, 0);
903 static const char pat_source[] =
911 "\\b(" VALID_MONTHS
")"
915 "('?\\d+)[^-\\d\\s']*"
917 "('?\\d+)(?:(?:st|nd|rd|th)\\b)?"
924 "(c(?:e|\\.e\\.)|b(?:ce|\\.c\\.e\\.)|a(?:d|\\.d\\.)|b(?:c|\\.c\\.))?"
932 "(?:" FPA
"|" FPB
")?"
956 if (!check_apost(y, mon, d))
960 s3e(hash, y, mon, d, 0);
967 static const char pat_source[] =
969 "('?[-+]?\\d+)-(\\d+)-('?-?\\d+)"
973 "([-+']?\\d+)-(\\d+)-([-']?\\d+)"
1005 static const char pat_source[] =
1007 "\\b(\\d{2}|\\d{4})?-?w(\\d{2})(?:-?(\\d))?\\b"
1011 "(\\d{2}|\\d{4})?-?w(\\d{2})(?:-?(\\d))?"
1019 SUBS(
str, pat, parse_iso21_cb);
1035 static const char pat_source[] =
1049 SUBS(
str, pat, parse_iso22_cb);
1070 static const char pat_source[] =
1072 "--(\\d{2})?-(\\d{2})\\b"
1076 "--(\\d{2})?-(\\d{2})"
1084 SUBS(
str, pat, parse_iso23_cb);
1105 static const char pat_source[] =
1107 "--(\\d{2})(\\d{2})?\\b"
1111 "--(\\d{2})(\\d{2})?"
1119 SUBS(
str, pat, parse_iso24_cb);
1139 static const char pat0_source[] =
1141 "[,.](\\d{2}|\\d{4})-\\d{3}\\b"
1145 "[,.](\\d{2}|\\d{4})-\\d{3}"
1151 static const char pat_source[] =
1153 "\\b(\\d{2}|\\d{4})-(\\d{3})\\b"
1157 "(\\d{2}|\\d{4})-(\\d{3})"
1169 SUBS(
str, pat, parse_iso25_cb);
1185 static const char pat0_source[] =
1197 static const char pat_source[] =
1215 SUBS(
str, pat, parse_iso26_cb);
1221 if (parse_iso21(
str, hash))
1223 if (parse_iso22(
str, hash))
1225 if (parse_iso23(
str, hash))
1227 if (parse_iso24(
str, hash))
1229 if (parse_iso25(
str, hash))
1231 if (parse_iso26(
str, hash))
1239#define JISX0301_ERA_INITIALS "mtshr"
1240#define JISX0301_DEFAULT_ERA 'H'
1248 case 'M':
case 'm': e = 1867;
break;
1249 case 'T':
case 't': e = 1911;
break;
1250 case 'S':
case 's': e = 1925;
break;
1251 case 'H':
case 'h': e = 1988;
break;
1252 case 'R':
case 'r': e = 2018;
break;
1253 default: e = 0;
break;
1281 static const char pat_source[] =
1308 if (!check_apost(d, mon, y))
1314 s3e(hash, y, mon, d, 0);
1321 static const char pat_source[] =
1328 "([-']?\\d+)-(" DOTLESS_VALID_MONTHS
")"
1337 SUBS(
str, pat, parse_vms11_cb);
1350 if (!check_apost(mon, d, y))
1356 s3e(hash, y, mon, d, 0);
1363 static const char pat_source[] =
1366 "-('?-?\\d+)(?:-('?-?\\d+))?"
1370 "(" DOTLESS_VALID_MONTHS
")"
1371 "-([-']?\\d+)(?:-([-']?\\d+))?"
1379 SUBS(
str, pat, parse_vms12_cb);
1385 if (parse_vms11(
str, hash))
1387 if (parse_vms12(
str, hash))
1405 if (!check_apost(y, mon, d))
1409 s3e(hash, y, mon, d, 0);
1416 static const char pat_source[] =
1418 "('?-?\\d+)/\\s*('?\\d+)(?:\\D\\s*('?-?\\d+))?"
1422 "([-']?\\d+)/\\s*('?\\d+)(?:(?:[-/]|\\s+)\\s*([-']?\\d+))?"
1443 if (!check_apost(d, mon, y))
1448 s3e(hash, y, mon, d, 0);
1455 static const char pat_source[] =
1458 "([-']?\\d+)/\\s*(" DOTLESS_VALID_MONTHS
")(?:(?:[-/]|\\s+)\\s*([-']?\\d+))?"
1465 SUBS(
str, pat, parse_sla2_cb);
1477 if (!check_apost(mon, d, y))
1482 s3e(hash, y, mon, d, 0);
1489 static const char pat_source[] =
1492 "(" DOTLESS_VALID_MONTHS
")/\\s*([-']?\\d+)(?:(?:[-/]|\\s+)\\s*([-']?\\d+))?"
1499 SUBS(
str, pat, parse_sla3_cb);
1513 if (!check_apost(y, mon, d))
1517 s3e(hash, y, mon, d, 0);
1524 static const char pat_source[] =
1526 "('?-?\\d+)\\.\\s*('?\\d+)\\.\\s*('?-?\\d+)"
1530 "([-']?\\d+)\\.\\s*(\\d+)\\.\\s*([-']?\\d+)"
1551 if (!check_apost(d, mon, y))
1556 s3e(hash, y, mon, d, 0);
1563 static const char pat_source[] =
1566 "([-']?\\d+)\\.\\s*(" DOTLESS_VALID_MONTHS
")(?:(?:[./])\\s*([-']?\\d+))?"
1573 SUBS(
str, pat, parse_dot2_cb);
1585 if (!check_apost(mon, d, y))
1590 s3e(hash, y, mon, d, 0);
1597 static const char pat_source[] =
1600 "(" DOTLESS_VALID_MONTHS
")\\.\\s*([-']?\\d+)(?:(?:[./])\\s*([-']?\\d+))?"
1607 SUBS(
str, pat, parse_dot3_cb);
1624 static const char pat_source[] =
1638 SUBS(
str, pat, parse_year_cb);
1654 static const char pat_source[] =
1660 "(" VALID_MONTHS
")"
1684 static const char pat_source[] =
1686 "(\\d+)(st|nd|rd|th)\\b"
1690 "(\\d+)(st|nd|rd|th)"
1698 SUBS(
str, pat, parse_mday_cb);
1702n2i(
const char *s,
long f,
long w)
1709 for (
i =
f;
i < e;
i++) {
1720 const char *cs2, *cs3, *cs5;
1721 long l2, l3, l4, l5;
1756 int y = n2i(cs2, 0, 2);
1776 int y = n2i(cs2, l2-12, 2);
1782 int y = n2i(cs2, l2-14, 4);
1790 int y = n2i(cs2, 0, 4);
1820 int y = n2i(cs2, 0, 2);
1835 int y = n2i(cs2, 0, 4);
1890 const char *s1, *
s2;
1903 if (isdigit((
unsigned char)*s1))
1920 static const char pat_source[] =
1924 "([-+]?)(\\d{2,14})"
1929 "(\\d{2,6})?(?:[,.](\\d*))?"
1938 "\\[[-+]?\\d[^\\]]*\\]"
1962 static const char pat_source[] =
1963 "\\b(bc\\b|bce\\b|b\\.c\\.|b\\.c\\.e\\.)";
1996 static const char pat_source[] =
"\\A\\s*(\\d{1,2})\\s*\\z";
2000 SUBS(
str, pat, parse_frag_cb);
2014 static const char pat_source[] =
"\\A\\s*" FPW
"\\s*\\z";
2018 SUBS(
str, pat, parse_dummy_cb);
2024 static const char pat_source[] =
"\\A\\s*" FPT "\\s*\\z";
2028 SUBS(
str, pat, parse_dummy_cb);
2034 static const char pat_source[] =
"\\A\\s*(" FPW
"\\s+" FPT "|" FPT "\\s+" FPW
")\\s*\\z";
2038 SUBS(
str, pat, parse_dummy_cb);
2042have_invalid_char_p(
VALUE s)
2054#define HAVE_ALPHA (1<<0)
2055#define HAVE_DIGIT (1<<1)
2056#define HAVE_DASH (1<<2)
2057#define HAVE_DOT (1<<3)
2058#define HAVE_SLASH (1<<4)
2082#define HAVE_ELEM_P(x) ((check_class(str) & (x)) == (x))
2085#define PARSER_ERROR return rb_hash_new()
2091 VALUE backref, hash;
2094 if (have_invalid_char_p(
str))
2102 static const char pat_source[] =
2104 "[^-+',./:@[:alnum:]\\[\\]]+"
2120 parse_day(
str, hash);
2122 parse_time(
str, hash);
2126 parse_era(
str, hash);
2130 if (parse_eu(
str, hash))
2132 if (parse_us(
str, hash))
2136 if (parse_iso(
str, hash))
2139 if (parse_jis(
str, hash))
2142 if (parse_vms(
str, hash))
2145 if (parse_sla(
str, hash))
2149 if (parse_sla2(
str, hash))
2151 if (parse_sla3(
str, hash))
2156 if (parse_dot(
str, hash))
2160 if (parse_dot2(
str, hash))
2162 if (parse_dot3(
str, hash))
2167 if (parse_iso2(
str, hash))
2170 if (parse_year(
str, hash))
2173 if (parse_mon(
str, hash))
2176 if (parse_mday(
str, hash))
2179 if (parse_ddd(
str, hash))
2183 if (parse_wday_only(
str, hash))
2185 if (parse_time_only(
str, hash))
2187 if (parse_wday_and_time(
str, hash))
2196 parse_bc(
str, hash);
2198 parse_frag(
str, hash);
2304 else if (!
NIL_P(s[5])) {
2313 else if (!
NIL_P(s[8])) {
2323 else if (!
NIL_P(s[9])) {
2326 if (!
NIL_P(s[10])) {
2332 if (!
NIL_P(s[13])) {
2333 set_hash(
"sec_fraction", sec_fraction(s[13]));
2335 if (!
NIL_P(s[14])) {
2346 static const char pat_source[] =
2347 "\\A\\s*(?:([-+]?\\d{2,}|-)-(\\d{2})?(?:-(\\d{2}))?|"
2348 "([-+]?\\d{2,})?-(\\d{3})|"
2349 "(\\d{4}|\\d{2})?-w(\\d{2})-(\\d)|"
2352 "(\\d{2}):(\\d{2})(?::(\\d{2})(?:[,.](\\d+))?)?"
2353 "(z|[-+]\\d{2}(?::?\\d{2})?)?)?\\s*\\z";
2357 MATCH(
str, pat, iso8601_ext_datetime_cb);
2390 else if (!
NIL_P(s[5])) {
2397 else if (!
NIL_P(s[6])) {
2400 else if (!
NIL_P(s[9])) {
2408 else if (!
NIL_P(s[11])) {
2412 else if (!
NIL_P(s[12])) {
2415 if (!
NIL_P(s[13])) {
2421 if (!
NIL_P(s[16])) {
2422 set_hash(
"sec_fraction", sec_fraction(s[16]));
2424 if (!
NIL_P(s[17])) {
2435 static const char pat_source[] =
2436 "\\A\\s*(?:([-+]?(?:\\d{4}|\\d{2})|--)(\\d{2}|-)(\\d{2})|"
2437 "([-+]?(?:\\d{4}|\\d{2}))(\\d{3})|"
2439 "(\\d{4}|\\d{2})w(\\d{2})(\\d)|"
2443 "(\\d{2})(\\d{2})(?:(\\d{2})(?:[,.](\\d+))?)?"
2444 "(z|[-+]\\d{2}(?:\\d{2})?)?)?\\s*\\z";
2448 MATCH(
str, pat, iso8601_bas_datetime_cb);
2471 set_hash(
"sec_fraction", sec_fraction(s[4]));
2480#define iso8601_bas_time_cb iso8601_ext_time_cb
2485 static const char pat_source[] =
2486 "\\A\\s*(\\d{2}):(\\d{2})(?::(\\d{2})(?:[,.](\\d+))?"
2487 "(z|[-+]\\d{2}(:?\\d{2})?)?)?\\s*\\z";
2491 MATCH(
str, pat, iso8601_ext_time_cb);
2497 static const char pat_source[] =
2498 "\\A\\s*(\\d{2})(\\d{2})(?:(\\d{2})(?:[,.](\\d+))?"
2499 "(z|[-+]\\d{2}(\\d{2})?)?)?\\s*\\z";
2509 VALUE backref, hash;
2516 if (iso8601_ext_datetime(
str, hash))
2518 if (iso8601_bas_datetime(
str, hash))
2520 if (iso8601_ext_time(
str, hash))
2522 if (iso8601_bas_time(
str, hash))
2555 set_hash(
"sec_fraction", sec_fraction(s[7]));
2563 static const char pat_source[] =
2564 "\\A\\s*(-?\\d{4})-(\\d{2})-(\\d{2})"
2566 "(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?"
2567 "(z|[-+]\\d{2}:\\d{2})\\s*\\z";
2577 VALUE backref, hash;
2615 set_hash(
"sec_fraction", sec_fraction(s[7]));
2627 static const char pat_source[] =
2628 "\\A\\s*(-?\\d{4,})(?:-(\\d{2})(?:-(\\d{2}))?)?"
2630 "(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?)?"
2631 "(z|[-+]\\d{2}:\\d{2})?\\s*\\z";
2635 MATCH(
str, pat, xmlschema_datetime_cb);
2658 set_hash(
"sec_fraction", sec_fraction(s[4]));
2670 static const char pat_source[] =
2671 "\\A\\s*(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?"
2672 "(z|[-+]\\d{2}:\\d{2})?\\s*\\z";
2676 MATCH(
str, pat, xmlschema_time_cb);
2711 static const char pat_source[] =
2712 "\\A\\s*(?:--(\\d{2})(?:-(\\d{2}))?|---(\\d{2}))"
2713 "(z|[-+]\\d{2}:\\d{2})?\\s*\\z";
2717 MATCH(
str, pat, xmlschema_trunc_cb);
2723 VALUE backref, hash;
2730 if (xmlschema_datetime(
str, hash))
2732 if (xmlschema_time(
str, hash))
2734 if (xmlschema_trunc(
str, hash))
2780 static const char pat_source[] =
2785 "(\\d{2}):(\\d{2})(?::(\\d{2}))?\\s*"
2786 "([-+]\\d{4}|ut|gmt|e[sd]t|c[sd]t|m[sd]t|p[sd]t|[a-ik-z])\\s*\\z";
2796 VALUE backref, hash;
2838 static const char pat_source[] =
2843 "(\\d{2}):(\\d{2}):(\\d{2})\\s+"
2848 MATCH(
str, pat, httpdate_type1_cb);
2885 static const char pat_source[] =
2886 "\\A\\s*(" DAYS ")\\s*,\\s+"
2890 "(\\d{2}):(\\d{2}):(\\d{2})\\s+"
2895 MATCH(
str, pat, httpdate_type2_cb);
2927 static const char pat_source[] =
2931 "(\\d{2}):(\\d{2}):(\\d{2})\\s+"
2936 MATCH(
str, pat, httpdate_type3_cb);
2942 VALUE backref, hash;
2949 if (httpdate_type1(
str, hash))
2951 if (httpdate_type2(
str, hash))
2953 if (httpdate_type3(
str, hash))
2990 set_hash(
"sec_fraction", sec_fraction(s[8]));
3002 static const char pat_source[] =
3005 "(?:(\\d{2}):(\\d{2})(?::(\\d{2})(?:[,.](\\d*))?)?"
3006 "(z|[-+]\\d{2}(?::?\\d{2})?)?)?)?\\s*\\z";
3016 VALUE backref, hash;
3022 if (jisx0301(
str, hash))
VALUE date__iso8601(VALUE)
VALUE date__rfc3339(VALUE)
VALUE date__xmlschema(VALUE)
VALUE date__parse(VALUE str, VALUE comp)
VALUE date__jisx0301(VALUE)
VALUE date__httpdate(VALUE)
VALUE date__rfc2822(VALUE)
#define f_gsub_bang(s, r, x)
RUBY_EXTERN VALUE rb_int_positive_pow(long x, unsigned long y)
#define JISX0301_ERA_INITIALS
RUBY_EXTERN unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow)
#define JISX0301_DEFAULT_ERA
#define iso8601_bas_time_cb
#define f_aset2(o, i, j, v)
VALUE date_zone_to_diff(VALUE str)
char str[HTML_ESCAPE_MAX_LEN+1]
unsigned char buf[MIME_BUF_SIZE]
const struct zone * zonetab(register const char *str, register size_t len)