From 2355738c7a556ec14e8c76119146ee37100fcd17 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 13 Jul 2015 16:45:34 -0400 Subject: [PATCH] Duration: May also terminate on Lexer::singleCharOperator --- src/Duration.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Duration.cpp b/src/Duration.cpp index c94391e04..f3d8b9127 100644 --- a/src/Duration.cpp +++ b/src/Duration.cpp @@ -313,8 +313,9 @@ bool Duration::parse (const std::string& input, std::string::size_type& start) if (n.getOneOf (units, unit)) { - if (n.depleted () || - Lexer::isWhitespace (n.next ())) + if (n.depleted () || + Lexer::isWhitespace (n.next ()) || + Lexer::isSingleCharOperator (n.next ())) { start = original_start + n.cursor (); @@ -336,8 +337,9 @@ bool Duration::parse (const std::string& input, std::string::size_type& start) n.skipWS (); if (n.getOneOf (units, unit)) { - if (n.depleted () || - Lexer::isWhitespace (n.next ())) + if (n.depleted () || + Lexer::isWhitespace (n.next ()) || + Lexer::isSingleCharOperator (n.next ())) { start = original_start + n.cursor (); double quantity = strtod (number.c_str (), NULL);