From 1a59f6deaf110cb21062f2c6bf32ef27a5d2635c Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 3 Mar 2019 12:24:37 +0100 Subject: Warning if no file specified for special reading commands Create a warning in case no `\include` or `\dontinclude` command has been given before using `\skip`, `\line`, `\skipline` or `\utnil` --- src/docparser.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/docparser.cpp b/src/docparser.cpp index f1ac262..ff253e5 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2048,6 +2048,29 @@ void DocInclude::parse() void DocIncOperator::parse() { + if (g_includeFileName.isEmpty()) + { + QCString cmd; + switch(type()) + { + case Line: + cmd = "\\line"; + break; + case SkipLine: + cmd = "\\skipLine"; + break; + case Skip: + cmd = "\\skip"; + break; + case Until: + cmd = "\\until"; + break; + } + warn_doc_error(g_fileName,doctokenizerYYlineno, + "No previous '\\include' or \\dontinclude' command for '%s' present", + cmd.data()); + } + m_includeFileName = g_includeFileName; const char *p = g_includeFileText; uint l = g_includeFileLength; -- cgit v0.12