Duration: May also terminate on Lexer::singleCharOperator

This commit is contained in:
Paul Beckingham 2015-07-13 16:45:34 -04:00
parent 1ec029be9b
commit 2355738c7a

View file

@ -314,7 +314,8 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
if (n.getOneOf (units, unit))
{
if (n.depleted () ||
Lexer::isWhitespace (n.next ()))
Lexer::isWhitespace (n.next ()) ||
Lexer::isSingleCharOperator (n.next ()))
{
start = original_start + n.cursor ();
@ -337,7 +338,8 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
if (n.getOneOf (units, unit))
{
if (n.depleted () ||
Lexer::isWhitespace (n.next ()))
Lexer::isWhitespace (n.next ()) ||
Lexer::isSingleCharOperator (n.next ()))
{
start = original_start + n.cursor ();
double quantity = strtod (number.c_str (), NULL);