File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1768,6 +1768,13 @@ class consumer
17681768 [&](char c) { (*this )(c); });
17691769 }
17701770
1771+ void eat_or (char a, char b)
1772+ {
1773+ if (it_ == end_ || (*it_ != a && *it_ != b))
1774+ on_error_ ();
1775+ ++it_;
1776+ }
1777+
17711778 int eat_digits (int len)
17721779 {
17731780 int val = 0 ;
@@ -2820,8 +2827,8 @@ class parser
28202827 std::string::iterator end)
28212828 {
28222829 return std::find_if (it, end, [](char c) {
2823- return !is_number (c) && c != ' T' && c != ' Z ' && c != ' : ' && c != ' - '
2824- && c != ' +' && c != ' .' ;
2830+ return !is_number (c) && c != ' T' && c != ' ' && c != ' Z ' && c != ' : '
2831+ && c != ' - ' && c != ' +' && c != ' .' ;
28252832 });
28262833 }
28272834
@@ -2890,7 +2897,7 @@ class parser
28902897 if (it == date_end)
28912898 return make_value (ldate);
28922899
2893- eat (' T' );
2900+ eat. eat_or (' T' , ' ' );
28942901
28952902 local_datetime ldt;
28962903 static_cast <local_date&>(ldt) = ldate;
@@ -3123,7 +3130,8 @@ class parser
31233130 if (it[4 ] != ' -' || it[7 ] != ' -' )
31243131 return {};
31253132
3126- if (len >= 19 && it[10 ] == ' T' && is_time (it + 11 , date_end))
3133+ if (len >= 19 && (it[10 ] == ' T' || it[10 ] == ' ' )
3134+ && is_time (it + 11 , date_end))
31273135 {
31283136 // datetime type
31293137 auto time_end = find_end_of_time (it + 11 , date_end);
You can’t perform that action at this time.
0 commit comments