Skip to content

Commit

Permalink
Regression: unbalanced grouping commands
Browse files Browse the repository at this point in the history
Regression on #7122 (and #7115 / #7116).
When having multiple consecutive `\name` sections the warning "unbalanced grouping commands" appears
Analogous to the open command also the close command needs an implicit argument.
  • Loading branch information
albert-github committed Aug 2, 2019
1 parent f16a63d commit 7a10b6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/commentscan.l
Original file line number Diff line number Diff line change
Expand Up @@ -2545,7 +2545,7 @@ static bool handleName(const QCString &, const QCStringList &)
BEGIN( NameParam );
if (!Doxygen::docGroup.isEmpty()) // end of previous member group
{
Doxygen::docGroup.close(current,yyFileName,yyLineNr,TRUE);
Doxygen::docGroup.close(current,yyFileName,yyLineNr,TRUE,true);
}
}
return stop;
Expand Down
17 changes: 10 additions & 7 deletions src/docgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,18 @@ void DocGroup::open(Entry *e,const char *,int, bool implicit)
}
}

void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline)
void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,bool implicit)
{
if (m_openCount < 1)
if (!implicit)
{
warn(fileName,line,"unbalanced grouping commands");
}
else
{
m_openCount--;
if (m_openCount < 1)
{
warn(fileName,line,"unbalanced grouping commands");
}
else
{
m_openCount--;
}
}
//printf("==> closeGroup(name=%s,sec=%x,file=%s,line=%d) m_autoGroupStack=%d\n",
// e->name.data(),e->section,fileName,line,m_autoGroupStack.count());
Expand Down
2 changes: 1 addition & 1 deletion src/docgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DocGroup
void enterCompound(const char *fileName,int line,const char *name);
void leaveCompound(const char *,int,const char * /*name*/);
void open(Entry *e,const char *,int,bool implicit=false);
void close(Entry *e,const char *fileName,int line,bool foundInline);
void close(Entry *e,const char *fileName,int line,bool foundInline,bool imlicit=false);
void initGroupInfo(Entry *e);
bool isEmpty() const;
void clearHeader();
Expand Down

0 comments on commit 7a10b6e

Please sign in to comment.