summaryrefslogtreecommitdiffstats
path: root/src/scanner.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2005-09-27 19:20:12 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2005-09-27 19:20:12 (GMT)
commitb3063065e56a63056b094b58a883856267e32db3 (patch)
tree5485e95b8a8a758f2d0d0a39e611d4d9b1ad519b /src/scanner.l
parentba7233b1be8545e619d80a62dd274521392fbe1f (diff)
downloadDoxygen-b3063065e56a63056b094b58a883856267e32db3.zip
Doxygen-b3063065e56a63056b094b58a883856267e32db3.tar.gz
Doxygen-b3063065e56a63056b094b58a883856267e32db3.tar.bz2
Release-1.4.4-20050927
Diffstat (limited to 'src/scanner.l')
-rw-r--r--src/scanner.l67
1 files changed, 64 insertions, 3 deletions
diff --git a/src/scanner.l b/src/scanner.l
index 3a2bddc..4e510d9 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -296,6 +296,8 @@ static QCString stripQuotes(const char *s)
static void startCommentBlock(bool);
static void handleCommentBlock(const QCString &doc,bool brief);
+static void handleParametersCommentBlocks();
+
//-----------------------------------------------------------------
static bool nameIsOperator(QCString &name)
@@ -2747,14 +2749,15 @@ IDLATTR ("["[^\]]*"]"){BN}*
*copyArgString+=*yytext;
fullArgString+=*yytext;
stringToArgumentList(fullArgString,current->argList);
+ handleParametersCommentBlocks();
/* remember the current documentation block, since
we could overwrite it with the documentation of
a function argument, which we then have to correct later
on
*/
- docBackup = current->doc.copy();
- briefBackup = current->brief.copy();
+ docBackup = current->doc;
+ briefBackup = current->brief;
BEGIN( currentArgumentContext );
}
@@ -2769,9 +2772,10 @@ IDLATTR ("["[^\]]*"]"){BN}*
unput(yytext[i]);
}
stringToArgumentList(fullArgString,current->argList);
+ handleParametersCommentBlocks();
BEGIN( currentArgumentContext );
}
- else
+ else // not a define
{
// for functions we interpret a comment
// as documentation for the argument
@@ -2820,6 +2824,7 @@ IDLATTR ("["[^\]]*"]"){BN}*
*copyArgString+=*yytext;
fullArgString+=*yytext;
stringToArgumentList(fullArgString,current->argList);
+ handleParametersCommentBlocks();
BEGIN( currentArgumentContext );
}
else
@@ -4298,6 +4303,62 @@ exit:
}
}
+static void handleParametersCommentBlocks()
+{
+ //printf(">>>>>>> handleParametersCommentBlocks()\n");
+ ArgumentListIterator ali(*current->argList);
+ Argument *a;
+ for (ali.toFirst();(a=ali.current());++ali)
+ {
+ //printf(" Param %s docs=%s\n",a->name.data(),a->docs.data());
+ if (!a->docs.isEmpty())
+ {
+ int position=0;
+ bool needsEntry;
+
+ // save context
+ QCString orgDoc = current->doc;
+ QCString orgBrief = current->brief;
+ int orgDocLine = current->docLine;
+ int orgBriefLine = current->briefLine;
+
+ current->doc.resize(0);
+ current->brief.resize(0);
+
+ //printf("handleParametersCommentBlock [%s]\n",doc.data());
+ while (parseCommentBlock(
+ g_thisParser,
+ current,
+ a->docs, // text
+ yyFileName, // file
+ current->docLine, // line of block start
+ FALSE,
+ FALSE,
+ protection,
+ position,
+ needsEntry
+ )
+ )
+ {
+ //printf("handleParametersCommentBlock position=%d [%s]\n",position,doc.data()+position);
+ if (needsEntry) newEntry();
+ }
+ if (needsEntry)
+ {
+ newEntry();
+ }
+ a->docs = current->doc;
+
+ // restore context
+ current->doc = orgDoc;
+ current->brief = orgBrief;
+ current->docLine = orgDocLine;
+ current->briefLine = orgBriefLine;
+ }
+ }
+}
+
+
//----------------------------------------------------------------------------
//static void startGroupInDoc()