Merge topic 'syntax-unexpected-eof'
1dda2ec5 Improve error message on unexpected end of file
This commit is contained in:
commit
5b1f9cd127
@ -163,8 +163,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
|
|||||||
if (!token) {
|
if (!token) {
|
||||||
std::ostringstream error;
|
std::ostringstream error;
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
error << "Error in cmake code at\n" << this->FileName << ":"
|
error << "Unexpected end of file.\n"
|
||||||
<< cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
|
|
||||||
<< "Parse error. Function missing opening \"(\".";
|
<< "Parse error. Function missing opening \"(\".";
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
this->IssueError(error.str());
|
this->IssueError(error.str());
|
||||||
|
1
Tests/RunCMake/Syntax/CommandEOF-result.txt
Normal file
1
Tests/RunCMake/Syntax/CommandEOF-result.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
6
Tests/RunCMake/Syntax/CommandEOF-stderr.txt
Normal file
6
Tests/RunCMake/Syntax/CommandEOF-stderr.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
^CMake Error in CommandEOF.cmake:
|
||||||
|
Unexpected end of file.
|
||||||
|
|
||||||
|
Parse error. Function missing opening "\(".
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/CommandEOF.cmake
Normal file
1
Tests/RunCMake/Syntax/CommandEOF.cmake
Normal file
@ -0,0 +1 @@
|
|||||||
|
message
|
@ -17,6 +17,7 @@ run_cmake(CommandSpaces)
|
|||||||
run_cmake(CommandTabs)
|
run_cmake(CommandTabs)
|
||||||
run_cmake(CommandNewlines)
|
run_cmake(CommandNewlines)
|
||||||
run_cmake(CommandComments)
|
run_cmake(CommandComments)
|
||||||
|
run_cmake(CommandEOF)
|
||||||
run_cmake(CommandError0)
|
run_cmake(CommandError0)
|
||||||
run_cmake(CommandError1)
|
run_cmake(CommandError1)
|
||||||
run_cmake(CommandError2)
|
run_cmake(CommandError2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user