ENH: Enforce logical blocks in functions/macros
This teaches function() and macro() to enforce matching logical blocks inside the recorded bodies. This makes the error message more specific.
This commit is contained in:
parent
1dcc5b4558
commit
919fdb7f27
|
@ -104,6 +104,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
|
||||||
}
|
}
|
||||||
|
|
||||||
// we push a scope on the makefile
|
// we push a scope on the makefile
|
||||||
|
cmMakefile::LexicalPushPop lexScope(this->Makefile);
|
||||||
cmMakefile::ScopePushPop varScope(this->Makefile);
|
cmMakefile::ScopePushPop varScope(this->Makefile);
|
||||||
static_cast<void>(varScope);
|
static_cast<void>(varScope);
|
||||||
|
|
||||||
|
@ -163,6 +164,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
|
||||||
{
|
{
|
||||||
// The error message should have already included the call stack
|
// The error message should have already included the call stack
|
||||||
// so we do not need to report an error here.
|
// so we do not need to report an error here.
|
||||||
|
lexScope.Quiet();
|
||||||
inStatus.SetNestedError(true);
|
inStatus.SetNestedError(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,6 +107,9 @@ bool cmMacroHelperCommand::InvokeInitialPass
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enforce matching logical blocks inside the macro.
|
||||||
|
cmMakefile::LexicalPushPop lexScope(this->Makefile);
|
||||||
|
|
||||||
// set the value of argc
|
// set the value of argc
|
||||||
cmOStringStream argcDefStream;
|
cmOStringStream argcDefStream;
|
||||||
argcDefStream << expandedArgs.size();
|
argcDefStream << expandedArgs.size();
|
||||||
|
@ -215,6 +218,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
|
||||||
{
|
{
|
||||||
// The error message should have already included the call stack
|
// The error message should have already included the call stack
|
||||||
// so we do not need to report an error here.
|
// so we do not need to report an error here.
|
||||||
|
lexScope.Quiet();
|
||||||
inStatus.SetNestedError(true);
|
inStatus.SetNestedError(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue