diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2012-01-10 21:15:46 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2012-01-10 21:15:46 (GMT) |
commit | fd8b446f8ae60e7d1dc259c6f5fe38c287377d19 (patch) | |
tree | ab92980b31825ec310269f7799b1076422132a3e /src/commentscan.l | |
parent | 8a65c23b74c33c38b4d1234e76cec74bd08cea69 (diff) | |
download | Doxygen-fd8b446f8ae60e7d1dc259c6f5fe38c287377d19.zip Doxygen-fd8b446f8ae60e7d1dc259c6f5fe38c287377d19.tar.gz Doxygen-fd8b446f8ae60e7d1dc259c6f5fe38c287377d19.tar.bz2 |
Release-1.7.6.1-20120110
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index cb295d1..4f4408f 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -45,6 +45,7 @@ #include "debug.h" #include "parserintf.h" #include "cite.h" +#include "markdown.h" // forward declarations static bool handleBrief(const QCString &); @@ -110,6 +111,7 @@ static bool handlePublic(const QCString &s); static bool handlePublicSection(const QCString &s); static bool handleInherit(const QCString &); static bool handleExtends(const QCString &); +static bool handleCopyDoc(const QCString &); typedef bool (*DocCmdFunc)(const QCString &name); @@ -209,7 +211,7 @@ static DocCmdMap docCmdMap[] = { "attention", 0, TRUE }, { "author", 0, TRUE }, { "authors", 0, TRUE }, - { "copydoc", 0, TRUE }, + { "copydoc", &handleCopyDoc, TRUE }, { "copybrief", 0, FALSE }, { "copydetails", 0, TRUE }, { "date", 0, TRUE }, @@ -404,6 +406,7 @@ static int g_sectionLevel; static int g_commentCount; static bool g_spaceBeforeCmd; static bool g_spaceBeforeIf; +static QCString g_copyDocArg; //----------------------------------------------------------------------------- @@ -749,6 +752,7 @@ static inline void setOutput(OutputContext ctx) // add a string to the output static inline void addOutput(const char *s) { + //printf("addOutput(%s)\n",s); *pOutputString+=s; } @@ -876,6 +880,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" %x HtmlComment %x SkipLang %x CiteLabel +%x CopyDoc %% @@ -1055,7 +1060,8 @@ RCSTAG "$"{ID}":"[^\n$]+"$" <Comment>^{B}*"."{B}*/\n { // explicit end autolist: e.g " ." addOutput(yytext); } -<Comment>^{B}*"-" { // start of autolist +<Comment>^{B}*[1-9][0-9]*"."{B}+ | +<Comment>^{B}*[*+-]{B}+ { // start of autolist if (inContext!=OutputXRef) { briefEndsAtDot=FALSE; @@ -1997,6 +2003,26 @@ RCSTAG "$"{ID}":"[^\n$]+"$" BEGIN(Comment); } + /* ----- handle argument of the copydoc command ------- */ + +<CopyDoc><<EOF>> | +<CopyDoc>{DOCNL} { + if (*yytext=='\n') yyLineNr++; + addOutput('\n'); + setOutput(OutputDoc); + addOutput("\\copydetails "); + addOutput(g_copyDocArg); + addOutput("\n"); + BEGIN(Comment); + } +<CopyDoc>[^\n\\]+ { + g_copyDocArg+=yytext; + addOutput(yytext); + } +<CopyDoc>. { + g_copyDocArg+=yytext; + addOutput(yytext); + } %% @@ -2517,6 +2543,15 @@ static bool handleExtends(const QCString &) return FALSE; } +static bool handleCopyDoc(const QCString &) +{ + setOutput(OutputBrief); + addOutput("\\copybrief "); + g_copyDocArg.resize(0); + BEGIN(CopyDoc); + return FALSE; +} + //---------------------------------------------------------------------------- static void checkFormula() @@ -2609,6 +2644,13 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, openGroup(current,yyFileName,yyLineNr); } + if (Doxygen::markdownSupport) + { + current->brief = processMarkdown(current->brief); + current->doc = processMarkdown(current->doc); + current->inbodyDocs = processMarkdown(current->inbodyDocs); + } + Debug::print(Debug::CommentScan,0, "brief=[%s]\ndocs=[%s]\ninbody=[%s]\n===========\n", current->brief.data(),current->doc.data(),current->inbodyDocs.data() @@ -2631,7 +2673,6 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, lineNr = yyLineNr; //printf("position=%d parseMore=%d\n",position,parseMore); - return parseMore; } |