diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-05-02 09:10:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 09:10:14 (GMT) |
commit | 4784ecea4d15c34af41c1adaa188159b124a1ed0 (patch) | |
tree | 6c2de0d9c7b1da5b8fb8c02c7836be0d3521a5db /src | |
parent | 59edaeeed17cc8d7323e1c555c073786feab87db (diff) | |
parent | 6b833f052758a18fe99b20790583efac7da9eb18 (diff) | |
download | Doxygen-4784ecea4d15c34af41c1adaa188159b124a1ed0.zip Doxygen-4784ecea4d15c34af41c1adaa188159b124a1ed0.tar.gz Doxygen-4784ecea4d15c34af41c1adaa188159b124a1ed0.tar.bz2 |
Merge pull request #8327 from albert-github/feature/bug_enum_struct
Incorrect type for enum struct
Diffstat (limited to 'src')
-rw-r--r-- | src/entry.h | 1 | ||||
-rw-r--r-- | src/memberdef.cpp | 10 | ||||
-rw-r--r-- | src/memberdef.h | 1 | ||||
-rw-r--r-- | src/memberlist.cpp | 9 | ||||
-rw-r--r-- | src/scanner.l | 8 |
5 files changed, 27 insertions, 2 deletions
diff --git a/src/entry.h b/src/entry.h index 831501c..cfb5566 100644 --- a/src/entry.h +++ b/src/entry.h @@ -138,6 +138,7 @@ class Entry static const uint64 Local = (1ULL<<16); // for Slice types // member specifiers (add new items to the beginning) + static const uint64 EnumStruct = (1ULL<<18); static const uint64 ConstExpr = (1ULL<<19); // C++11 constexpr static const uint64 PrivateGettable = (1ULL<<20); // C# private getter static const uint64 ProtectedGettable = (1ULL<<21); // C# protected getter diff --git a/src/memberdef.cpp b/src/memberdef.cpp index dc5d095..af05535 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -138,6 +138,7 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable> virtual bool isRetain() const; virtual bool isWeak() const; virtual bool isStrong() const; + virtual bool isEnumStruct() const; virtual bool isUnretained() const; virtual bool isNew() const; virtual bool isSealed() const; @@ -547,6 +548,8 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef> { return getMdAlias()->isWeak(); } virtual bool isStrong() const { return getMdAlias()->isStrong(); } + virtual bool isEnumStruct() const + { return getMdAlias()->isEnumStruct(); } virtual bool isUnretained() const { return getMdAlias()->isUnretained(); } virtual bool isNew() const @@ -3201,6 +3204,8 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml, } else { + if (isEnumStruct()) ldef.prepend("struct "); + else if (isStrong()) ldef.prepend("class "); ldef.prepend("enum "); if (isSliceLocal()) { @@ -5065,6 +5070,11 @@ bool MemberDefImpl::isStrong() const return (m_impl->memSpec&Entry::Strong)!=0; } +bool MemberDefImpl::isEnumStruct() const +{ + return (m_impl->memSpec&Entry::EnumStruct)!=0; +} + bool MemberDefImpl::isStrongEnumValue() const { return m_impl->mtype==MemberType_EnumValue && diff --git a/src/memberdef.h b/src/memberdef.h index 91b0c6d..1d1e744 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -148,6 +148,7 @@ class MemberDef : public Definition virtual bool isRetain() const = 0; virtual bool isWeak() const = 0; virtual bool isStrong() const = 0; + virtual bool isEnumStruct() const = 0; virtual bool isUnretained() const = 0; virtual bool isNew() const = 0; virtual bool isSealed() const = 0; diff --git a/src/memberlist.cpp b/src/memberlist.cpp index bd89739..d7ddfcc 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -415,7 +415,14 @@ void MemberList::writePlainDeclarations(OutputList &ol, ol.writeString("enum "); if (md->isStrong()) { - ol.writeString("class "); + if (md->isEnumStruct()) + { + ol.writeString("struct "); + } + else + { + ol.writeString("class "); + } } ol.insertMemberAlign(); md->writeEnumDeclaration(ol,cd,nd,fd,gd); diff --git a/src/scanner.l b/src/scanner.l index 70c13c4..fdd8b93 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1599,7 +1599,8 @@ NONLopt [^\n]* <FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ { // for IDL: typedef [something] enum QCString text=yytext; yyextra->isTypedef = text.find("typedef")!=-1; - bool isStrongEnum = text.find("struct")!=-1 || text.find("class")!=-1 || yyextra->insideCS; + bool isStrongEnum = text.find("class")!=-1 || yyextra->insideCS; + bool isEnumSytruct = text.find("struct")!=-1; if (yyextra->insideJava) { yyextra->current->section = Entry::CLASS_SEC; @@ -1615,6 +1616,11 @@ NONLopt [^\n]* { yyextra->current->spec |= Entry::Strong; } + if (isEnumSytruct) + { + yyextra->current->spec |= Entry::Strong; + yyextra->current->spec |= Entry::EnumStruct; + } yyextra->current->fileName = yyextra->yyFileName; yyextra->current->startLine = yyextra->yyLineNr; yyextra->current->startColumn = yyextra->yyColNr; |