mirror of
https://github.com/reactos/CMake.git
synced 2024-12-01 07:20:22 +00:00
Genex: Extract a method to parse parameters.
This commit is contained in:
parent
e574852120
commit
ee96dc7686
@ -677,6 +677,23 @@ std::string GeneratorExpressionContent::Evaluate(
|
||||
}
|
||||
|
||||
std::vector<std::string> parameters;
|
||||
this->EvaluateParameters(node, identifier, context, dagChecker, parameters);
|
||||
if (context->HadError)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
return node->Evaluate(parameters, context, this, dagChecker);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string GeneratorExpressionContent::EvaluateParameters(
|
||||
const cmGeneratorExpressionNode *node,
|
||||
const std::string &identifier,
|
||||
cmGeneratorExpressionContext *context,
|
||||
cmGeneratorExpressionDAGChecker *dagChecker,
|
||||
std::vector<std::string> ¶meters) const
|
||||
{
|
||||
{
|
||||
std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
|
||||
pit = this->ParamChildren.begin();
|
||||
@ -732,10 +749,8 @@ std::string GeneratorExpressionContent::Evaluate(
|
||||
{
|
||||
reportError(context, this->GetOriginalExpression(), "$<" + identifier
|
||||
+ "> expression requires at least one parameter.");
|
||||
return std::string();
|
||||
}
|
||||
|
||||
return node->Evaluate(parameters, context, this, dagChecker);
|
||||
return std::string();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -33,6 +33,7 @@ struct cmGeneratorExpressionContext
|
||||
};
|
||||
|
||||
struct cmGeneratorExpressionDAGChecker;
|
||||
struct cmGeneratorExpressionNode;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
struct cmGeneratorExpressionEvaluator
|
||||
@ -117,6 +118,13 @@ struct GeneratorExpressionContent : public cmGeneratorExpressionEvaluator
|
||||
|
||||
~GeneratorExpressionContent();
|
||||
|
||||
private:
|
||||
std::string EvaluateParameters(const cmGeneratorExpressionNode *node,
|
||||
const std::string &identifier,
|
||||
cmGeneratorExpressionContext *context,
|
||||
cmGeneratorExpressionDAGChecker *dagChecker,
|
||||
std::vector<std::string> ¶meters) const;
|
||||
|
||||
private:
|
||||
std::vector<cmGeneratorExpressionEvaluator*> IdentifierChildren;
|
||||
std::vector<std::vector<cmGeneratorExpressionEvaluator*> > ParamChildren;
|
||||
|
Loading…
Reference in New Issue
Block a user