summaryrefslogtreecommitdiffstats
path: root/Source/cmFunctionBlocker.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-21 14:48:20 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-21 14:48:20 (GMT)
commitbca1026250c5d2006a3829662b736660982e3a33 (patch)
treec403de025adbc273eb3ebe1f30b36ae849d72a43 /Source/cmFunctionBlocker.h
parentb8f5a934ecb83f0124be8485708d4d6d763682fd (diff)
downloadCMake-bca1026250c5d2006a3829662b736660982e3a33.zip
CMake-bca1026250c5d2006a3829662b736660982e3a33.tar.gz
CMake-bca1026250c5d2006a3829662b736660982e3a33.tar.bz2
ENH: Better error message for unclosed blocks
This centralizes construction of the error message for an unclosed logical block (if, foreach, etc.). We record the line at which each block is opened so it can be reported in the error message.
Diffstat (limited to 'Source/cmFunctionBlocker.h')
-rw-r--r--Source/cmFunctionBlocker.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h
index a169cc1..1433759 100644
--- a/Source/cmFunctionBlocker.h
+++ b/Source/cmFunctionBlocker.h
@@ -19,6 +19,7 @@
#include "cmStandardIncludes.h"
#include "cmExecutionStatus.h"
+#include "cmListFileCache.h"
class cmMakefile;
/** \class cmFunctionBlocker
@@ -43,14 +44,15 @@ public:
virtual bool ShouldRemove(const cmListFileFunction&,
cmMakefile&) {return false;}
- /**
- * When the end of a CMakeList file is reached this method is called. It
- * is not called on the end of an INCLUDE cmake file, just at the end of a
- * regular CMakeList file
- */
- virtual void ScopeEnded(cmMakefile&) {}
-
virtual ~cmFunctionBlocker() {}
+
+ /** Set/Get the context in which this blocker is created. */
+ void SetStartingContext(cmListFileContext const& lfc)
+ { this->StartingContext = lfc; }
+ cmListFileContext const& GetStartingContext()
+ { return this->StartingContext; }
+private:
+ cmListFileContext StartingContext;
};
#endif