aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser
diff options
context:
space:
mode:
authorMoody Liu <mooodyhunter@outlook.com>2022-06-23 17:10:52 +0100
committerMoody Liu <mooodyhunter@outlook.com>2022-06-24 23:30:47 +0000
commita32a713ff68b3a1c85ad09b28caaf1dd87d3d410 (patch)
tree940fc969066c3e64c15ce9d2a436cf6028e91c1b /src/qml/parser
parent0d48b7045a2dd3d3000dde993a6acdcdd28bc1bf (diff)
qmlast: add missing tokens for enum declaration
this adds possibility for qmlls to highlight an enum name Change-Id: If802bfa3afd8bdcd5eed894fce50bad5907464bf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/parser')
-rw-r--r--src/qml/parser/qqmljs.g2
-rw-r--r--src/qml/parser/qqmljsast_p.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index 93d110c19f..c87bfa09ad 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -1443,6 +1443,8 @@ UiObjectMember: T_ENUM T_IDENTIFIER T_LBRACE EnumMemberList T_RBRACE;
case $rule_number: {
AST::UiEnumDeclaration *enumDeclaration = new (pool) AST::UiEnumDeclaration(stringRef(2), sym(4).UiEnumMemberList->finish());
enumDeclaration->enumToken = loc(1);
+ enumDeclaration->identifierToken = loc(2);
+ enumDeclaration->lbraceToken = loc(3);
enumDeclaration->rbraceToken = loc(5);
sym(1).Node = enumDeclaration;
break;
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index dbafcca99a..add82189b2 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -3706,6 +3706,8 @@ public:
// attributes
SourceLocation enumToken;
+ SourceLocation identifierToken;
+ SourceLocation lbraceToken;
SourceLocation rbraceToken;
QStringView name;
UiEnumMemberList *members;