From 4c55e7ef3d091aa6e69a426c05663dca8a6b5bc7 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 19 Jun 2015 12:35:04 -0700 Subject: [PATCH] CLI2: Removed obsolete ::categorize method --- src/CLI2.cpp | 85 ---------------------------------------------------- src/CLI2.h | 3 -- 2 files changed, 88 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 5f49efdd1..6046bf0bb 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -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 ( diff --git a/src/CLI2.h b/src/CLI2.h index 5f6950c38..9745f0742 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -113,9 +113,6 @@ private: void aliasExpansion (); void findOverrides (); bool findCommand (); -/* - void categorize (); -*/ bool exactMatch (const std::string&, const std::string&) const; /* void desugarFilterTags ();