summaryrefslogtreecommitdiffstats
path: root/src/commentcnv.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-04-02 19:27:49 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-04-02 19:27:49 (GMT)
commitebf4b3641c9149eaf4468aa8df64e1c7517e5f0c (patch)
tree23804fcf753b3487b9a1ea28d4d28b71fa4ae208 /src/commentcnv.l
parentdeaa34e0c1d990f37fe00e465ac7a22f705904f0 (diff)
downloadDoxygen-ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c.zip
Doxygen-ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c.tar.gz
Doxygen-ebf4b3641c9149eaf4468aa8df64e1c7517e5f0c.tar.bz2
Release-1.8.3.1-20130402
Diffstat (limited to 'src/commentcnv.l')
-rw-r--r--src/commentcnv.l26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 97f5194..6e7fa30 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -43,12 +43,6 @@
#define ADDCHAR(c) g_outBuf->addChar(c)
#define ADDARRAY(a,s) g_outBuf->addArray(a,s)
-enum GuardType
-{
- Guard_Cond,
- Guard_CondNot
-};
-
struct CondCtx
{
CondCtx(int line,QCString id,bool b)
@@ -85,8 +79,6 @@ static bool g_lastEscaped;
static int g_lastBlockContext;
static bool g_pythonDocString;
-static GuardType guardType; // kind of guard for conditional section
-
static SrcLangExt g_lang;
static bool isFixedForm; // For Fortran
@@ -181,22 +173,13 @@ static inline void copyToOutput(const char *s,int len)
static void startCondSection(const char *sectId)
{
+ //printf("startCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
CondParser prs;
bool expResult = prs.parse(g_fileName,g_lineNr,sectId);
g_condStack.push(new CondCtx(g_lineNr,sectId,g_skip));
- if (guardType == Guard_Cond) // found @cond
+ if (!expResult) // not enabled
{
- if (!expResult) // not enabled
- {
- g_skip=TRUE;
- }
- }
- else if (guardType == Guard_CondNot) // found @notcond
- {
- if (expResult) // enabled
- {
- g_skip=TRUE;
- }
+ g_skip=TRUE;
}
}
@@ -212,6 +195,7 @@ static void endCondSection()
CondCtx *ctx = g_condStack.pop();
g_skip=ctx->skip;
}
+ //printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
}
/** copies string \a s with length \a len to the output, while
@@ -721,7 +705,6 @@ void replaceComment(int offset);
}
<CComment,ReadLine>[\\@]"cond"[ \t]+ { // conditional section
g_condCtx = YY_START;
- guardType = Guard_Cond;
BEGIN(CondLine);
}
<CComment,ReadLine>[\\@]"endcond"/[^a-z_A-Z0-9] { // end of conditional section
@@ -769,7 +752,6 @@ void replaceComment(int offset);
<CondLine>[ \t]*
<CComment,ReadLine>[\\@]"cond"[ \t\r]*/\n |
<CondLine>. { // forgot section id?
- guardType = Guard_Cond;
if (YY_START!=CondLine) g_condCtx=YY_START;
bool oldSkip=g_skip;
startCondSection(" "); // fake section id causing the section to be hidden unconditionally