aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2026-09-26 12:04:44 +0200
committerOlivier De Cannière <olivier.decanniere@qt.io>2026-10-01 10:56:07 +0000
commit420703a10d5990151ba5608eda74086eda351dce (patch)
tree3aaace20030c457ab35e8d2f90208cc15c5b9056
parentd33ed93fccc6cd187534736113b5c5df5cb48080 (diff)
Parser: Cleanup AST token kinds
Rename Expression to CommaExpression and Module to ESModule to better express their purpose. Remove unused kinds. Task-number: QTBUG-151040 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Change-Id: Icebd15cc791a4b39ceb3de62d53583a769fda4a7 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
-rw-r--r--src/qml/parser/qqmljsast_p.h14
-rw-r--r--src/qmldom/qqmldomcomments.cpp3
2 files changed, 4 insertions, 13 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index b3fed17246..5acea17b2a 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -132,10 +132,9 @@ public:
Kind_DefaultClause,
Kind_DeleteExpression,
Kind_DoWhileStatement,
- Kind_ElementList,
Kind_Elision,
Kind_EmptyStatement,
- Kind_Expression,
+ Kind_CommaExpression,
Kind_ExpressionStatement,
Kind_FalseLiteral,
Kind_SuperLiteral,
@@ -144,7 +143,6 @@ public:
Kind_ForEachStatement,
Kind_ForStatement,
Kind_FormalParameterList,
- Kind_FunctionBody,
Kind_FunctionDeclaration,
Kind_FunctionExpression,
Kind_ClassExpression,
@@ -162,7 +160,7 @@ public:
Kind_ImportClause,
Kind_FromClause,
Kind_ImportDeclaration,
- Kind_Module,
+ Kind_ESModule,
Kind_ExportSpecifier,
Kind_ExportsList,
Kind_ExportClause,
@@ -180,10 +178,7 @@ public:
Kind_PreDecrementExpression,
Kind_PreIncrementExpression,
Kind_Program,
- Kind_PropertyDefinitionList,
- Kind_PropertyGetterSetter,
Kind_PropertyName,
- Kind_PropertyNameAndValue,
Kind_RegExpLiteral,
Kind_ReturnStatement,
Kind_StatementList,
@@ -214,7 +209,6 @@ public:
Kind_PatternProperty,
Kind_PatternPropertyList,
Kind_Type,
- Kind_TypeArgument,
Kind_TypeAnnotation,
Kind_UiArrayBinding,
@@ -1675,7 +1669,7 @@ public:
class QML_PARSER_EXPORT CommaExpression: public ExpressionNode
{
public:
- QQMLJS_DECLARE_AST_NODE(Expression)
+ QQMLJS_DECLARE_AST_NODE(CommaExpression)
CommaExpression(ExpressionNode *l, ExpressionNode *r):
left (l), right (r) { kind = K; }
@@ -3036,7 +3030,7 @@ public:
class QML_PARSER_EXPORT ESModule: public Node
{
public:
- QQMLJS_DECLARE_AST_NODE(Module)
+ QQMLJS_DECLARE_AST_NODE(ESModule)
ESModule(StatementList *body)
: body(body)
diff --git a/src/qmldom/qqmldomcomments.cpp b/src/qmldom/qqmldomcomments.cpp
index c450333a97..eeef08153c 100644
--- a/src/qmldom/qqmldomcomments.cpp
+++ b/src/qmldom/qqmldomcomments.cpp
@@ -596,17 +596,14 @@ const QSet<int> AstRangesVisitor::kindsToSkip()
{
static QSet<int> res = QSet<int>({
AST::Node::Kind_ArgumentList,
- AST::Node::Kind_ElementList,
AST::Node::Kind_FormalParameterList,
AST::Node::Kind_ImportsList,
AST::Node::Kind_ExportsList,
- AST::Node::Kind_PropertyDefinitionList,
AST::Node::Kind_StatementList,
AST::Node::Kind_VariableDeclarationList,
AST::Node::Kind_ClassElementList,
AST::Node::Kind_PatternElementList,
AST::Node::Kind_PatternPropertyList,
- AST::Node::Kind_TypeArgument,
})
.unite(VisitAll::uiKinds());
return res;