2021-07-07 10:46:16 +02:00
|
|
|
diff --git a/src/libs/qmljs/parser/qmljs.g b/src/libs/qmljs/parser/qmljs.g
|
|
|
|
|
index ae79830d2e..32a2f6f4b0 100644
|
|
|
|
|
--- a/src/libs/qmljs/parser/qmljs.g
|
|
|
|
|
+++ b/src/libs/qmljs/parser/qmljs.g
|
|
|
|
|
@@ -380,7 +380,7 @@ public:
|
2020-02-28 17:51:32 +01:00
|
|
|
inline DiagnosticMessage diagnosticMessage() const
|
|
|
|
|
{
|
|
|
|
|
for (const DiagnosticMessage &d : diagnostic_messages) {
|
2021-07-07 10:46:16 +02:00
|
|
|
- if (d.kind != Severity::Warning)
|
|
|
|
|
+ if (d.type != QtWarningMsg)
|
2020-02-28 17:51:32 +01:00
|
|
|
return d;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-07 10:46:16 +02:00
|
|
|
@@ -424,7 +424,7 @@ protected:
|
2020-02-28 17:51:32 +01:00
|
|
|
DiagnosticMessage error;
|
|
|
|
|
error.loc = location;
|
|
|
|
|
error.message = message;
|
2021-07-07 10:46:16 +02:00
|
|
|
- error.kind = DiagnosticMessage::qtMsgTypeToKind(kind);
|
|
|
|
|
+ error.type = kind;
|
2020-02-28 17:51:32 +01:00
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-07 10:46:16 +02:00
|
|
|
@@ -445,8 +445,8 @@ protected:
|
|
|
|
|
Value *sym_stack = nullptr;
|
|
|
|
|
int *state_stack = nullptr;
|
|
|
|
|
SourceLocation *location_stack = nullptr;
|
|
|
|
|
- QVector<QStringView> string_stack;
|
|
|
|
|
- QVector<QStringView> rawString_stack;
|
|
|
|
|
+ QList<QStringView> string_stack;
|
|
|
|
|
+ QList<QStringView> rawString_stack;
|
|
|
|
|
|
|
|
|
|
AST::Node *program = nullptr;
|
|
|
|
|
|
|
|
|
|
@@ -838,7 +838,7 @@ UiVersionSpecifier: T_VERSION_NUMBER T_DOT T_VERSION_NUMBER;
|
|
|
|
|
case $rule_number: {
|
|
|
|
|
const int major = sym(1).dval;
|
|
|
|
|
const int minor = sym(3).dval;
|
|
|
|
|
- if (major < 0 || major >= 255 || minor < 0 || minor >= 255) {
|
|
|
|
|
+ if (!QTypeRevision::isValidSegment(major) || !QTypeRevision::isValidSegment(minor)) {
|
|
|
|
|
diagnostic_messages.append(
|
|
|
|
|
compileError(loc(1),
|
|
|
|
|
QLatin1String("Invalid version. Version numbers must be >= 0 and < 255.")));
|
|
|
|
|
@@ -851,11 +851,12 @@ UiVersionSpecifier: T_VERSION_NUMBER T_DOT T_VERSION_NUMBER;
|
|
|
|
|
} break;
|
|
|
|
|
./
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
UiVersionSpecifier: T_VERSION_NUMBER;
|
|
|
|
|
/.
|
|
|
|
|
case $rule_number: {
|
|
|
|
|
const int major = sym(1).dval;
|
|
|
|
|
- if (major < 0 || major >= 255) {
|
|
|
|
|
+ if (!QTypeRevision::isValidSegment(major)) {
|
|
|
|
|
diagnostic_messages.append(
|
|
|
|
|
compileError(loc(1),
|
|
|
|
|
QLatin1String("Invalid major version. Version numbers must be >= 0 and < 255.")));
|