зеркало из https://github.com/github/ruby.git
[ruby/date] Extracted common leading pattern
https://github.com/ruby/date/commit/ec86dbbdc1
This commit is contained in:
Родитель
c19a631c99
Коммит
9f59a2bd87
|
@ -652,24 +652,27 @@ parse_time(VALUE str, VALUE hash)
|
||||||
{
|
{
|
||||||
static const char pat_source[] =
|
static const char pat_source[] =
|
||||||
"("
|
"("
|
||||||
|
"\\d+\\s*"
|
||||||
"(?:"
|
"(?:"
|
||||||
"\\d+\\s*:\\s*\\d+"
|
|
||||||
"(?:"
|
"(?:"
|
||||||
|
":\\s*\\d+"
|
||||||
|
"(?:"
|
||||||
#ifndef TIGHT_PARSER
|
#ifndef TIGHT_PARSER
|
||||||
"\\s*:\\s*\\d+(?:[,.]\\d*)?"
|
"\\s*:\\s*\\d+(?:[,.]\\d*)?"
|
||||||
#else
|
#else
|
||||||
"\\s*:\\s*\\d+(?:[,.]\\d+)?"
|
"\\s*:\\s*\\d+(?:[,.]\\d+)?"
|
||||||
#endif
|
#endif
|
||||||
|
")?"
|
||||||
|
"|"
|
||||||
|
"h(?:\\s*\\d+m?(?:\\s*\\d+s?)?)?"
|
||||||
|
")"
|
||||||
|
"(?:"
|
||||||
|
"\\s*"
|
||||||
|
"[ap](?:m\\b|\\.m\\.)"
|
||||||
")?"
|
")?"
|
||||||
"|"
|
"|"
|
||||||
"\\d+\\s*h(?:\\s*\\d+m?(?:\\s*\\d+s?)?)?"
|
|
||||||
")"
|
|
||||||
"(?:"
|
|
||||||
"\\s*"
|
|
||||||
"[ap](?:m\\b|\\.m\\.)"
|
"[ap](?:m\\b|\\.m\\.)"
|
||||||
")?"
|
")"
|
||||||
"|"
|
|
||||||
"\\d+\\s*[ap](?:m\\b|\\.m\\.)"
|
|
||||||
")"
|
")"
|
||||||
"(?:"
|
"(?:"
|
||||||
"\\s*"
|
"\\s*"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче