diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2010-02-21 12:36:45 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2010-02-21 12:36:45 (GMT) |
commit | 23b0a90048405fda4e4304052c3c1277c33a6a2b (patch) | |
tree | a854db582634296d7f019de53e424561da555e5b /src/commentscan.l | |
parent | 20e951b95073ef5c1b76e9336c6281928e5c5a4d (diff) | |
download | Doxygen-23b0a90048405fda4e4304052c3c1277c33a6a2b.zip Doxygen-23b0a90048405fda4e4304052c3c1277c33a6a2b.tar.gz Doxygen-23b0a90048405fda4e4304052c3c1277c33a6a2b.tar.bz2 |
Release-1.6.3
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index 2690657..5306075 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -395,6 +395,8 @@ static bool inGroupParamFound; static int braceCount; static bool insidePre; static bool parseMore; +static int g_condCount; +static int g_sectionLevel; static int g_commentCount; @@ -1691,6 +1693,48 @@ RCSTAG "$"{ID}":"[^\n$]+"$" if (*yytext=='\n') yyLineNr++; addOutput('\n'); } +<SkipInternal>[@\\]"if"/[ \t] { + g_condCount++; + } +<SkipInternal>[@\\]"ifnot"/[ \t] { + g_condCount++; + } +<SkipInternal>[@\\]/"endif" { + g_condCount--; + if (g_condCount<0) // handle conditional section around of \internal, see bug607743 + { + unput('\\'); + BEGIN(Comment); + } + } +<SkipInternal>[@\\]/"section"[ \t] { + if (g_sectionLevel>0) + { + unput('\\'); + BEGIN(Comment); + } + } +<SkipInternal>[@\\]/"subsection"[ \t] { + if (g_sectionLevel>1) + { + unput('\\'); + BEGIN(Comment); + } + } +<SkipInternal>[@\\]/"subsubsection"[ \t] { + if (g_sectionLevel>2) + { + unput('\\'); + BEGIN(Comment); + } + } +<SkipInternal>[@\\]/"paragraph"[ \t] { + if (g_sectionLevel>3) + { + unput('\\'); + BEGIN(Comment); + } + } <SkipInternal>[^ \\@\n]+ { // skip non-special characters } <SkipInternal>. { // any other character @@ -2134,6 +2178,10 @@ static bool handleSection(const QCString &s) setOutput(OutputDoc); addOutput("@"+s+" "); BEGIN(SectionLabel); + if (s=="section") g_sectionLevel=1; + else if (s=="subsection") g_sectionLevel=2; + else if (s=="subsubsection") g_sectionLevel=3; + else if (s=="paragraph") g_sectionLevel=4; return FALSE; } @@ -2283,6 +2331,7 @@ static bool handleInternal(const QCString &) { current->doc.resize(0); } + g_condCount=0; BEGIN( SkipInternal ); } else @@ -2409,6 +2458,8 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, outputXRef.resize(0); setOutput( isBrief || isAutoBriefOn ? OutputBrief : OutputDoc ); briefEndsAtDot = isAutoBriefOn; + g_condCount = 0; + g_sectionLevel = 0; if (!current->inbodyDocs.isEmpty() && isInbody) // separate in body fragments { |