diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-07-07 10:35:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-07 10:35:40 (GMT) |
commit | 54f758e77fad281c0bcc80c3322cbb1822334b37 (patch) | |
tree | 8c0f65e6a33bc4af4528a6e255260a8153a55d43 | |
parent | 33dec4e2d3df7c33a3dd75448b8df1efb66d6fcd (diff) | |
parent | faeefd14c83597011da89f5f67845165b93d15de (diff) | |
download | Doxygen-54f758e77fad281c0bcc80c3322cbb1822334b37.zip Doxygen-54f758e77fad281c0bcc80c3322cbb1822334b37.tar.gz Doxygen-54f758e77fad281c0bcc80c3322cbb1822334b37.tar.bz2 |
Merge pull request #7105 from albert-github/feature/issue_7102
issue #7102 Doxygen does not generate error/warning message for unbalanced group markers "@{"..."@}"
-rw-r--r-- | src/commentscan.l | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index b3902fc..665360c 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -458,6 +458,7 @@ static QCString g_memberGroupDocs; static QCString g_memberGroupRelates; static QCString g_compoundName; +static int g_openCount = 0; //----------------------------------------------------------------------------- static void initParser() @@ -3243,6 +3244,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, void groupEnterFile(const char *fileName,int) { + g_openCount = 0; g_autoGroupStack.setAutoDelete(TRUE); g_autoGroupStack.clear(); g_memberGroupId = DOX_NOGROUP; @@ -3262,7 +3264,11 @@ void groupLeaveFile(const char *fileName,int line) g_memberGroupDocs.resize(0); if (!g_autoGroupStack.isEmpty()) { - warn(fileName,line,"end of file while inside a group\n"); + warn(fileName,line,"end of file while inside a group"); + } + else if (g_openCount > 0) // < 0 is already handled on close call + { + warn(fileName,line,"end of file with unbalanced grouping commands"); } } @@ -3323,6 +3329,7 @@ static int findExistingGroup(int &groupId,const MemberGroupInfo *info) void openGroup(Entry *e,const char *,int) { + g_openCount++; //printf("==> openGroup(name=%s,sec=%x) g_autoGroupStack=%d\n", // e->name.data(),e->section,g_autoGroupStack.count()); if (e->section==Entry::GROUPDOC_SEC) // auto group @@ -3351,6 +3358,11 @@ void openGroup(Entry *e,const char *,int) void closeGroup(Entry *e,const char *fileName,int line,bool foundInline) { + g_openCount--; + if (g_openCount < 0) + { + warn(fileName,line,"unbalanced grouping commands"); + } //printf("==> closeGroup(name=%s,sec=%x,file=%s,line=%d) g_autoGroupStack=%d\n", // e->name.data(),e->section,fileName,line,g_autoGroupStack.count()); if (g_memberGroupId!=DOX_NOGROUP) // end of member group |