- TW-1306 Arguments before 'add' are ignored.
This commit is contained in:
Paul Beckingham 2014-07-03 10:50:25 -04:00
parent d6e734b57d
commit e5834c8a4f
3 changed files with 23 additions and 0 deletions

View file

@ -178,6 +178,7 @@ Tree* Parser::parse ()
findIdSequence ();
findFilter ();
findModifications ();
findStrayModifications ();
findPlainArgs ();
findMissingOperators ();
@ -1426,6 +1427,26 @@ void Parser::findModifications ()
}
}
////////////////////////////////////////////////////////////////////////////////
void Parser::findStrayModifications ()
{
std::string command = getCommand ();
if (command == "add" ||
command == "log")
{
std::vector <Tree*>::iterator i;
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
{
if ((*i)->hasTag ("FILTER"))
{
(*i)->unTag ("FILTER");
(*i)->tag ("MODIFICATION");
(*i)->removeAllBranches ();
}
}
}
}
////////////////////////////////////////////////////////////////////////////////
// This is called after parsing. The intention is to find plain arguments that
// are not otherwise recognized, and potentially promote them to patterns.

View file

@ -75,6 +75,7 @@ private:
void findOperator ();
void findFilter ();
void findModifications ();
void findStrayModifications ();
void findPlainArgs ();
void findMissingOperators ();
bool insertOr ();