mirror of
https://github.com/reactos/CMake.git
synced 2024-12-03 00:57:25 +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;
|
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
|
std::vector<std::vector<cmGeneratorExpressionEvaluator*> >::const_iterator
|
||||||
pit = this->ParamChildren.begin();
|
pit = this->ParamChildren.begin();
|
||||||
@ -732,10 +749,8 @@ std::string GeneratorExpressionContent::Evaluate(
|
|||||||
{
|
{
|
||||||
reportError(context, this->GetOriginalExpression(), "$<" + identifier
|
reportError(context, this->GetOriginalExpression(), "$<" + identifier
|
||||||
+ "> expression requires at least one parameter.");
|
+ "> expression requires at least one parameter.");
|
||||||
return std::string();
|
|
||||||
}
|
}
|
||||||
|
return std::string();
|
||||||
return node->Evaluate(parameters, context, this, dagChecker);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -33,6 +33,7 @@ struct cmGeneratorExpressionContext
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct cmGeneratorExpressionDAGChecker;
|
struct cmGeneratorExpressionDAGChecker;
|
||||||
|
struct cmGeneratorExpressionNode;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
struct cmGeneratorExpressionEvaluator
|
struct cmGeneratorExpressionEvaluator
|
||||||
@ -117,6 +118,13 @@ struct GeneratorExpressionContent : public cmGeneratorExpressionEvaluator
|
|||||||
|
|
||||||
~GeneratorExpressionContent();
|
~GeneratorExpressionContent();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string EvaluateParameters(const cmGeneratorExpressionNode *node,
|
||||||
|
const std::string &identifier,
|
||||||
|
cmGeneratorExpressionContext *context,
|
||||||
|
cmGeneratorExpressionDAGChecker *dagChecker,
|
||||||
|
std::vector<std::string> ¶meters) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<cmGeneratorExpressionEvaluator*> IdentifierChildren;
|
std::vector<cmGeneratorExpressionEvaluator*> IdentifierChildren;
|
||||||
std::vector<std::vector<cmGeneratorExpressionEvaluator*> > ParamChildren;
|
std::vector<std::vector<cmGeneratorExpressionEvaluator*> > ParamChildren;
|
||||||
|
Loading…
Reference in New Issue
Block a user