From 1b866db65eb45ff347b51a2bc3b08d2a0bc166d6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 22 Jan 2019 14:20:18 +0100 Subject: Fix internal boundNames() API to expose optional types This allows extracting the type information for variable declarations. Change-Id: I1241df3b27ae292b83392d5caaa1587caafa46a3 Reviewed-by: Ulf Hermann --- src/qml/parser/qqmljsast.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/qml/parser/qqmljsast.cpp') diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp index de5db73d3f..f68381ce44 100644 --- a/src/qml/parser/qqmljsast.cpp +++ b/src/qml/parser/qqmljsast.cpp @@ -1003,9 +1003,9 @@ QStringList FormalParameterList::formals() const return formals; } -QStringList FormalParameterList::boundNames() const +BoundNames FormalParameterList::boundNames() const { - QStringList names; + BoundNames names; for (const FormalParameterList *it = this; it; it = it->next) { if (it->element) it->element->boundNames(&names); @@ -1377,7 +1377,7 @@ void PatternElement::accept0(Visitor *visitor) visitor->endVisit(this); } -void PatternElement::boundNames(QStringList *names) +void PatternElement::boundNames(BoundNames *names) { if (bindingTarget) { if (PatternElementList *e = elementList()) @@ -1385,7 +1385,7 @@ void PatternElement::boundNames(QStringList *names) else if (PatternPropertyList *p = propertyList()) p->boundNames(names); } else { - names->append(bindingIdentifier.toString()); + names->append({bindingIdentifier.toString(), typeAnnotation}); } } @@ -1401,7 +1401,7 @@ void PatternElementList::accept0(Visitor *visitor) visitor->endVisit(this); } -void PatternElementList::boundNames(QStringList *names) +void PatternElementList::boundNames(BoundNames *names) { for (PatternElementList *it = this; it; it = it->next) { if (it->element) @@ -1421,7 +1421,7 @@ void PatternProperty::accept0(Visitor *visitor) visitor->endVisit(this); } -void PatternProperty::boundNames(QStringList *names) +void PatternProperty::boundNames(BoundNames *names) { PatternElement::boundNames(names); } @@ -1437,7 +1437,7 @@ void PatternPropertyList::accept0(Visitor *visitor) visitor->endVisit(this); } -void PatternPropertyList::boundNames(QStringList *names) +void PatternPropertyList::boundNames(BoundNames *names) { for (PatternPropertyList *it = this; it; it = it->next) it->property->boundNames(names); -- cgit v1.2.3