mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
A3 Parsing
- Durations now parse at higher precedence than operators, so that durations like '-3d' are not parsed as '-' '3d'.
This commit is contained in:
parent
3e58453693
commit
5a95b96631
1 changed files with 14 additions and 14 deletions
28
src/A3.cpp
28
src/A3.cpp
|
@ -715,6 +715,20 @@ const A3 A3::tokenize (const A3& input) const
|
|||
found_something_after_sequence = true;
|
||||
}
|
||||
|
||||
else if (n.getDate (date_format, t))
|
||||
{
|
||||
output.push_back (Arg (Date (t).toString (date_format), "date"));
|
||||
if (found_sequence)
|
||||
found_something_after_sequence = true;
|
||||
}
|
||||
|
||||
else if (is_duration (n, s))
|
||||
{
|
||||
output.push_back (Arg (s, "duration"));
|
||||
if (found_sequence)
|
||||
found_something_after_sequence = true;
|
||||
}
|
||||
|
||||
else if (n.getOneOf (operators, s))
|
||||
{
|
||||
output.push_back (Arg (s, "op"));
|
||||
|
@ -759,20 +773,6 @@ const A3 A3::tokenize (const A3& input) const
|
|||
found_something_after_sequence = true;
|
||||
}
|
||||
|
||||
else if (n.getDate (date_format, t))
|
||||
{
|
||||
output.push_back (Arg (Date (t).toString (date_format), "date"));
|
||||
if (found_sequence)
|
||||
found_something_after_sequence = true;
|
||||
}
|
||||
|
||||
else if (is_duration (n, s))
|
||||
{
|
||||
output.push_back (Arg (s, "duration"));
|
||||
if (found_sequence)
|
||||
found_something_after_sequence = true;
|
||||
}
|
||||
|
||||
else if (is_id (n, s))
|
||||
{
|
||||
if (found_something_after_sequence)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue