diff options
author | Brad King <brad.king@kitware.com> | 2009-01-21 14:49:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-01-21 14:49:31 (GMT) |
commit | 919fdb7f2759d6001db475635b47a6911f700c0d (patch) | |
tree | 9d23be4a4723cdc25d117e03149903465ee54295 /Source | |
parent | 1dcc5b455829db89f0d931cd57c12e0e247c0f44 (diff) | |
download | CMake-919fdb7f2759d6001db475635b47a6911f700c0d.zip CMake-919fdb7f2759d6001db475635b47a6911f700c0d.tar.gz CMake-919fdb7f2759d6001db475635b47a6911f700c0d.tar.bz2 |
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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFunctionCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmMacroCommand.cxx | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 04d8428..2b5223b 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -104,6 +104,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass } // we push a scope on the makefile + cmMakefile::LexicalPushPop lexScope(this->Makefile); cmMakefile::ScopePushPop varScope(this->Makefile); static_cast<void>(varScope); @@ -163,6 +164,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass { // The error message should have already included the call stack // so we do not need to report an error here. + lexScope.Quiet(); inStatus.SetNestedError(true); return false; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 0a7d0dc..9cc2653 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -107,6 +107,9 @@ bool cmMacroHelperCommand::InvokeInitialPass return false; } + // Enforce matching logical blocks inside the macro. + cmMakefile::LexicalPushPop lexScope(this->Makefile); + // set the value of argc cmOStringStream argcDefStream; argcDefStream << expandedArgs.size(); @@ -215,6 +218,7 @@ bool cmMacroHelperCommand::InvokeInitialPass { // The error message should have already included the call stack // so we do not need to report an error here. + lexScope.Quiet(); inStatus.SetNestedError(true); return false; } |