Commit 1838b0ae authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Bartosz

cmListFileCache: When missing ending ) print starting line instead of last one

Fixed: #19301
parent 18792887
Pipeline #138287 passed with stage
......@@ -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 \")\". "
......
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\)
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\)
set(var "\
")
message(
message("Additional message")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment