From 52352ffd0713a666cf070ce859a11149f0453db5 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 10 Feb 2021 20:33:23 +0100 Subject: Improve handling of @param command without name or description --- src/docparser.cpp | 13 ++++++++----- src/doctokenizer.l | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index b63674a..83887c6 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -4518,7 +4518,7 @@ int DocParamList::parse(const QCString &cmdName) { warn_doc_error(g_fileName,getDoctokinizerLineNr(),"expected whitespace after \\%s command", qPrint(saveCmdName)); - retval=0; + retval=RetVal_EndParBlock; goto endparamlist; } doctokenizerYYsetStateParam(); @@ -4556,14 +4556,17 @@ int DocParamList::parse(const QCString &cmdName) { warn_doc_error(g_fileName,getDoctokinizerLineNr(),"unexpected end of comment block while parsing the " "argument of command %s",qPrint(saveCmdName)); - retval=0; + retval=RetVal_EndParBlock; goto endparamlist; } if (tok!=TK_WHITESPACE) /* premature end of comment block */ { - warn_doc_error(g_fileName,getDoctokinizerLineNr(),"unexpected token in comment block while parsing the " - "argument of command %s",qPrint(saveCmdName)); - retval=0; + if (tok!=TK_NEWPARA) /* empty param description */ + { + warn_doc_error(g_fileName,getDoctokinizerLineNr(),"unexpected token in comment block while parsing the " + "argument of command %s",qPrint(saveCmdName)); + } + retval=RetVal_EndParBlock; goto endparamlist; } diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 0c167ca..a11f2fe 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -808,7 +808,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio } lineCount(yytext,yyleng); } -({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* { +({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* { lineCount(yytext,yyleng); if (g_insidePre) { -- cgit v0.12