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:
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;
|
||||
}
|
||||
|
||||
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 operator.
|
||||
// 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;
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
output.push_back (Arg (s, Arg::cat_op));
|
||||
@@ -1662,10 +1662,8 @@ bool A3::is_tag (Nibbler& n, std::string& result)
|
||||
|
||||
if (n.skipAllOneOf ("+-"))
|
||||
{
|
||||
n.skipAllOneOf ("@#");
|
||||
|
||||
std::string name;
|
||||
if (n.getName (name) &&
|
||||
if (n.getUntilOneOf (" \t()+-*/", name) &&
|
||||
name.length ())
|
||||
{
|
||||
std::string::size_type end = n.cursor ();
|
||||
|
||||
Reference in New Issue
Block a user