MCPcopy Create free account
hub / github.com/Kitware/CMake / AddArgument

Method AddArgument

Source/cmListFileCache.cxx:302–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
303 cmListFileArgument::Delimiter delim)
304{
305 this->FunctionArguments.emplace_back(
306 cm::string_view(token->text, token->length), delim, token->line);
307 if (this->Separation == SeparationOkay) {
308 return true;
309 }
310 bool isError = (this->Separation == SeparationError ||
311 delim == cmListFileArgument::Bracket);
312 cmListFileContext lfc;
313 lfc.FilePath = this->FileName;
314 lfc.Line = token->line;
315 cmListFileBacktrace lfbt = this->Backtrace;
316 lfbt = lfbt.Push(lfc);
317 auto msg =
318 cmStrCat("Syntax ", (isError ? "Error" : "Warning"),
319 " in cmake code at column ", token->column,
320 "\n"
321 "Argument not separated from preceding token by whitespace.");
322 if (isError) {
323 this->Messenger->IssueMessage(MessageType::FATAL_ERROR, msg, lfbt);
324 return false;
325 }
326 this->Messenger->IssueMessage(MessageType::AUTHOR_WARNING, msg, lfbt);
327 return true;
328}
329
330cm::optional<cmListFileContext> cmListFileParser::CheckNesting() const
331{

Callers 1

ParseFunctionMethod · 0.95

Calls 4

emplace_backMethod · 0.80
PushMethod · 0.80
cmStrCatFunction · 0.70
IssueMessageMethod · 0.45

Tested by

no test coverage detected