summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljscheck.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-10-04 16:11:02 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-07 07:33:58 +0000
commit58d35f8a64445f3540da10ebb7761de0a2a44536 (patch)
tree80319697214833faeb0f04381277cff77b0524a3 /src/libs/qmljs/qmljscheck.cpp
parent979d14525c8b81b4cf337154c46b5ca17c6a7478 (diff)
downloadqt-creator-58d35f8a64445f3540da10ebb7761de0a2a44536.tar.gz
QmlJS: Update QML parser using the one from qtdeclarative 5.15
We need to do this because the new "required" keyword should be recognized by Qt Creator. This is not a verbatim copy of the QML parser from qtdeclarative. A few data structures have changed that would require large scale changes in otherwise unrelated parts of the code. For example, all Visitors need to handle recursion depth errors now and the DiagnosticMessage only has line and column now, no longer begin and legth. Change-Id: Iea5b04e27b07e0cba55d64b844315af9828acbf7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/qmljs/qmljscheck.cpp')
-rw-r--r--src/libs/qmljs/qmljscheck.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index e3fe353b95..dee6053f00 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -66,7 +66,7 @@ public:
return _message;
}
- void setMessage(Type type)
+ void setMessage(StaticAnalysis::Type type)
{
_message = Message(type, _location);
}
@@ -511,7 +511,7 @@ protected:
}
private:
- void addMessage(Type type, const SourceLocation &loc, const QString &arg1 = QString())
+ void addMessage(StaticAnalysis::Type type, const SourceLocation &loc, const QString &arg1 = QString())
{
_messages.append(Message(type, loc, arg1));
}
@@ -695,12 +695,12 @@ QList<Message> Check::operator()()
return _messages;
}
-void Check::enableMessage(Type type)
+void Check::enableMessage(StaticAnalysis::Type type)
{
_enabledMessages.insert(type);
}
-void Check::disableMessage(Type type)
+void Check::disableMessage(StaticAnalysis::Type type)
{
_enabledMessages.remove(type);
}
@@ -1267,7 +1267,7 @@ bool Check::visit(BinaryExpression *ast)
const QLatin1Char newline('\n');
if (ast->op == QSOperator::Add || ast->op == QSOperator::Sub) {
QChar match;
- Type msg;
+ StaticAnalysis::Type msg;
if (ast->op == QSOperator::Add) {
match = '+';
msg = WarnConfusingPluses;
@@ -1522,7 +1522,7 @@ void Check::addMessage(const Message &message)
}
}
-void Check::addMessage(Type type, const SourceLocation &location, const QString &arg1, const QString &arg2)
+void Check::addMessage(StaticAnalysis::Type type, const SourceLocation &location, const QString &arg1, const QString &arg2)
{
addMessage(Message(type, location, arg1, arg2));
}