diff options
-rw-r--r-- | sources/shiboken6/ApiExtractor/modifications.cpp | 33 | ||||
-rw-r--r-- | sources/shiboken6/ApiExtractor/modifications.h | 3 |
2 files changed, 27 insertions, 9 deletions
diff --git a/sources/shiboken6/ApiExtractor/modifications.cpp b/sources/shiboken6/ApiExtractor/modifications.cpp index 8c6f31187..a1c8eabbc 100644 --- a/sources/shiboken6/ApiExtractor/modifications.cpp +++ b/sources/shiboken6/ApiExtractor/modifications.cpp @@ -428,17 +428,29 @@ QDebug operator<<(QDebug d, const CodeSnip &s) QDebugStateSaver saver(d); d.noquote(); d.nospace(); - d << "CodeSnip(language=" << s.language << ", position=" << s.position << ", \""; - for (const auto &f : s.codeList) { - const QString &code = f.code(); - const auto lines = QStringView{code}.split(QLatin1Char('\n')); - for (int i = 0, size = lines.size(); i < size; ++i) { - if (i) - d << "\\n"; - d << lines.at(i).trimmed(); + const auto size = s.codeList.size(); + d << "CodeSnip(language=" << s.language << ", position=" << s.position + << ", fragments[" << size << "]="; + for (qsizetype i = 0; i < size; ++i) { + const auto &f = s.codeList.at(i); + if (i) + d << ", "; + d << '#' << i << ' '; + if (f.instance().isNull()) { + d << '"'; + const QString &code = f.code(); + const auto lines = QStringView{code}.split(QLatin1Char('\n')); + for (int i = 0, size = lines.size(); i < size; ++i) { + if (i) + d << "\\n"; + d << lines.at(i).trimmed(); + } + d << '"'; + } else { + d << "template=\"" << f.instance()->name() << '"'; } } - d << "\")"; + d << ')'; return d; } @@ -906,6 +918,9 @@ QDebug operator<<(QDebug d, const ArgumentModification &a) d << ", native ownership=" << a.nativeOwnership(); if (!a.renamedToName().isEmpty()) d << ", renamed_to=\"" << a.renamedToName() << '"'; + const auto &rules = a.conversionRules(); + if (!rules.isEmpty()) + d << ", conversionRules[" << rules.size() << "]=" << rules; d << ", owner=" << a.owner() << ')'; return d; } diff --git a/sources/shiboken6/ApiExtractor/modifications.h b/sources/shiboken6/ApiExtractor/modifications.h index c8c8579df..3435c9737 100644 --- a/sources/shiboken6/ApiExtractor/modifications.h +++ b/sources/shiboken6/ApiExtractor/modifications.h @@ -118,6 +118,8 @@ public: QString code() const; + TemplateInstancePtr instance() const { return m_instance; } + private: QString m_code; QSharedPointer<TemplateInstance> m_instance; @@ -373,6 +375,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(FunctionModification::Modifiers) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug d, const ReferenceCount &); +QDebug operator<<(QDebug d, const CodeSnip &s); QDebug operator<<(QDebug d, const ArgumentOwner &a); QDebug operator<<(QDebug d, const ArgumentModification &a); QDebug operator<<(QDebug d, const FunctionModification &fm); |