mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
cmListFileCache: When missing ending ) print starting line instead of last one
Fixes: #19301
This commit is contained in:
committed by
Brad King
parent
187928875d
commit
3475e2728b
@@ -192,12 +192,9 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
|
||||
}
|
||||
|
||||
// Arguments.
|
||||
unsigned long lastLine;
|
||||
unsigned long parenDepth = 0;
|
||||
this->Separation = SeparationOkay;
|
||||
while (
|
||||
(static_cast<void>(lastLine = cmListFileLexer_GetCurrentLine(this->Lexer)),
|
||||
token = cmListFileLexer_Scan(this->Lexer))) {
|
||||
while ((token = cmListFileLexer_Scan(this->Lexer))) {
|
||||
if (token->type == cmListFileLexer_Token_Space ||
|
||||
token->type == cmListFileLexer_Token_Newline) {
|
||||
this->Separation = SeparationOkay;
|
||||
@@ -252,7 +249,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
|
||||
std::ostringstream error;
|
||||
cmListFileContext lfc;
|
||||
lfc.FilePath = this->FileName;
|
||||
lfc.Line = lastLine;
|
||||
lfc.Line = line;
|
||||
cmListFileBacktrace lfbt = this->Backtrace;
|
||||
lfbt = lfbt.Push(lfc);
|
||||
error << "Parse error. Function missing ending \")\". "
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CMake Error at UnterminatedCall1.cmake:2:
|
||||
CMake Error at UnterminatedCall1.cmake:1:
|
||||
Parse error. Function missing ending "\)". End of file reached.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
message(
|
||||
|
||||
|
||||
message("Additional message")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
CMake Error at UnterminatedCall2.cmake:4:
|
||||
CMake Error at UnterminatedCall2.cmake:3:
|
||||
Parse error. Function missing ending "\)". End of file reached.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
set(var "\
|
||||
")
|
||||
message(
|
||||
|
||||
|
||||
message("Additional message")
|
||||
|
||||
Reference in New Issue
Block a user