From 0a4d11d3e17a23a0b20a2873b32fddfa56d8227e Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 3 Mar 2019 16:35:38 +0100 Subject: Minor refactoring --- src/docparser.cpp | 20 ++------------------ src/docparser.h | 13 ++++++++++++- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index ff253e5..8aae275 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2050,25 +2050,9 @@ 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()); + "No previous '\\include' or \\dontinclude' command for '\\%s' present", + typeAsString()); } m_includeFileName = g_includeFileName; diff --git a/src/docparser.h b/src/docparser.h index d36ed6c..0b8073c 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -607,11 +607,22 @@ class DocIncOperator : public DocNode enum Type { Line, SkipLine, Skip, Until }; DocIncOperator(DocNode *parent,Type t,const QCString &pat, const QCString &context,bool isExample,const QCString &exampleFile) : - m_type(t), m_pattern(pat), m_context(context), + m_type(t), m_pattern(pat), m_context(context), m_isFirst(FALSE), m_isLast(FALSE), m_isExample(isExample), m_exampleFile(exampleFile) { m_parent = parent; } Kind kind() const { return Kind_IncOperator; } Type type() const { return m_type; } + const char *typeAsString() const + { + switch(m_type) + { + case Line: return "line"; + case SkipLine: return "skipline"; + case Skip: return "skip"; + case Until: return "until"; + } + return ""; + } QCString text() const { return m_text; } QCString pattern() const { return m_pattern; } QCString context() const { return m_context; } -- cgit v0.12