cmListFileArgument: Generalize 'Quoted' bool to 'Delimeter' enum

Replace the boolean value that indicates whether an argument is unquoted
or quoted with a generalized enumeration of possible argument types.
For now "Quoted" and "Unquoted" remain the only types.
This commit is contained in:
Brad King
2012-08-06 10:07:58 -04:00
parent 28685ade7a
commit 0546484e4b
7 changed files with 38 additions and 26 deletions
+10 -9
View File
@@ -196,7 +196,8 @@ bool cmListFile::ParseFile(const char* filename,
{
cmListFileFunction project;
project.Name = "PROJECT";
cmListFileArgument prj("Project", false, filename, 0);
cmListFileArgument prj("Project", cmListFileArgument::Unquoted,
filename, 0);
project.Arguments.push_back(prj);
this->Functions.insert(this->Functions.begin(),project);
}
@@ -243,8 +244,8 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
if(token->type == cmListFileLexer_Token_ParenLeft)
{
parenDepth++;
cmListFileArgument a("(",
false, filename, token->line);
cmListFileArgument a("(", cmListFileArgument::Unquoted,
filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_ParenRight)
@@ -254,21 +255,21 @@ bool cmListFileCacheParseFunction(cmListFileLexer* lexer,
return true;
}
parenDepth--;
cmListFileArgument a(")",
false, filename, token->line);
cmListFileArgument a(")", cmListFileArgument::Unquoted,
filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_Identifier ||
token->type == cmListFileLexer_Token_ArgumentUnquoted)
{
cmListFileArgument a(token->text,
false, filename, token->line);
cmListFileArgument a(token->text, cmListFileArgument::Unquoted,
filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type == cmListFileLexer_Token_ArgumentQuoted)
{
cmListFileArgument a(token->text,
true, filename, token->line);
cmListFileArgument a(token->text, cmListFileArgument::Quoted,
filename, token->line);
function.Arguments.push_back(a);
}
else if(token->type != cmListFileLexer_Token_Newline)