summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-01-24 22:18:59 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2010-01-24 22:18:59 (GMT)
commitb3ff521abec20509a917158bee82fff6d0931447 (patch)
tree2ceed71b80fa23429f6aeb4a62fe9ca3ea9499d1 /src/pre.l
parentdf4e1edf1f6abb55a811e7c4a34764f27b50e502 (diff)
downloadDoxygen-b3ff521abec20509a917158bee82fff6d0931447.zip
Doxygen-b3ff521abec20509a917158bee82fff6d0931447.tar.gz
Doxygen-b3ff521abec20509a917158bee82fff6d0931447.tar.bz2
Release-1.6.2-20100124
Diffstat (limited to 'src/pre.l')
-rw-r--r--src/pre.l15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/pre.l b/src/pre.l
index 7e169e3..339965a 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -2,7 +2,7 @@
*
*
*
- * Copyright (C) 1997-2008 by Dimitri van Heesch.
+ * Copyright (C) 1997-2010 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -96,6 +96,7 @@ static bool g_quoteArg;
static DefineDict *g_fileDefineDict = new DefineDict(10009);
static DefineDict *g_expandedDict;
static int g_findDefArgContext;
+static bool g_expectGuard;
static QCString g_lastGuardName;
static QCString g_incName;
static QCString g_guardExpr;
@@ -1237,6 +1238,7 @@ static void readIncludeFile(const QCString &inc)
//fprintf(stderr,"Switching to include file %s\n",incFileName.data());
//preYYin=fs->filePtr;
//yy_switch_to_buffer(yy_create_buffer(preYYin, YY_BUF_SIZE));
+ g_expectGuard=TRUE;
g_inputBuf=&fs->fileBuf;
g_inputBufPos=0;
yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE));
@@ -1487,7 +1489,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
outputChar(*yytext);
BEGIN( CopyLine );
}
-<CopyLine>{ID}/{BN}{0,80}"(" {
+<CopyLine>{ID}/{BN}{0,80}"(" {
+ g_expectGuard = FALSE;
Define *def=0;
//def=g_fileDefineDict->find(yytext);
//printf("Search for define %s found=%d g_includeStack.isEmpty()=%d "
@@ -1762,7 +1765,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_guardExpr+=" 1L ";
else
g_guardExpr+=" 0L ";
- g_lastGuardName.resize(0);
+ g_lastGuardName=yytext;
}
<DefinedExpr1,DefinedExpr2>\n { // should not happen, handle anyway
g_yyLineNr++;
@@ -1906,7 +1909,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_defText.resize(0);
g_defLitText.resize(0);
g_defVarArgs = FALSE;
- if ( g_defName!=g_lastGuardName )
+ //printf("Guard check: %s!=%s || %d\n",
+ // g_defName.data(),g_lastGuardName.data(),g_expectGuard);
+ if ( g_defName!=g_lastGuardName || !g_expectGuard)
{ // define may appear in the output
QCString tmp=(QCString)"#define "+g_defName;
outputArray(tmp.data(),tmp.length());
@@ -2320,6 +2325,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_yyLineNr++;
}
<*>. {
+ g_expectGuard = FALSE;
outputChar(*yytext);
}
@@ -2583,6 +2589,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
g_inputFileDef = g_yyFileDef;
BEGIN( Start );
+ g_expectGuard = TRUE;
g_lastGuardName.resize(0);
g_guardExpr.resize(0);