aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/messages.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-06 09:59:29 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-09 15:49:23 +0000
commit4ea3fcec20fdd80ae71cd69039e0ecae0a40653e (patch)
treea2364d5452dd232fce7361d4522b5fe2c38cfcc5 /sources/shiboken6/ApiExtractor/messages.cpp
parent3428efa5f69d321bcacdd106b0e724ab99bb63ed (diff)
shiboken6: Replace AddedFunction::TypeInfo by TypeInfo
AddedFunction::TypeInfo was a stripped-down version of the code model's TypeInfo with its own, simplified parser. Replacing it by TypeInfo allows for removing the parser code and the entire AbstractMetaBuilderPrivate::translateType(AddedFunction::TypeInfo) branch. The more powerful TypeParser from the code model can then be used, allowing for more complex types in <add-function> or <declare-function>. As a drive by, replace the AddedFunction constructor by a static factory function, allowing to pass up parse errors. Change-Id: I33ad19e9b5ed30bd27898afe771401ddc98c8c73 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/messages.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/messages.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp
index 65012893a..aca801d53 100644
--- a/sources/shiboken6/ApiExtractor/messages.cpp
+++ b/sources/shiboken6/ApiExtractor/messages.cpp
@@ -114,7 +114,7 @@ static void msgFormatEnumType(Stream &str,
}
QString msgAddedFunctionInvalidArgType(const QString &addedFuncName,
- const QString &typeName,
+ const QStringList &typeName,
int pos, const QString &why,
const AbstractMetaClass *context)
{
@@ -122,20 +122,21 @@ QString msgAddedFunctionInvalidArgType(const QString &addedFuncName,
QTextStream str(&result);
if (context)
str << context->typeEntry()->sourceLocation();
- str << "Unable to translate type \"" << typeName << "\" of argument "
- << pos << " of added function \"" << addedFuncName << "\": " << why;
+ str << "Unable to translate type \"" << typeName.join(colonColon())
+ << "\" of argument " << pos << " of added function \""
+ << addedFuncName << "\": " << why;
return result;
}
QString msgAddedFunctionInvalidReturnType(const QString &addedFuncName,
- const QString &typeName, const QString &why,
+ const QStringList &typeName, const QString &why,
const AbstractMetaClass *context)
{
QString result;
QTextStream str(&result);
if (context)
str << context->typeEntry()->sourceLocation();
- str << "Unable to translate return type \"" << typeName
+ str << "Unable to translate return type \"" << typeName.join(colonColon())
<< "\" of added function \"" << addedFuncName << "\": "
<< why;
return result;