summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/Syntax/BracketComment3.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-08-06 15:58:22 -0400
committerBrad King <brad.king@kitware.com>2013-10-17 09:07:00 -0400
commitdaa0f6f98df6e944a46a8dff13bb247cf7e301b1 (patch)
tree3125abd5ec16e69ab2019ae8c2c60c3fa5e00753 /Tests/RunCMake/Syntax/BracketComment3.cmake
parenta8c652342f0e4dcaf933ecb0ce164b44d4997ae4 (diff)
downloadcmake-daa0f6f98df6e944a46a8dff13bb247cf7e301b1.tar.gz
Add Lua-style long brackets and long comments to CMake language
Teach the CMake language parser to recognize Lua-style "long bracket" arguments. These start with two '[' separated by zero or more '=' characters e.g. "[[" or "[=[" or "[==[". They end with two ']' separated by the same number of '=' as the opening bracket. There is no nesting of brackets of the same level (number of '='). No escapes, variable expansion, or other processing is performed on the content between such brackets so they always represent exactly one argument. Also teach CMake to parse and ignore "long comment" syntax. A long comment starts with "#" immediately followed by an opening long bracket. It ends at the matching close long bracket. Teach the RunCMake.Syntax test to cover long bracket and long comment cases.
Diffstat (limited to 'Tests/RunCMake/Syntax/BracketComment3.cmake')
-rw-r--r--Tests/RunCMake/Syntax/BracketComment3.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/Syntax/BracketComment3.cmake b/Tests/RunCMake/Syntax/BracketComment3.cmake
new file mode 100644
index 0000000000..ffd03a9311
--- /dev/null
+++ b/Tests/RunCMake/Syntax/BracketComment3.cmake
@@ -0,0 +1,4 @@
+#[[Text on opening line
+message(FATAL_ERROR "This is commented out.")
+#]=]]
+message(STATUS "The above FATAL_ERROR did not occur.")