mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-01-26 19:09:06 +00:00
cmArgumentParser: Drop unused parsedKeywords argument to Parse()
All clients have been ported to use a binding instead.
This commit is contained in:
parent
98cf623821
commit
2eba10c5ee
@ -83,9 +83,6 @@ void Instance::Consume(cm::string_view arg)
|
||||
if (it != this->Bindings.Keywords.end()) {
|
||||
this->FinishKeyword();
|
||||
this->Keyword = it->first;
|
||||
if (this->ParsedKeywords != nullptr) {
|
||||
this->ParsedKeywords->emplace_back(it->first);
|
||||
}
|
||||
if (this->Bindings.ParsedKeyword) {
|
||||
this->Bindings.ParsedKeyword(*this, it->first);
|
||||
}
|
||||
|
||||
@ -121,13 +121,10 @@ class Instance
|
||||
{
|
||||
public:
|
||||
Instance(ActionMap const& bindings, ParseResult* parseResult,
|
||||
std::vector<std::string>* unparsedArguments,
|
||||
std::vector<cm::string_view>* parsedKeywords,
|
||||
void* result = nullptr)
|
||||
std::vector<std::string>* unparsedArguments, void* result = nullptr)
|
||||
: Bindings(bindings)
|
||||
, ParseResults(parseResult)
|
||||
, UnparsedArguments(unparsedArguments)
|
||||
, ParsedKeywords(parsedKeywords)
|
||||
, Result(result)
|
||||
{
|
||||
}
|
||||
@ -162,7 +159,6 @@ private:
|
||||
ActionMap const& Bindings;
|
||||
ParseResult* ParseResults = nullptr;
|
||||
std::vector<std::string>* UnparsedArguments = nullptr;
|
||||
std::vector<cm::string_view>* ParsedKeywords = nullptr;
|
||||
void* Result = nullptr;
|
||||
|
||||
cm::string_view Keyword;
|
||||
@ -206,23 +202,22 @@ public:
|
||||
|
||||
template <typename Range>
|
||||
bool Parse(Result& result, Range const& args,
|
||||
std::vector<std::string>* unparsedArguments,
|
||||
std::vector<cm::string_view>* parsedKeywords = nullptr) const
|
||||
std::vector<std::string>* unparsedArguments) const
|
||||
{
|
||||
using ArgumentParser::AsParseResultPtr;
|
||||
ParseResult* parseResultPtr = AsParseResultPtr(result);
|
||||
Instance instance(this->Bindings, parseResultPtr, unparsedArguments,
|
||||
parsedKeywords, &result);
|
||||
&result);
|
||||
instance.Parse(args);
|
||||
return parseResultPtr ? static_cast<bool>(*parseResultPtr) : true;
|
||||
}
|
||||
|
||||
template <typename Range>
|
||||
Result Parse(Range const& args, std::vector<std::string>* unparsedArguments,
|
||||
std::vector<cm::string_view>* parsedKeywords = nullptr) const
|
||||
Result Parse(Range const& args,
|
||||
std::vector<std::string>* unparsedArguments) const
|
||||
{
|
||||
Result result;
|
||||
this->Parse(result, args, unparsedArguments, parsedKeywords);
|
||||
this->Parse(result, args, unparsedArguments);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
@ -246,13 +241,11 @@ public:
|
||||
}
|
||||
|
||||
template <typename Range>
|
||||
ParseResult Parse(
|
||||
Range const& args, std::vector<std::string>* unparsedArguments,
|
||||
std::vector<cm::string_view>* parsedKeywords = nullptr) const
|
||||
ParseResult Parse(Range const& args,
|
||||
std::vector<std::string>* unparsedArguments) const
|
||||
{
|
||||
ParseResult parseResult;
|
||||
Instance instance(this->Bindings, &parseResult, unparsedArguments,
|
||||
parsedKeywords);
|
||||
Instance instance(this->Bindings, &parseResult, unparsedArguments);
|
||||
instance.Parse(args);
|
||||
return parseResult;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user