1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
tadf 2012-11-03 05:47:32 +00:00
parent 6bc138b052
commit d55aa2bf67
2 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,7 @@
Sat Nov 3 14:46:15 2012 Tadayoshi Funaba <tadf@dotrb.org>
* ext/date/date_parse.c (date__parse): revised the tight parser.
Sat Nov 3 14:43:42 2012 Kouhei Sutou <kou@cozmixng.org> Sat Nov 3 14:43:42 2012 Kouhei Sutou <kou@cozmixng.org>
* lib/rexml/xmldecl.rb (REXML::XMLDecl#content): Add missing \A * lib/rexml/xmldecl.rb (REXML::XMLDecl#content): Add missing \A

View file

@ -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" #define ABBR_MONTHS "jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec"
#ifdef TIGHT_PARSER #ifdef TIGHT_PARSER
#define VALID_DAYS "(?:" DAYS ")\\b" "|(?:tues|wednes|thur|thurs|" ABBR_DAYS ")\\b\\.?" #define VALID_DAYS "(?:" DAYS ")" "|(?:tues|wednes|thurs|thur|" ABBR_DAYS ")\\.?"
#define VALID_MONTHS "(?:" MONTHS ")\\b" "|(?:sept|" ABBR_MONTHS ")\\b\\.?" #define VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")\\.?"
#define DOTLESS_VALID_MONTHS "(?:" MONTHS ")\\b" "|(?:sept|" ABBR_MONTHS ")\\b" #define DOTLESS_VALID_MONTHS "(?:" MONTHS ")" "|(?:sept|" ABBR_MONTHS ")"
#define BOS "\\A\\s*" #define BOS "\\A\\s*"
#define FPW "\\027" #define FPW "\\027"
#define FPT "\\024" #define FPT "\\024"
@ -804,7 +804,7 @@ parse_eu(VALUE str, VALUE hash)
#ifndef TIGHT_PARSER #ifndef TIGHT_PARSER
"'?(\\d+)[^-\\d\\s]*" "'?(\\d+)[^-\\d\\s]*"
#else #else
"(\\d+)(?:st|nd|rd|th)?\\b" "(\\d+)(?:(?:st|nd|rd|th)\\b)?"
#endif #endif
"\\s*" "\\s*"
#ifndef TIGHT_PARSER #ifndef TIGHT_PARSER
@ -881,7 +881,7 @@ parse_us(VALUE str, VALUE hash)
#ifndef TIGHT_PARSER #ifndef TIGHT_PARSER
"('?\\d+)[^-\\d\\s']*" "('?\\d+)[^-\\d\\s']*"
#else #else
"(\\d+)(?:st|nd|rd|th)?\\b" "(\\d+)(?:(?:st|nd|rd|th)\\b)?"
COM_FPT COM_FPT
#endif #endif
"(?:" "(?:"