diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-09-30 14:44:24 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-02 15:33:10 +0200 |
commit | 7957752447fbd2581521b13156ef29ffc80ad7bf (patch) | |
tree | 05a669e525b4eadc706fff3cbd40f6da9602f23d /src | |
parent | b078890608344f0556a0ff50aab62ede83e0e180 (diff) |
qmllint: Unify injected and "normal" JavaScript identifiers
The specifics of how to warn about the injected identifiers are moved
out of ScopeTree as that is not related to the structure of the scopes.
Change-Id: I26418c3fa492da8339abf045a4034a8464b7bbb8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/common/qqmljssourcelocation_p.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qml/common/qqmljssourcelocation_p.h b/src/qml/common/qqmljssourcelocation_p.h index 7c75541eb1..ba183f394e 100644 --- a/src/qml/common/qqmljssourcelocation_p.h +++ b/src/qml/common/qqmljssourcelocation_p.h @@ -41,6 +41,7 @@ #define QQMLJSSOURCELOCATION_P_H #include <QtCore/qglobal.h> +#include <QtCore/qhashfunctions.h> // // W A R N I N G @@ -76,6 +77,18 @@ public: quint32 length; quint32 startLine; quint32 startColumn; + + friend size_t qHash(const SourceLocation &location, size_t seed = 0) + { + return qHashMulti(seed, location.offset, location.length, + location.startLine, location.startColumn); + } + + friend bool operator==(const SourceLocation &a, const SourceLocation &b) + { + return a.offset == b.offset && a.length == b.length + && a.startLine == b.startLine && a.startColumn == b.startColumn; + } }; } // namespace QQmlJS |