summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionParser.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-12 14:51:16 (GMT)
committerBrad King <brad.king@kitware.com>2012-10-17 20:20:42 (GMT)
commite2d141d47410ad17ba2b63fd32a61cead8a50606 (patch)
tree7526b8844569f889bbbe64541e32eeb05f86c25c /Source/cmGeneratorExpressionParser.cxx
parent7aa99270fa77a13e8e710adc0098385403d6cf7a (diff)
downloadCMake-e2d141d47410ad17ba2b63fd32a61cead8a50606.zip
CMake-e2d141d47410ad17ba2b63fd32a61cead8a50606.tar.gz
CMake-e2d141d47410ad17ba2b63fd32a61cead8a50606.tar.bz2
GenEx: Parse colon after arguments separator colon specially.
The rationale is similar to that in commit b3d8f5da (GenEx: Parse comma after colon tokens specially, 2012-10-04), in that colon tokens should not be parsed as identifier-argument delimiters after the first colon.
Diffstat (limited to 'Source/cmGeneratorExpressionParser.cxx')
-rw-r--r--Source/cmGeneratorExpressionParser.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index d95e1cc..d09e412 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -14,6 +14,8 @@
#include "cmGeneratorExpressionEvaluator.h"
+#include "assert.h"
+
//----------------------------------------------------------------------------
cmGeneratorExpressionParser::cmGeneratorExpressionParser(
const std::vector<cmGeneratorExpressionToken> &tokens)
@@ -124,6 +126,11 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
parameters.resize(parameters.size() + 1);
++this->it;
}
+ while (this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
+ {
+ extendText(*(parameters.end() - 1), this->it);
+ ++this->it;
+ }
while(this->it->TokenType != cmGeneratorExpressionToken::EndExpression)
{
this->ParseContent(*(parameters.end() - 1));
@@ -133,7 +140,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
parameters.resize(parameters.size() + 1);
++this->it;
}
- if (this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
+ while (this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
{
extendText(*(parameters.end() - 1), this->it);
++this->it;
@@ -233,7 +240,7 @@ void cmGeneratorExpressionParser::ParseContent(
}
else
{
- // TODO: Unreachable. Assert?
+ assert(!"Got unexpected syntax token.");
}
++this->it;
return;