diff options
-rw-r--r-- | src/entry.h | 1 | ||||
-rw-r--r-- | src/memberdef.cpp | 6 | ||||
-rw-r--r-- | src/memberdef.h | 1 | ||||
-rw-r--r-- | src/scanner.l | 12 | ||||
-rw-r--r-- | src/xmlgen.cpp | 5 | ||||
-rw-r--r-- | templates/xml/compound.xsd | 1 |
6 files changed, 26 insertions, 0 deletions
diff --git a/src/entry.h b/src/entry.h index 44e47da..ad91d0d 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 ConstExpr = (1ULL<<19); // C++11 constexpr static const uint64 PrivateGettable = (1ULL<<20); // C# private getter static const uint64 ProtectedGettable = (1ULL<<21); // C# protected getter static const uint64 PrivateSettable = (1ULL<<22); // C# private setter diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 29ae057..6f449d5 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2034,6 +2034,7 @@ void MemberDef::getLabels(QStrList &sl,Definition *container) const if (isPrivateGettable()) sl.append("private get"); if (isPrivateSettable()) sl.append("private set"); } + if (isConstExpr()) sl.append("constexpr"); if (isAddable()) sl.append("add"); if (!isUNOProperty() && isRemovable()) sl.append("remove"); if (isRaisable()) sl.append("raise"); @@ -4619,6 +4620,11 @@ bool MemberDef::isSliceLocal() const return (m_impl->memSpec&Entry::Local)!=0; } +bool MemberDef::isConstExpr() const +{ + return (m_impl->memSpec&Entry::ConstExpr)!=0; +} + MemberList *MemberDef::enumFieldList() const { return m_impl->enumFields; diff --git a/src/memberdef.h b/src/memberdef.h index 650d9a5..ac54307 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -180,6 +180,7 @@ class MemberDef : public Definition bool isStrongEnumValue() const; bool livesInsideEnum() const; bool isSliceLocal() const; + bool isConstExpr() const; int numberOfFlowKeyWords(); // derived getters diff --git a/src/scanner.l b/src/scanner.l index ee04dd9..cc497e3 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1394,6 +1394,18 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) current->virt = Virtual; lineCount(); } +<FindMembers>{B}*"constexpr"{BN}+ { + if (insideCpp) + { + current->type += " constexpr "; + current->spec |= Entry::ConstExpr; + lineCount(); + } + else + { + REJECT; + } + } <FindMembers>{B}*"published"{BN}+ { // UNO IDL published keyword if (insideIDL) { diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 9d1642c..420a653 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -582,6 +582,11 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (md->isStatic()) t << "yes"; else t << "no"; t << "\""; + if (md->isConstExpr()) + { + t << " constexpr=\"yes\""; + } + if (isFunc) { ArgumentList *al = md->argumentList(); diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index 0994c7c..33310aa 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -156,6 +156,7 @@ <xsd:attribute name="volatile" type="DoxBool" use="optional"/> <xsd:attribute name="mutable" type="DoxBool" use="optional"/> <xsd:attribute name="noexcept" type="DoxBool" use="optional"/> + <xsd:attribute name="constexpr" type="DoxBool" use="optional"/> <!-- Qt property --> <xsd:attribute name="readable" type="DoxBool" use="optional"/> <xsd:attribute name="writable" type="DoxBool" use="optional"/> |