summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionParser.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-03 22:34:03 (GMT)
committerBrad King <brad.king@kitware.com>2012-10-09 12:26:43 (GMT)
commitb3d8f5dab7f33dba4f327ab7ef4bd7ea90d6b651 (patch)
tree10345c74b3bc115a0115fd8489827ababbc07e4c /Source/cmGeneratorExpressionParser.cxx
parenta4985a9af9ed9762c1a51c369981609dd24f7425 (diff)
downloadCMake-b3d8f5dab7f33dba4f327ab7ef4bd7ea90d6b651.zip
CMake-b3d8f5dab7f33dba4f327ab7ef4bd7ea90d6b651.tar.gz
CMake-b3d8f5dab7f33dba4f327ab7ef4bd7ea90d6b651.tar.bz2
GenEx: Parse comma after colon tokens specially
Otherwise the comma is treated as plain text by ParseContent. $<STREQUAL:,> should be valid and true. $<STREQUAL:,something> should be valid and false. $<STREQUAL:,,> should be non-valid as it is 3 parameters. $<STREQUAL:something,,> should be non-valid as it is 3 parameters. Additionally, this allows reporting the correct error for other expressions. For example $<TARGET_PROPERTY:,> should be invalid because it has an empty target and empty property. It shouldn't attempt to read the property ',' on the 'implicit this' target.
Diffstat (limited to 'Source/cmGeneratorExpressionParser.cxx')
-rw-r--r--Source/cmGeneratorExpressionParser.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index 344e9f8..d95e1cc 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -118,10 +118,16 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
colonToken = this->it;
parameters.resize(parameters.size() + 1);
++this->it;
+ while (this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator)
+ {
+ commaTokens.push_back(this->it);
+ parameters.resize(parameters.size() + 1);
+ ++this->it;
+ }
while(this->it->TokenType != cmGeneratorExpressionToken::EndExpression)
{
this->ParseContent(*(parameters.end() - 1));
- if (this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator)
+ while (this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator)
{
commaTokens.push_back(this->it);
parameters.resize(parameters.size() + 1);