summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-11-06 11:37:28 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-11-06 11:37:28 (GMT)
commit03fb8168b060f33fe6011604fb4b08549df36865 (patch)
tree83f6d994b87934d0154a7eb4181539fea85c6587 /src
parent0a1a216ceed4be17ab3bf2a80be3be1bae21efeb (diff)
downloadDoxygen-03fb8168b060f33fe6011604fb4b08549df36865.zip
Doxygen-03fb8168b060f33fe6011604fb4b08549df36865.tar.gz
Doxygen-03fb8168b060f33fe6011604fb4b08549df36865.tar.bz2
Better warning message in case of illegal command
When having a problem like: ``` /** \file * * \link Something \see nothing2 \endlink * * \link Something @see nothing3 \endlink */ ``` We will get a.o. the warnings: ``` .../aa.h:3: warning: Illegal command see as part of a \link .../aa.h:5: warning: Illegal command see as part of a \link ``` it is not clear what the problem is. With this patch we get a little bit clearer warning: ``` .../aa.h:3: warning: Illegal command \see as part of a \link .../aa.h:5: warning: Illegal command @see as part of a \link ```
Diffstat (limited to 'src')
-rw-r--r--src/docparser.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index a22087e..568f7ed 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -803,14 +803,15 @@ static bool findDocsForMemberOrCompound(const char *commandName,
inline void errorHandleDefaultToken(DocNode *parent,int tok,
QList<DocNode> &children,const char *txt)
{
+ char *cmd_start = "\\";
switch (tok)
{
case TK_COMMAND_AT:
- // fall through
+ cmd_start = "@";
case TK_COMMAND_BS:
children.append(new DocWord(parent,TK_COMMAND_CHAR(tok) + g_token->name));
warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a %s",
- qPrint(TK_COMMAND_CHAR(tok) + g_token->name), txt);
+ qPrint(cmd_start + g_token->name),txt);
break;
case TK_SYMBOL:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found found as part of a %s",
@@ -2312,6 +2313,7 @@ void DocSecRefList::parse()
{
if (tok==TK_COMMAND_AT || tok == TK_COMMAND_BS)
{
+ char *cmd_start = (tok==TK_COMMAND_AT ? "@" : "\\");
switch (Mappers::cmdMapper->map(g_token->name))
{
case CMD_SECREFITEM:
@@ -2339,7 +2341,7 @@ void DocSecRefList::parse()
goto endsecreflist;
default:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\secreflist",
- qPrint(g_token->name));
+ qPrint(cmd_start + g_token->name));
goto endsecreflist;
}
}
@@ -2646,9 +2648,11 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
{
if (!defaultHandleToken(this,tok,m_children,FALSE))
{
+ char *cmd_start = "\\";
switch (tok)
{
case TK_COMMAND_AT:
+ cmd_start = "@";
// fall through
case TK_COMMAND_BS:
switch (Mappers::cmdMapper->map(g_token->name))
@@ -2661,7 +2665,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
goto endlink;
default:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\link",
- qPrint(g_token->name));
+ qPrint(cmd_start + g_token->name));
break;
}
break;
@@ -3793,9 +3797,11 @@ int DocHtmlDescTitle::parse()
{
if (!defaultHandleToken(this,tok,m_children))
{
+ char *cmd_start = "\\";
switch (tok)
{
case TK_COMMAND_AT:
+ cmd_start = "@";
// fall through
case TK_COMMAND_BS:
{
@@ -3866,8 +3872,8 @@ int DocHtmlDescTitle::parse()
break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s found as part of a <dt> tag",
- qPrint(g_token->name));
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s found as part of a <dt> tag",
+ qPrint(cmd_start + g_token->name));
}
}
break;