diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-11 12:53:27 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-11 13:03:29 +0000 |
commit | 434b5b0cc2c44d0224281bbdb234976483500b44 (patch) | |
tree | e64206bee9a6e07e7d8c945db79f63c5102f7f52 | |
parent | f5beedff19edbacb60cf1a8bb3d26804b50925d5 (diff) |
shiboken6: Remove <argument-map> and "associated-to"
The element <argument-map> appears to be related to code snippets, but
it is neither documented nor used anywhere.
The attribute "associated-to" is also unused.
Change-Id: Ib567d5391d0ee5284db5a38db4a4e803bf569ef4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r-- | sources/shiboken6/ApiExtractor/modifications.cpp | 11 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/modifications.h | 5 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystemparser.cpp | 52 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystemparser.h | 3 |
4 files changed, 1 insertions, 70 deletions
diff --git a/sources/shiboken6/ApiExtractor/modifications.cpp b/sources/shiboken6/ApiExtractor/modifications.cpp index 3f8b1e71f..625ae3f4e 100644 --- a/sources/shiboken6/ApiExtractor/modifications.cpp +++ b/sources/shiboken6/ApiExtractor/modifications.cpp @@ -381,14 +381,7 @@ QDebug operator<<(QDebug d, const CodeSnip &s) d << lines.at(i).trimmed(); } } - d << '"'; - if (!s.argumentMap.isEmpty()) { - d << ", argumentMap{"; - for (auto it = s.argumentMap.cbegin(), end = s.argumentMap.cend(); it != end; ++it) - d << it.key() << "->\"" << it.value() << '"'; - d << '}'; - } - d << ')'; + d << "\")"; return d; } @@ -409,8 +402,6 @@ void FunctionModification::formatDebug(QDebug &d) const d << "signature=\"" << m_signature; d << "\", "; Modification::formatDebug(d); - if (!association.isEmpty()) - d << ", association=\"" << association << '"'; if (m_allowThread != TypeSystem::AllowThread::Unspecified) d << ", allowThread=" << int(m_allowThread); if (m_thread) diff --git a/sources/shiboken6/ApiExtractor/modifications.h b/sources/shiboken6/ApiExtractor/modifications.h index ecb464773..7794c1a15 100644 --- a/sources/shiboken6/ApiExtractor/modifications.h +++ b/sources/shiboken6/ApiExtractor/modifications.h @@ -34,7 +34,6 @@ #include "parser/typeinfo.h" #include <QtCore/QList> -#include <QtCore/QMap> #include <QtCore/QRegularExpression> #include <QtCore/QSharedPointer> #include <QtCore/QString> @@ -43,8 +42,6 @@ QT_BEGIN_NAMESPACE class QDebug; QT_END_NAMESPACE -using ArgumentMap = QMap<int, QString>; - class TemplateInstance { public: @@ -169,7 +166,6 @@ public: TypeSystem::Language language = TypeSystem::TargetLangCode; TypeSystem::CodeSnipPosition position = TypeSystem::CodeSnipPositionAny; - ArgumentMap argumentMap; }; struct ArgumentModification @@ -351,7 +347,6 @@ struct FunctionModification: public Modification void formatDebug(QDebug &d) const; #endif - QString association; CodeSnipList snips; QList<ArgumentModification> argument_mods; diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp index 04ecb4c93..9ea253b34 100644 --- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp @@ -344,7 +344,6 @@ ENUM_LOOKUP_BEGIN(StackElement::ElementType, Qt::CaseInsensitive, {u"access", StackElement::Access}, // sorted! {u"add-conversion", StackElement::AddConversion}, {u"add-function", StackElement::AddFunction}, - {u"argument-map", StackElement::ArgumentMap}, {u"array", StackElement::Array}, {u"container-type", StackElement::ContainerTypeEntry}, {u"conversion-rule", StackElement::ConversionRule}, @@ -2063,43 +2062,6 @@ bool TypeSystemParser::parseDefineOwnership(const QXmlStreamReader &, return true; } -bool TypeSystemParser::parseArgumentMap(const QXmlStreamReader &, - const StackElement &topElement, - QXmlStreamAttributes *attributes) -{ - if (!(topElement.type & StackElement::CodeSnipMask)) { - m_error = QLatin1String("Argument maps requires code injection as parent"); - return false; - } - - int pos = 1; - QString metaName; - for (int i = attributes->size() - 1; i >= 0; --i) { - const auto name = attributes->at(i).qualifiedName(); - if (name == indexAttribute()) { - if (!parseIndex(attributes->takeAt(i).value().toString(), &pos, &m_error)) - return false; - if (pos <= 0) { - m_error = QStringLiteral("Argument position %1 must be a positive number").arg(pos); - return false; - } - } else if (name == QLatin1String("meta-name")) { - metaName = attributes->takeAt(i).value().toString(); - } - } - - if (metaName.isEmpty()) - qCWarning(lcShiboken) << "Empty meta name in argument map"; - - if (topElement.type == StackElement::InjectCodeInFunction) { - m_contextStack.top()->functionMods.last().snips.last().argumentMap[pos] = metaName; - } else { - qCWarning(lcShiboken) << "Argument maps are only useful for injection of code " - "into functions."; - } - return true; -} - bool TypeSystemParser::parseRemoval(const QXmlStreamReader &, const StackElement &topElement, QXmlStreamAttributes *attributes) @@ -2351,7 +2313,6 @@ bool TypeSystemParser::parseModifyFunction(const QXmlStreamReader &reader, QString access; QString removal; QString rename; - QString association; bool deprecated = false; bool isThread = false; int overloadNumber = TypeSystem::OverloadNumberUnset; @@ -2365,10 +2326,6 @@ bool TypeSystemParser::parseModifyFunction(const QXmlStreamReader &reader, access = attributes->takeAt(i).value().toString(); } else if (name == renameAttribute()) { rename = attributes->takeAt(i).value().toString(); - } else if (name == QLatin1String("associated-to")) { - association = attributes->takeAt(i).value().toString(); - qCWarning(lcShiboken, "%s", - qPrintable(msgUnimplementedAttributeWarning(reader, name))); } else if (name == removeAttribute()) { removal = attributes->takeAt(i).value().toString(); } else if (name == deprecatedAttribute()) { @@ -2445,9 +2402,6 @@ bool TypeSystemParser::parseModifyFunction(const QXmlStreamReader &reader, mod.modifiers |= Modification::Rename; } - if (!association.isEmpty()) - mod.association = association; - mod.setIsThread(isThread); if (allowThread != TypeSystem::AllowThread::Unspecified) mod.setAllowThread(allowThread); @@ -3074,12 +3028,6 @@ bool TypeSystemParser::startElement(const QXmlStreamReader &reader) } } break; - case StackElement::ArgumentMap: - qCWarning(lcShiboken, "%s", - qPrintable(msgUnimplementedElementWarning(reader, tagName))); - if (!parseArgumentMap(reader, topElement, &attributes)) - return false; - break; case StackElement::Removal: if (!parseRemoval(reader, topElement, &attributes)) return false; diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.h b/sources/shiboken6/ApiExtractor/typesystemparser.h index d85825552..af310d8dc 100644 --- a/sources/shiboken6/ApiExtractor/typesystemparser.h +++ b/sources/shiboken6/ApiExtractor/typesystemparser.h @@ -77,7 +77,6 @@ class StackElement Root = 0x0500, CustomMetaConstructor = 0x0600, CustomMetaDestructor = 0x0700, - ArgumentMap = 0x0800, SuppressedWarning = 0x0900, Rejection = 0x0a00, LoadTypesystem = 0x0b00, @@ -227,8 +226,6 @@ private: QXmlStreamAttributes *attributes); bool parseDefineOwnership(const QXmlStreamReader &, const StackElement &topElement, QXmlStreamAttributes *); - bool parseArgumentMap(const QXmlStreamReader &, const StackElement &topElement, - QXmlStreamAttributes *); bool parseRemoval(const QXmlStreamReader &, const StackElement &topElement, QXmlStreamAttributes *); bool parseRename(const QXmlStreamReader &, StackElement::ElementType type, |