diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 62337ccd5..19eb66f26 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -695,74 +695,6 @@ const std::string CLI2::dump (const std::string& title) const return out.str (); } -/* -//////////////////////////////////////////////////////////////////////////////// -// Note: This seems silly - it's essentially performing a low-quality parse. But -// that is really all that is needed - to separate the args that need to -// be lexed from those that need to be left alone. -// -// Either the arg is appended to _original_args intact, or the lexemes are. -void CLI2::addArg (const std::string& arg) -{ - std::string raw = trim (arg); - - // Do not lex these constructs. - if (isTerminator (raw)) // -- - _terminated = true; - - // This is the case where the argument should not be lexed, which is when it - // is a single entity, and recognized. - if (_terminated || - isRCOverride (raw) || // rc: - isConfigOverride (raw) || // rc.: - isCommand (raw) || // - isTag (raw) || // [+-] - isUUIDList (raw) || // ,[uuid ...] - isUUID (raw) || // - isIDSequence (raw) || // [-][,[-] ...] - isID (raw) || // - isPattern (raw) || // ///[g] - isAttribute (raw) || // [.[~]]: - isOperator (raw)) // - { - _original_args.push_back (raw); - } - - // The argument may require lexing. Lex anyway, and analyze before comitting - // to that. - else - { - // Lex each remaining argument. The apply a series of disqualifying tests - // that cause the lexemes to be ignored, and the original arugment used - // intact. - std::string lexeme; - Lexer::Type type; - Lexer lex (raw); - lex.ambiguity (false); - - std::vector > lexemes; - while (lex.token (lexeme, type)) - lexemes.push_back (std::pair (lexeme, type)); - - if (disqualifyInsufficientTerms (lexemes) || - disqualifyNoOps (lexemes) || - disqualifyOnlyParenOps (lexemes) || - disqualifyFirstLastBinary (lexemes)) - { - _original_args.push_back (raw); - } - else - { - // How often have I said to you that when you have eliminated the - // impossible, whatever remains, however improbable, must be the truth? - for (auto& l : lexemes) - _original_args.push_back (l.first); - } - } -} -*/ - //////////////////////////////////////////////////////////////////////////////// void CLI2::aliasExpansion () { diff --git a/src/CLI2.h b/src/CLI2.h index b9d673099..d37cc3ca6 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -124,6 +124,7 @@ private: bool isUUIDList (const std::string&) const; + // These methods come up iwht reasons not to Lex a token. Probably no longer needed. bool disqualifyInsufficientTerms (const std::vector >&) const; bool disqualifyNoOps (const std::vector >&) const; bool disqualifyOnlyParenOps (const std::vector >&) const;