summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-14 19:24:06 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-17 13:06:59 (GMT)
commit56457837e28de29d4f94b0cc9c47ef314d8f05e1 (patch)
tree89c9eb6855fab9b6b6169b8086c523a731367f38 /Tests
parent8f2b0c330706fe479fb0804b3526bf28503cd52a (diff)
downloadCMake-56457837e28de29d4f94b0cc9c47ef314d8f05e1.zip
CMake-56457837e28de29d4f94b0cc9c47ef314d8f05e1.tar.gz
CMake-56457837e28de29d4f94b0cc9c47ef314d8f05e1.tar.bz2
cmListFileLexer: Allow command names with one letter (#14181)
Teach the lexer to treat a single letter as an identifier instead of an unquoted argument. Outside of a command invocation, the parser treats an identifier as a command name and an unquoted argument as an error. Inside of a command invocation, the parser treats an identifier as an unquoted argument. Therefore this change to the lexer will make what was previously an error case work with no other behavioral change.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Syntax/OneLetter-stderr.txt1
-rw-r--r--Tests/RunCMake/Syntax/OneLetter.cmake7
-rw-r--r--Tests/RunCMake/Syntax/RunCMakeTest.cmake1
3 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/Syntax/OneLetter-stderr.txt b/Tests/RunCMake/Syntax/OneLetter-stderr.txt
new file mode 100644
index 0000000..87c01c7
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OneLetter-stderr.txt
@@ -0,0 +1 @@
+message
diff --git a/Tests/RunCMake/Syntax/OneLetter.cmake b/Tests/RunCMake/Syntax/OneLetter.cmake
new file mode 100644
index 0000000..3c341fa
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OneLetter.cmake
@@ -0,0 +1,7 @@
+function(f)
+ g(${ARGN})
+endfunction()
+macro(g)
+ message(${ARGN})
+endmacro()
+f(message)
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index 94963f3..2d87328 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -9,6 +9,7 @@ run_cmake(CommandError1)
run_cmake(String0)
run_cmake(String1)
run_cmake(StringNoSpace)
+run_cmake(OneLetter)
run_cmake(Unquoted0)
run_cmake(Unquoted1)
run_cmake(ParenNoSpace)