Skip to content

Commit 26a634f

Browse files
committed
Fixed line count misaligned introduced with JAVADOC_BANNER
1 parent d29c0e8 commit 26a634f

File tree

1 file changed

+38
-36
lines changed

1 file changed

+38
-36
lines changed

src/scanner.l

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static void initEntry()
246246

247247
static void lineCount()
248248
{
249-
static int tabSize = Config_getInt(TAB_SIZE);
249+
int tabSize = Config_getInt(TAB_SIZE);
250250
const char *p;
251251
for (p = yytext ; *p ; ++p )
252252
{
@@ -269,7 +269,7 @@ static void lineCount()
269269
static inline int computeIndent(const char *s,int startIndent)
270270
{
271271
int col=startIndent;
272-
static int tabSize=Config_getInt(TAB_SIZE);
272+
int tabSize=Config_getInt(TAB_SIZE);
273273
const char *p=s;
274274
char c;
275275
while ((c=*p++))
@@ -4120,7 +4120,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
41204120
if (!g_msName.isEmpty()
41214121
/*&& g_msName!=g_current->name*/) // skip typedef T {} T;, removed due to bug608493
41224122
{
4123-
static bool typedefHidesStruct = Config_getBool(TYPEDEF_HIDES_STRUCT);
4123+
bool typedefHidesStruct = Config_getBool(TYPEDEF_HIDES_STRUCT);
41244124
// case 1: typedef struct _S { ... } S_t;
41254125
// -> omit typedef and use S_t as the struct name
41264126
if (typedefHidesStruct &&
@@ -6207,41 +6207,43 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
62076207
BEGIN( DocBlock );
62086208
}
62096209
<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>"/**"[*]+{BL} {
6210+
bool javadocBanner = Config_getBool(JAVADOC_BANNER);
6211+
lineCount();
62106212

6211-
static bool javadocBanner = Config_getBool(JAVADOC_BANNER);
6212-
6213-
if( javadocBanner ) {
6214-
g_lastDocContext = YY_START;
6213+
if( javadocBanner )
6214+
{
6215+
g_lastDocContext = YY_START;
62156216

6216-
//printf("Found comment banner at %s:%d\n",g_yyFileName,g_yyLineNr);
6217-
if (g_current_root->section & Entry::SCOPE_MASK)
6218-
{
6219-
g_current->inside = g_current_root->name+"::";
6220-
}
6221-
g_current->docLine = g_yyLineNr;
6222-
g_current->docFile = g_yyFileName;
6223-
g_docBlockContext = YY_START;
6224-
g_docBlockInBody = YY_START==SkipCurly;
6225-
static bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
6226-
g_docBlockAutoBrief = javadocAutoBrief;
6217+
//printf("Found comment banner at %s:%d\n",g_yyFileName,g_yyLineNr);
6218+
if (g_current_root->section & Entry::SCOPE_MASK)
6219+
{
6220+
g_current->inside = g_current_root->name+"::";
6221+
}
6222+
g_current->docLine = g_yyLineNr;
6223+
g_current->docFile = g_yyFileName;
6224+
g_docBlockContext = YY_START;
6225+
g_docBlockInBody = YY_START==SkipCurly;
6226+
bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
6227+
g_docBlockAutoBrief = javadocAutoBrief;
62276228

6228-
QCString indent;
6229-
indent.fill(' ',computeIndent(yytext,g_column));
6230-
g_docBlock=indent;
6229+
QCString indent;
6230+
indent.fill(' ',computeIndent(yytext,g_column));
6231+
g_docBlock=indent;
62316232

6232-
if (g_docBlockAutoBrief)
6233-
{
6234-
g_current->briefLine = g_yyLineNr;
6235-
g_current->briefFile = g_yyFileName;
6236-
}
6237-
startCommentBlock(FALSE);
6238-
BEGIN( DocBlock );
6239-
} else {
6240-
g_current->program += yytext ;
6241-
g_lastContext = YY_START ;
6242-
BEGIN( Comment ) ;
6233+
if (g_docBlockAutoBrief)
6234+
{
6235+
g_current->briefLine = g_yyLineNr;
6236+
g_current->briefFile = g_yyFileName;
6237+
}
6238+
startCommentBlock(FALSE);
6239+
BEGIN( DocBlock );
6240+
}
6241+
else
6242+
{
6243+
g_current->program += yytext ;
6244+
g_lastContext = YY_START ;
6245+
BEGIN( Comment ) ;
62436246
}
6244-
62456247
}
62466248
<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>("//"{B}*)?"/**"/[^/*] {
62476249
g_lastDocContext = YY_START;
@@ -6255,7 +6257,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
62556257
g_current->docFile = g_yyFileName;
62566258
g_docBlockContext = YY_START;
62576259
g_docBlockInBody = YY_START==SkipCurly;
6258-
static bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
6260+
bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
62596261
g_docBlockAutoBrief = javadocAutoBrief;
62606262
62616263
QCString indent;
@@ -6916,7 +6918,7 @@ static void newEntry()
69166918

69176919
static void handleCommentBlock(const QCString &doc,bool brief)
69186920
{
6919-
static bool hideInBodyDocs = Config_getBool(HIDE_IN_BODY_DOCS);
6921+
bool hideInBodyDocs = Config_getBool(HIDE_IN_BODY_DOCS);
69206922
if (g_docBlockInBody && hideInBodyDocs) return;
69216923
//printf("parseCommentBlock [%s] brief=%d\n",doc.data(),brief);
69226924
int lineNr = brief ? g_current->briefLine : g_current->docLine; // line of block start
@@ -7058,7 +7060,7 @@ static void parseCompounds(const std::unique_ptr<Entry> &rt)
70587060
initEntry();
70597061

70607062
// deep copy group list from parent (see bug 727732)
7061-
static bool autoGroupNested = Config_getBool(GROUP_NESTED_COMPOUNDS);
7063+
bool autoGroupNested = Config_getBool(GROUP_NESTED_COMPOUNDS);
70627064
if (autoGroupNested && ce->section!=Entry::ENUM_SEC && !(ce->spec&Entry::Enum))
70637065
{
70647066
ce->groups = rt->groups;

0 commit comments

Comments
 (0)