From 2ed3d33a92dbcdf0a0149c5f06909926e44cdebd Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 4 Jan 2014 19:04:42 +0100 Subject: Fixed issues with @parblock and added regression test case --- src/commentscan.l | 5 ++ src/docparser.cpp | 4 ++ src/doctokenizer.l | 2 +- testing/054/054__parblock_8cpp.xml | 103 +++++++++++++++++++++++++++++++++++++ testing/054_parblock.cpp | 32 ++++++++++++ 5 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 testing/054/054__parblock_8cpp.xml create mode 100644 testing/054_parblock.cpp diff --git a/src/commentscan.l b/src/commentscan.l index 0d08e5c..2170dc2 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -2403,6 +2403,11 @@ static bool handleParBlock(const QCString &) warn(yyFileName,yyLineNr, "found \\parblock command while already in a parblock!"); } + if (!g_spaceBeforeCmd.isEmpty()) + { + addOutput(g_spaceBeforeCmd); + g_spaceBeforeCmd.resize(0); + } addOutput("@parblock "); g_insideParBlock = TRUE; return FALSE; diff --git a/src/docparser.cpp b/src/docparser.cpp index e1e750f..7e34ad0 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -4945,6 +4945,10 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d) { retval = pl->parse(cmdName); } + if (retval==RetVal_EndParBlock) + { + retval = RetVal_OK; + } DBG(("DocParamSect::parse() end retval=%d\n",retval)); DocNode *n=g_nodeStack.pop(); diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 5ba1a72..6d521d9 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -1024,7 +1024,7 @@ REFWORD {LABELID}|{REFWORD2}|{REFWORD3}|{LNKWORD2} g_token->name = types+"#"+params.mid(i); return TK_WORD; } -[^ \t\n,]+ { +[^ \t\n,@\\]+ { g_token->name = yytext; if (g_token->name.at(yyleng-1)==':') { diff --git a/testing/054/054__parblock_8cpp.xml b/testing/054/054__parblock_8cpp.xml new file mode 100644 index 0000000..a562a6d --- /dev/null +++ b/testing/054/054__parblock_8cpp.xml @@ -0,0 +1,103 @@ + + + + 054_parblock.cpp + + + void + void function + (int client, int *resource, int parblock, int *test, int p) + function + + int + client + + + int * + resource + + + int + parblock + + + int * + test + + + int + p + + + + + call by target-specific code to manage resources required by the client. + + + + + client + + + ID of client requesting resource. + + + + + resource + + + Requested resource + + + + + parblock + + + + + This is a test for the @parblock command. + A list if values for the parblock param:Item 1. This is short one-line description.Item 2. This is a long bullet item; sometimes they wrap on multiple lines like this one. + + This is the second paragraph description for the @parblock parameter. Always end the text inside the @parblock command with an @endparblock command. + + + + + + + test + + + This is a test parameter for this function to see if it is included in the parameter table + + + + + p + + + + + First paragraph of the param description. Second paragraph of the param description. + + + + + + + + + + + + + + + + + + + + diff --git a/testing/054_parblock.cpp b/testing/054_parblock.cpp new file mode 100644 index 0000000..186feb5 --- /dev/null +++ b/testing/054_parblock.cpp @@ -0,0 +1,32 @@ +// objective: test the \parblock command +// check: 054__parblock_8cpp.xml + +/** @file */ + +/** + call by target-specific code to manage resources required by the client. + + @param[in] client ID of client requesting resource. + @param[out] resource Requested resource + @param[in] parblock @parblock This is a test for the \@parblock + command. + + A list if values for the parblock param: + - Item 1. This is short one-line description. + - Item 2. This is a long bullet item; + sometimes they wrap on multiple lines like this + one. + + This is the second paragraph description for the + \@parblock parameter. Always end the text inside + the \@parblock command with an \@endparblock + command. + @endparblock + @param[out] test This is a test parameter for this function to see if + it is included in the parameter table + @param[in] p @parblock First paragraph of the param description. + + Second paragraph of the param description. + @endparblock + */ +void function(int client,int *resource,int parblock,int *test,int p); -- cgit v0.12