Files
qt-creator/src/libs/qmljs/parser/grammar.patch
Fawzi Mohamed 2f13810633 qmljs: update gen-parser.sh and related patches
ensure that the script works with the current source
* update manual patches
* use reverse patches to simplify updating procedure
* describe updating procedure

Change-Id: I23f8ee5bd73506df03b8b6b75e535170dff5f2b5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-07-20 09:02:25 +00:00

57 lines
2.0 KiB
Diff

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:
inline DiagnosticMessage diagnosticMessage() const
{
for (const DiagnosticMessage &d : diagnostic_messages) {
- if (d.kind != Severity::Warning)
+ if (d.type != QtWarningMsg)
return d;
}
@@ -424,7 +424,7 @@ protected:
DiagnosticMessage error;
error.loc = location;
error.message = message;
- error.kind = DiagnosticMessage::qtMsgTypeToKind(kind);
+ error.type = kind;
return error;
}
@@ -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.")));