summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2002-09-15 19:55:15 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2002-09-15 19:55:15 (GMT)
commit1c72ffcbe310e13d7dda73fa78d6ea4f93636c3e (patch)
tree80bc5b8e1fe89bbf6bd2fbbf2c640eb73313f626 /src/pre.l
parent228f1d8a76b93c592888a9c454ecf93983f1e4e3 (diff)
downloadDoxygen-1c72ffcbe310e13d7dda73fa78d6ea4f93636c3e.zip
Doxygen-1c72ffcbe310e13d7dda73fa78d6ea4f93636c3e.tar.gz
Doxygen-1c72ffcbe310e13d7dda73fa78d6ea4f93636c3e.tar.bz2
Release-1.2.17-20020915
Diffstat (limited to 'src/pre.l')
-rw-r--r--src/pre.l13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/pre.l b/src/pre.l
index 0219d8e..903b69e 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -98,6 +98,7 @@ static bool g_nospaces; // add extra spaces during macro expansion
static bool g_macroExpansion; // from the configuration
static bool g_expandOnlyPredef; // from the configuration
+static int g_commentCount;
static void setFileName(const char *name)
@@ -1613,6 +1614,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_defText+=' ';
g_defLitText+=' ';
g_lastCContext=YY_START;
+ g_commentCount=1;
BEGIN(SkipCComment);
}
<DefineText>"//" {
@@ -1622,16 +1624,20 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(SkipCPPComment);
}
<SkipCComment>"*/" {
- outputChar('*');outputChar('/');
- BEGIN(g_lastCContext);
+ if (--g_commentCount<=0)
+ {
+ outputChar('*');outputChar('/');
+ BEGIN(g_lastCContext);
+ }
}
<SkipCComment>"//" {
outputChar('/');outputChar('/');
}
<SkipCComment>"/*" {
outputChar('/');outputChar('*');
+ g_commentCount++;
}
-<SkipCComment>[^*\n]+ {
+<SkipCComment>[^*\n\/]+ {
outputArray(yytext,yyleng);
}
<SkipCComment>\n {
@@ -1809,6 +1815,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<*>"/*" {
outputChar('/');outputChar('*');
g_lastCContext=YY_START;
+ g_commentCount=1;
BEGIN(SkipCComment);
}
<*>"//" {