mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-04 12:28:35 +02:00
Bug - Tag Recognition
- Lowered the precedence of tag detection so that dates and durations are recognized first. - Modified the allowable tokens for a tag to be almost anything.
This commit is contained in:
parent
8cd1efd609
commit
38c325d469
1 changed files with 8 additions and 10 deletions
18
src/A3.cpp
18
src/A3.cpp
|
@ -712,13 +712,6 @@ const A3 A3::tokenize (const A3& input) const
|
||||||
found_something_after_sequence = true;
|
found_something_after_sequence = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (is_tag (n, s))
|
|
||||||
{
|
|
||||||
output.push_back (Arg (s, Arg::cat_tag));
|
|
||||||
if (found_sequence)
|
|
||||||
found_something_after_sequence = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must be higher than number.
|
// Must be higher than number.
|
||||||
// Must be higher than operator.
|
// Must be higher than operator.
|
||||||
// Note that Nibbler::getDate does not read durations.
|
// Note that Nibbler::getDate does not read durations.
|
||||||
|
@ -738,6 +731,13 @@ const A3 A3::tokenize (const A3& input) const
|
||||||
found_something_after_sequence = true;
|
found_something_after_sequence = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (is_tag (n, s))
|
||||||
|
{
|
||||||
|
output.push_back (Arg (s, Arg::cat_tag));
|
||||||
|
if (found_sequence)
|
||||||
|
found_something_after_sequence = true;
|
||||||
|
}
|
||||||
|
|
||||||
else if (n.getOneOf (operators, s))
|
else if (n.getOneOf (operators, s))
|
||||||
{
|
{
|
||||||
output.push_back (Arg (s, Arg::cat_op));
|
output.push_back (Arg (s, Arg::cat_op));
|
||||||
|
@ -1662,10 +1662,8 @@ bool A3::is_tag (Nibbler& n, std::string& result)
|
||||||
|
|
||||||
if (n.skipAllOneOf ("+-"))
|
if (n.skipAllOneOf ("+-"))
|
||||||
{
|
{
|
||||||
n.skipAllOneOf ("@#");
|
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
if (n.getName (name) &&
|
if (n.getUntilOneOf (" \t()+-*/", name) &&
|
||||||
name.length ())
|
name.length ())
|
||||||
{
|
{
|
||||||
std::string::size_type end = n.cursor ();
|
std::string::size_type end = n.cursor ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue