Merge topic 'cmake-syntax-recorded-brackets'
b54dbeb
Test foreach/function/macro handling of bracket argumentsccdf7e0
macro: Do not substitute for placeholders in bracket arguments999abb9
macro: Add extra indentation to placeholder substitution code
This commit is contained in:
commit
a549b68d37
|
@ -140,6 +140,12 @@ bool cmMacroHelperCommand::InvokeInitialPass
|
|||
// Set the FilePath on the arguments to match the function since it is
|
||||
// not stored and the original values may be freed
|
||||
k->FilePath = this->FilePath.c_str();
|
||||
if(k->Delim == cmListFileArgument::Bracket)
|
||||
{
|
||||
arg.Value = k->Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmps = k->Value;
|
||||
// replace formal arguments
|
||||
for (unsigned int j = 1; j < this->Args.size(); ++j)
|
||||
|
@ -160,7 +166,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
|
|||
{
|
||||
std::vector<std::string>::const_iterator eit;
|
||||
std::vector<std::string>::size_type cnt = 0;
|
||||
for ( eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit )
|
||||
for(eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit)
|
||||
{
|
||||
if ( cnt >= this->Args.size()-1 )
|
||||
{
|
||||
|
@ -187,7 +193,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
|
|||
if (!argvDefInitialized)
|
||||
{
|
||||
std::vector<std::string>::const_iterator eit;
|
||||
for ( eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit )
|
||||
for(eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit)
|
||||
{
|
||||
if ( argvDef.size() > 0 )
|
||||
{
|
||||
|
@ -209,6 +215,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
|
|||
}
|
||||
|
||||
arg.Value = tmps;
|
||||
}
|
||||
arg.Delim = k->Delim;
|
||||
arg.FilePath = k->FilePath;
|
||||
arg.Line = k->Line;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
^\${x}:a
|
||||
\${x}:b$
|
|
@ -0,0 +1,3 @@
|
|||
foreach(x a b)
|
||||
message([[${x}:]] "${x}")
|
||||
endforeach()
|
|
@ -0,0 +1,2 @@
|
|||
^\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:a,n,2,a;n,a,n,
|
||||
\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:b,n,2,b;n,b,n,$
|
|
@ -0,0 +1,6 @@
|
|||
function(fun x)
|
||||
message([[${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}:]]
|
||||
"${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}")
|
||||
endfunction(fun)
|
||||
fun(a n)
|
||||
fun(b n)
|
|
@ -0,0 +1,2 @@
|
|||
^\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:a,n,2,a;n,a,n,
|
||||
\${x},\${ARGN},\${ARGC},\${ARGV},\${ARGV0},\${ARGV1},\${ARGV2}:b,n,2,b;n,b,n,$
|
|
@ -0,0 +1,6 @@
|
|||
macro(mac x)
|
||||
message([[${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}:]]
|
||||
"${x},${ARGN},${ARGC},${ARGV},${ARGV0},${ARGV1},${ARGV2}")
|
||||
endmacro(mac)
|
||||
mac(a n)
|
||||
mac(b n)
|
|
@ -12,6 +12,9 @@ run_cmake(CommandComments)
|
|||
run_cmake(CommandError0)
|
||||
run_cmake(CommandError1)
|
||||
run_cmake(CommandError2)
|
||||
run_cmake(ForEachBracket1)
|
||||
run_cmake(FunctionBracket1)
|
||||
run_cmake(MacroBracket1)
|
||||
run_cmake(String0)
|
||||
run_cmake(String1)
|
||||
run_cmake(StringBackslash)
|
||||
|
|
Loading…
Reference in New Issue