A3t
- Implemented ::findPlainArgs, for locating words that can be promoted to patterns.
This commit is contained in:
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 ()
|
||||
|
||||
Reference in New Issue
Block a user