summaryrefslogtreecommitdiff
path: root/ext/date/date_parse.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 05:47:32 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-03 05:47:32 +0000
commitd55aa2bf6757d494f2c2da42a0be13e34de7da0c (patch)
tree2caa0e605ad66fed68856e42e8828165e8210d1d /ext/date/date_parse.c
parent6bc138b0525d08a62f5d597bc75af66b2176843d (diff)
* ext/date/date_parse.c (date__parse): revised the tight parser.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date/date_parse.c')
-rw-r--r--ext/date/date_parse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 7ac9e79..f431252 100644
--- a/ext/date/date_parse.c
+++ b/ext/date/date_parse.c
@@ -224,9 +224,9 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
#define ABBR_MONTHS "jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec"
#ifdef TIGHT_PARSER
-#define VALID_DAYS "(?:" DAYS ")\\b" "|(?:tues|wednes|thur|thurs|" ABBR_DAYS ")\\b\\.?"
-#define VALID_MONTHS "(?:" MONTHS ")\\b" "|(?:sept|" ABBR_MONTHS ")\\b\\.?"
-#define DOTLESS_VALID_MONTHS "(?:" MONTHS ")\\b" "|(?:sept|" ABBR_MONTHS ")\\b"
+#define VALID_DAYS "(?:" DAYS ")" "|(?:tues|wednes|thurs|thur|" ABBR_DAYS ")\\.?"
+#define VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")\\.?"
+#define DOTLESS_VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")"
#define BOS "\\A\\s*"
#define FPW "\\027"
#define FPT "\\024"
@@ -804,7 +804,7 @@ parse_eu(VALUE str, VALUE hash)
#ifndef TIGHT_PARSER
"'?(\\d+)[^-\\d\\s]*"
#else
- "(\\d+)(?:st|nd|rd|th)?\\b"
+ "(\\d+)(?:(?:st|nd|rd|th)\\b)?"
#endif
"\\s*"
#ifndef TIGHT_PARSER
@@ -881,7 +881,7 @@ parse_us(VALUE str, VALUE hash)
#ifndef TIGHT_PARSER
"('?\\d+)[^-\\d\\s']*"
#else
- "(\\d+)(?:st|nd|rd|th)?\\b"
+ "(\\d+)(?:(?:st|nd|rd|th)\\b)?"
COM_FPT
#endif
"(?:"