aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/parser/qqmljsast.cpp')
-rw-r--r--src/qml/parser/qqmljsast.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp
index f43956814a..6b315c9140 100644
--- a/src/qml/parser/qqmljsast.cpp
+++ b/src/qml/parser/qqmljsast.cpp
@@ -1166,6 +1166,10 @@ void ModuleItemList::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
for (ModuleItemList *it = this; it; it = it->next) {
+ // The statement list is concatenated together between module list
+ // items and stored in the ESModule, thus not visited from there.
+ if (it->item && it->item->kind == Kind_StatementList)
+ continue;
accept(it->item, visitor);
}
}
@@ -1173,10 +1177,29 @@ void ModuleItemList::accept0(Visitor *visitor)
visitor->endVisit(this);
}
+StatementList *ModuleItemList::buildStatementList() const
+{
+ StatementList *statements = nullptr;
+ for (const ModuleItemList *item = this; item; item = item->next) {
+ AST::StatementList *listItem = AST::cast<AST::StatementList*>(item->item);
+ if (!listItem)
+ continue;
+ if (statements)
+ statements = statements->append(listItem);
+ else
+ statements = listItem;
+ }
+ if (statements)
+ statements = statements->finish();
+ return statements;
+}
+
+
void ESModule::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(body, visitor);
+ accept(statements, visitor);
}
visitor->endVisit(this);