summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2000-04-30 17:13:40 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2000-04-30 17:13:40 (GMT)
commit3b8b750f05f52572bc72e6e3538345a51d51844a (patch)
treee8fc87186141ebce1c8547a44d7adcd0ec122e14 /src/pre.l
parenta790b4aefe37b616ec4563877e01aa5f99447c85 (diff)
downloadDoxygen-3b8b750f05f52572bc72e6e3538345a51d51844a.zip
Doxygen-3b8b750f05f52572bc72e6e3538345a51d51844a.tar.gz
Doxygen-3b8b750f05f52572bc72e6e3538345a51d51844a.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('(');