ENH: support parenthesis as arguments and in conditionals feature request #6191

This commit is contained in:
Ken Martin
2008-06-26 13:01:35 -04:00
parent d8e05b43a1
commit 19e891532a
11 changed files with 346 additions and 228 deletions

View File

@@ -242,11 +242,26 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
// Arguments.
unsigned long lastLine = cmListFileLexer_GetCurrentLine(lexer);
unsigned long parenDepth = 0;
while((token = cmListFileLexer_Scan(lexer)))
{
if(token->type == cmListFileLexer_Token_ParenRight)
if(token->type == cmListFileLexer_Token_ParenLeft)
{
return true;
parenDepth++;
cmListFileArgument a("(",
false, filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_ParenRight)
{
if (parenDepth == 0)
{
return true;
}
parenDepth--;
cmListFileArgument a(")",
false, filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_Identifier ||
token->type == cmListFileLexer_Token_ArgumentUnquoted)