CLI2: Removed obsolete ::categorize method

This commit is contained in:
Paul Beckingham 2015-06-19 12:35:04 -07:00
parent 3636de11c8
commit 4c55e7ef3d
2 changed files with 0 additions and 88 deletions

View file

@ -1054,91 +1054,6 @@ bool CLI2::findCommand ()
return false;
}
/*
////////////////////////////////////////////////////////////////////////////////
// TODO This method should further categorize args into whether or not they are
// extracted by ::getWords.
void CLI2::categorize ()
{
bool changes = false;
bool foundCommand = false;
bool readOnly = false;
bool terminated = false;
for (auto& a : _args)
{
std::string raw = a.attribute ("raw");
if (! terminated && raw == "--")
{
a.tag ("ORIGINAL");
a.tag ("TERMINATOR");
terminated = true;
changes = true;
continue;
}
else if (terminated)
{
a.tag ("ORIGINAL");
a.tag ("TERMINATED");
a.tag ("WORD");
changes = true;
}
if (raw.find (' ') != std::string::npos)
{
a.tag ("QUOTED");
changes = true;
}
std::string canonical;
if (! terminated &&
! foundCommand &&
canonicalize (canonical, "cmd", raw))
{
readOnly = ! exactMatch ("writecmd", canonical);
a.tag ("CMD");
a.tag (readOnly ? "READCMD" : "WRITECMD");
a.attribute ("canonical", canonical);
foundCommand = true;
changes = true;
}
else if (a.hasTag ("TERMINATOR") ||
a.hasTag ("BINARY") ||
a.hasTag ("CONFIG") ||
a.hasTag ("RC"))
{
// NOP
}
else if (foundCommand && ! readOnly)
{
a.tag ("MODIFICATION");
// If the argument contains a space, it was quoted. Record that.
if (! Lexer::isOneWord (raw))
a.tag ("QUOTED");
changes = true;
}
else if (!foundCommand || (foundCommand && readOnly))
{
a.tag ("FILTER");
// If the argument contains a space, it was quoted. Record that.
if (! Lexer::isOneWord (raw))
a.tag ("QUOTED");
changes = true;
}
}
if (changes &&
context.config.getInteger ("debug.parser") >= 3)
context.debug (dump ("CLI2::analyze categorize"));
}
*/
////////////////////////////////////////////////////////////////////////////////
// Search for exact 'value' in _entities category.
bool CLI2::exactMatch (

View file

@ -113,9 +113,6 @@ private:
void aliasExpansion ();
void findOverrides ();
bool findCommand ();
/*
void categorize ();
*/
bool exactMatch (const std::string&, const std::string&) const;
/*
void desugarFilterTags ();