summaryrefslogtreecommitdiffstats
path: root/src/pre.l
diff options
context:
space:
mode:
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 8586270..fdce24b 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1078,17 +1078,24 @@ BN [ \t\r\n]
BEGIN(CopyLine);
}
}
+<CopyLine>"extern"{BN}*"\"C\""*{BN}*"{" {
+ QCString text=yytext;
+ g_yyLineNr+=text.contains('\n');
+ outputArray(yytext,yyleng);
+ }
<CopyLine>"{" { // count brackets inside the main file
if (g_includeStack.isEmpty())
+ {
g_curlyCount++;
+ }
outputChar(*yytext);
}
<CopyLine>"}" { // count brackets inside the main file
- if (g_includeStack.isEmpty())
+ if (g_includeStack.isEmpty() && g_curlyCount>0)
+ {
g_curlyCount--;
+ }
outputChar(*yytext);
- // This should hold otherwise the preprocessor is confused
- //ASSERT(g_curlyCount>=0);
}
<CopyLine>"'"\\[0-7]{1,3}"'" {
outputArray(yytext,yyleng);