diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-01 14:23:27 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-05 14:58:36 +0200 |
commit | d200ccf92017ebc10a4ccdb5d944e1d803b87c1d (patch) | |
tree | 1dc85350482238423143ac71740b834fa6e8d240 /tools/qmllint/checkidentifiers.cpp | |
parent | 767dd738d3de9306062707fe05d32c91ed755da3 (diff) |
QmlCompiler: Rename ScopeTree to QQmlJSScope
That is a better name.
Change-Id: I34a6867692a236dd16ed8e3a68866f994eab02d2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/checkidentifiers.cpp')
-rw-r--r-- | tools/qmllint/checkidentifiers.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp index c47a3beb36..e5337df195 100644 --- a/tools/qmllint/checkidentifiers.cpp +++ b/tools/qmllint/checkidentifiers.cpp @@ -84,12 +84,12 @@ void CheckIdentifiers::printContext( + QLatin1Char('\n'), Normal); } -static bool walkViaParentAndAttachedScopes(ScopeTree::ConstPtr rootType, - std::function<bool(ScopeTree::ConstPtr)> visit) +static bool walkViaParentAndAttachedScopes(QQmlJSScope::ConstPtr rootType, + std::function<bool(QQmlJSScope::ConstPtr)> visit) { if (rootType == nullptr) return false; - std::stack<ScopeTree::ConstPtr> stack; + std::stack<QQmlJSScope::ConstPtr> stack; stack.push(rootType); while (!stack.empty()) { const auto type = stack.top(); @@ -108,7 +108,7 @@ static bool walkViaParentAndAttachedScopes(ScopeTree::ConstPtr rootType, } bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members, - const ScopeTree::ConstPtr &outerScope, + const QQmlJSScope::ConstPtr &outerScope, const MetaProperty *prop) const { @@ -121,7 +121,7 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members, expectedNext.append(QLatin1String("length")); } - ScopeTree::ConstPtr scope = outerScope; + QQmlJSScope::ConstPtr scope = outerScope; for (const FieldMember &access : members) { if (scope.isNull()) { writeWarning(m_colorOut); @@ -206,7 +206,7 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members, if (scopeMethodIt != methods.end()) return true; // Access to property of JS function - auto checkEnums = [&](const ScopeTree::ConstPtr &scope) { + auto checkEnums = [&](const QQmlJSScope::ConstPtr &scope) { const auto enums = scope->enums(); for (const auto &enumerator : enums) { if (enumerator.name() == access.m_name) { @@ -231,14 +231,14 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members, if (!detectedRestrictiveName.isEmpty()) continue; - ScopeTree::ConstPtr rootType; + QQmlJSScope::ConstPtr rootType; if (!access.m_parentType.isEmpty()) rootType = m_types.value(access.m_parentType); else rootType = scope; bool typeFound = - walkViaParentAndAttachedScopes(rootType, [&](ScopeTree::ConstPtr type) { + walkViaParentAndAttachedScopes(rootType, [&](QQmlJSScope::ConstPtr type) { const auto typeProperties = type->properties(); const auto typeIt = typeProperties.find(access.m_name); if (typeIt != typeProperties.end()) { @@ -287,18 +287,18 @@ bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members, } bool CheckIdentifiers::operator()( - const QHash<QString, ScopeTree::ConstPtr> &qmlIDs, + const QHash<QString, QQmlJSScope::ConstPtr> &qmlIDs, const QHash<QQmlJS::SourceLocation, SignalHandler> &signalHandlers, const MemberAccessChains &memberAccessChains, - const ScopeTree::ConstPtr &root, const QString &rootId) const + const QQmlJSScope::ConstPtr &root, const QString &rootId) const { bool noUnqualifiedIdentifier = true; // revisit all scopes - QQueue<ScopeTree::ConstPtr> workQueue; + QQueue<QQmlJSScope::ConstPtr> workQueue; workQueue.enqueue(root); while (!workQueue.empty()) { - const ScopeTree::ConstPtr currentScope = workQueue.dequeue(); + const QQmlJSScope::ConstPtr currentScope = workQueue.dequeue(); const auto scopeMemberAccessChains = memberAccessChains[currentScope]; for (auto memberAccessChain : scopeMemberAccessChains) { @@ -333,7 +333,7 @@ bool CheckIdentifiers::operator()( } } - auto qmlScope = ScopeTree::findCurrentQMLScope(currentScope); + auto qmlScope = QQmlJSScope::findCurrentQMLScope(currentScope); if (qmlScope->methods().contains(memberAccessBase.m_name)) { // a property of a JavaScript function continue; |