ISO8601d: ::parse_named now only considers the first token.
This commit is contained in:
@@ -240,9 +240,7 @@ bool ISO8601d::parse (
|
|||||||
// Check the values and determine time_t.
|
// Check the values and determine time_t.
|
||||||
if (validate ())
|
if (validate ())
|
||||||
{
|
{
|
||||||
// Record cursor position.
|
|
||||||
start = n.cursor ();
|
start = n.cursor ();
|
||||||
|
|
||||||
resolve ();
|
resolve ();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -259,9 +257,7 @@ bool ISO8601d::parse (
|
|||||||
// Check the values and determine time_t.
|
// Check the values and determine time_t.
|
||||||
if (validate ())
|
if (validate ())
|
||||||
{
|
{
|
||||||
// Record cursor position.
|
|
||||||
start = n.cursor ();
|
start = n.cursor ();
|
||||||
|
|
||||||
resolve ();
|
resolve ();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -590,17 +586,19 @@ bool ISO8601d::parse_formatted (Nibbler& n, const std::string& format)
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool ISO8601d::parse_named (Nibbler& n)
|
bool ISO8601d::parse_named (Nibbler& n)
|
||||||
{
|
{
|
||||||
Variant v;
|
n.save ();
|
||||||
if (namedDates (n.str ().substr (n.cursor ()), v))
|
std::string token;
|
||||||
|
if (n.getUntilWS (token))
|
||||||
{
|
{
|
||||||
// Advance n by the length of the found item.
|
Variant v;
|
||||||
std::string dummy;
|
if (namedDates (token, v))
|
||||||
n.getUntilEOS (dummy);
|
{
|
||||||
|
_date = v.get_date ();
|
||||||
_date = v.get_date ();
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n.restore ();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user