summaryrefslogtreecommitdiffstats
path: root/src/commentscan.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-09-04 14:34:37 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-09-24 19:01:24 (GMT)
commit3b9f4d9cee85686861070c68a53c9db369589a6e (patch)
tree1f196c204b3da949f1d1348e59760e4c3be6a77e /src/commentscan.l
parentb4e5125a6208c783445ffb66d1f683d17c8c7cd1 (diff)
downloadDoxygen-3b9f4d9cee85686861070c68a53c9db369589a6e.zip
Doxygen-3b9f4d9cee85686861070c68a53c9db369589a6e.tar.gz
Doxygen-3b9f4d9cee85686861070c68a53c9db369589a6e.tar.bz2
Added @parblock and @endparblock commands
Diffstat (limited to 'src/commentscan.l')
-rw-r--r--src/commentscan.l44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/commentscan.l b/src/commentscan.l
index 886c2dd..51e431c 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -118,6 +118,8 @@ static bool handleExtends(const QCString &);
static bool handleCopyDoc(const QCString &);
static bool handleCopyBrief(const QCString &);
static bool handleCopyDetails(const QCString &);
+static bool handleParBlock(const QCString &);
+static bool handleEndParBlock(const QCString &);
typedef bool (*DocCmdFunc)(const QCString &name);
@@ -170,6 +172,8 @@ static DocCmdMap docCmdMap[] =
{ "relates", &handleRelated, TRUE },
{ "relatedalso", &handleRelatedAlso, TRUE },
{ "relatesalso", &handleRelatedAlso, TRUE },
+ { "parblock", &handleParBlock, TRUE },
+ { "endparblock", &handleEndParBlock, TRUE },
{ "refitem", &handleRefItem, TRUE },
{ "cite", &handleCite, FALSE },
{ "subpage", &handleSubpage, TRUE },
@@ -178,7 +182,7 @@ static DocCmdMap docCmdMap[] =
{ "subsubsection", &handleSection, TRUE },
{ "paragraph", &handleSection, TRUE },
{ "anchor", &handleAnchor, TRUE },
- { "verbatim", &handleFormatBlock, TRUE },
+ { "verbatim", &handleFormatBlock, TRUE },
{ "latexonly", &handleFormatBlock, FALSE },
{ "htmlonly", &handleFormatBlock, FALSE },
{ "xmlonly", &handleFormatBlock, FALSE },
@@ -421,6 +425,8 @@ static QCString g_copyDocArg;
static QCString g_guardExpr;
static int g_roundCount;
+static bool g_insideParBlock;
+
//-----------------------------------------------------------------------------
static QStack<Grouping> g_autoGroupStack;
@@ -437,6 +443,7 @@ static void initParser()
g_sectionLabel.resize(0);
g_sectionTitle.resize(0);
g_memberGroupHeader.resize(0);
+ g_insideParBlock = FALSE;
}
//-----------------------------------------------------------------------------
@@ -1040,7 +1047,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
int i=0;
while (yytext[i]==' ' || yytext[i]=='\t') i++;
g_spaceBeforeCmd = QCString(yytext).left(i);
- if (cmdPtr->endsBrief)
+ if (cmdPtr->endsBrief && inContext!=OutputXRef)
{
briefEndsAtDot=FALSE;
// this command forces the end of brief description
@@ -1192,7 +1199,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
if (inContext==OutputXRef)
{
// see bug 613024, we need to put the newlines after ending the XRef section.
- setOutput(OutputDoc);
+ if (!g_insideParBlock) setOutput(OutputDoc);
int i;
for (i=0;i<yyleng;)
{
@@ -2389,6 +2396,31 @@ static bool handleXRefItem(const QCString &)
return FALSE;
}
+static bool handleParBlock(const QCString &)
+{
+ if (g_insideParBlock)
+ {
+ warn(yyFileName,yyLineNr,
+ "found \\parblock command while already in a parblock!");
+ }
+ addOutput("@parblock");
+ g_insideParBlock = TRUE;
+ return FALSE;
+}
+
+static bool handleEndParBlock(const QCString &)
+{
+ if (!g_insideParBlock)
+ {
+ warn(yyFileName,yyLineNr,
+ "found \\endparblock command without matching \\parblock!");
+ }
+ addOutput("@endparblock");
+ setOutput(OutputDoc); // to end a parblock inside a xrefitem like context
+ g_insideParBlock = FALSE;
+ return FALSE;
+}
+
static bool handleRelated(const QCString &)
{
BEGIN(RelatesParam1);
@@ -2810,6 +2842,12 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
warn(yyFileName,yyLineNr,"Documentation block ended in the middle of a conditional section!");
}
+ if (g_insideParBlock)
+ {
+ warn(yyFileName,yyLineNr,
+ "Documentation block ended while inside a \\parblock. Missing \\endparblock");
+ }
+
current->doc=stripLeadingAndTrailingEmptyLines(current->doc,current->docLine);
if (current->section==Entry::FILEDOC_SEC && current->doc.isEmpty())