mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
A3t
- Implemented ::findPlainArgs, for locating words that can be promoted to patterns.
This commit is contained in:
parent
07a1f9d6b5
commit
fa2af30857
2 changed files with 20 additions and 0 deletions
19
src/A3t.cpp
19
src/A3t.cpp
|
@ -148,6 +148,8 @@ Tree* A3t::parse ()
|
|||
findFilter ();
|
||||
findModifications ();
|
||||
|
||||
findPlainArgs ();
|
||||
|
||||
validate ();
|
||||
|
||||
return _tree;
|
||||
|
@ -1184,6 +1186,23 @@ void A3t::findModifications ()
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// This is a called after parsing. The intention is to find plain arguments that
|
||||
// are not otherwise recognized, and potentially promote them to patterns.
|
||||
void A3t::findPlainArgs ()
|
||||
{
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||
{
|
||||
if ((*i)->hasTag ("FILTER") &&
|
||||
(*i)->hasTag ("ORIGINAL") && // TODO Wrong, can come in through alias/filter
|
||||
(*i)->countTags () == 2)
|
||||
{
|
||||
std::cout << "# plain arg '" << (*i)->attribute ("raw") << "'\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Validate the parse tree.
|
||||
void A3t::validate ()
|
||||
|
|
|
@ -71,6 +71,7 @@ private:
|
|||
void findOperator ();
|
||||
void findFilter ();
|
||||
void findModifications ();
|
||||
void findPlainArgs ();
|
||||
void validate ();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue