mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Duration: May also terminate on Lexer::singleCharOperator
This commit is contained in:
parent
1ec029be9b
commit
2355738c7a
1 changed files with 6 additions and 4 deletions
|
@ -313,8 +313,9 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
|
||||||
|
|
||||||
if (n.getOneOf (units, unit))
|
if (n.getOneOf (units, unit))
|
||||||
{
|
{
|
||||||
if (n.depleted () ||
|
if (n.depleted () ||
|
||||||
Lexer::isWhitespace (n.next ()))
|
Lexer::isWhitespace (n.next ()) ||
|
||||||
|
Lexer::isSingleCharOperator (n.next ()))
|
||||||
{
|
{
|
||||||
start = original_start + n.cursor ();
|
start = original_start + n.cursor ();
|
||||||
|
|
||||||
|
@ -336,8 +337,9 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
|
||||||
n.skipWS ();
|
n.skipWS ();
|
||||||
if (n.getOneOf (units, unit))
|
if (n.getOneOf (units, unit))
|
||||||
{
|
{
|
||||||
if (n.depleted () ||
|
if (n.depleted () ||
|
||||||
Lexer::isWhitespace (n.next ()))
|
Lexer::isWhitespace (n.next ()) ||
|
||||||
|
Lexer::isSingleCharOperator (n.next ()))
|
||||||
{
|
{
|
||||||
start = original_start + n.cursor ();
|
start = original_start + n.cursor ();
|
||||||
double quantity = strtod (number.c_str (), NULL);
|
double quantity = strtod (number.c_str (), NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue