aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-10-17 09:18:06 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-10-19 20:32:01 +0200
commite89a06753c772bd96b3299e03b2f7ad78ffc9fb9 (patch)
tree970133e681a0452ee3a1799925763d240d67030f /src/qml/parser/qqmljsast.cpp
parent0f08e3e673ece32fc9ada041115a0df631b447f3 (diff)
Parser: Simplify argument "lists" for type annotations
There can in fact only be one type argument, and we don't need a finish() method. In fact the finish() method didn't return the type argument at all. Task-number: QTBUG-107171 Change-Id: Ifb7d85ca42a38d37da71b6453b458c7ec10cd64d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsast.cpp')
-rw-r--r--src/qml/parser/qqmljsast.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp
index 1001fd976e..5408f29900 100644
--- a/src/qml/parser/qqmljsast.cpp
+++ b/src/qml/parser/qqmljsast.cpp
@@ -1311,17 +1311,7 @@ void Type::accept0(BaseVisitor *visitor)
{
if (visitor->visit(this)) {
accept(typeId, visitor);
- accept(typeArguments, visitor);
- }
-
- visitor->endVisit(this);
-}
-
-void TypeArgumentList::accept0(BaseVisitor *visitor)
-{
- if (visitor->visit(this)) {
- for (TypeArgumentList *it = this; it; it = it->next)
- accept(it->typeId, visitor);
+ accept(typeArgument, visitor);
}
visitor->endVisit(this);
@@ -1563,17 +1553,11 @@ QString Type::toString() const
void Type::toString(QString *out) const
{
- for (QQmlJS::AST::UiQualifiedId *it = typeId; it; it = it->next) {
- out->append(it->name);
-
- if (it->next)
- out->append(QLatin1Char('.'));
- }
+ typeId->toString(out);
- if (typeArguments) {
+ if (typeArgument) {
out->append(QLatin1Char('<'));
- if (auto subType = static_cast<TypeArgumentList*>(typeArguments)->typeId)
- subType->toString(out);
+ typeArgument->toString(out);
out->append(QLatin1Char('>'));
};
}