summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-04-30 17:13:40 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-04-30 17:13:40 (GMT)
commit26b5069ce70ddad043040a06b984beef02b89994 (patch)
treee8fc87186141ebce1c8547a44d7adcd0ec122e14 /src/pre.l
parente2b4a623decf7c8b4435f742f05d07323ad8d6f2 (diff)
downloadDoxygen-26b5069ce70ddad043040a06b984beef02b89994.zip
Doxygen-26b5069ce70ddad043040a06b984beef02b89994.tar.gz
Doxygen-26b5069ce70ddad043040a06b984beef02b89994.tar.bz2
Release-1.1.2-20000430
Diffstat (limited to 'src/pre.l')
-rw-r--r--src/pre.l17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/pre.l b/src/pre.l
index eb49f58..9e7a241 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -125,7 +125,15 @@ static void decrLevel()
static bool otherCaseDone()
{
- return g_levelGuard[g_level-1];
+ if (g_level==0)
+ {
+ err("Error: Found an #else without a preceding #if.\n");
+ return TRUE;
+ }
+ else
+ {
+ return g_levelGuard[g_level-1];
+ }
}
static void setCaseDone(bool value)
@@ -1079,7 +1087,7 @@ BN [ \t\r\n]
g_guardExpr.resize(0);
BEGIN(Guard);
}
-<Command>"elif"/[ \t(] {
+<Command>("elif"|"else"{B}*"if")/[ \t(] {
if (!otherCaseDone())
{
g_guardExpr.resize(0);
@@ -1107,7 +1115,7 @@ BN [ \t\r\n]
<Command>"undef"{B}+ {
BEGIN(Ung_defName);
}
-<Command>"elif"/[ \t(] {
+<Command>("elif"|"else"{B}*"if")/[ \t(] {
if (!otherCaseDone())
{
g_guardExpr.resize(0);
@@ -1208,7 +1216,7 @@ BN [ \t\r\n]
BEGIN(Start);
}
}
-<SkipCommand>"elif"/[ \t(] {
+<SkipCommand>("elif"|"else"{B}*"if")/[ \t(] {
if (g_ifcount==0)
{
if (!otherCaseDone())
@@ -1693,6 +1701,7 @@ void preprocessFile(const char *fileName,BufStr &output)
char *defStr = Config::predefined.first();
while (defStr)
{
+ //printf("Predefined: `%s'\n",defStr);
QCString ds = defStr;
int i_equals=ds.find('=');
int i_obrace=ds.find('(');