aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/parser')
-rw-r--r--src/qml/parser/qqmljs.g3
-rw-r--r--src/qml/parser/qqmljsast.cpp4
-rw-r--r--src/qml/parser/qqmljsast_p.h6
-rw-r--r--src/qml/parser/qqmljsastfwd_p.h2
-rw-r--r--src/qml/parser/qqmljsastvisitor_p.h2
5 files changed, 10 insertions, 7 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index a825c01092..9264a9502b 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -3092,7 +3092,8 @@ Expression: Expression T_COMMA AssignmentExpression;
Expression_In: Expression_In T_COMMA AssignmentExpression_In;
/.
case $rule_number: {
- AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
+ AST::CommaExpression *node
+ = new (pool) AST::CommaExpression(sym(1).Expression, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp
index f20fe016ff..09e396369a 100644
--- a/src/qml/parser/qqmljsast.cpp
+++ b/src/qml/parser/qqmljsast.cpp
@@ -129,7 +129,7 @@ FormalParameterList *ExpressionNode::reparseAsFormalParameterList(MemoryPool *po
{
AST::ExpressionNode *expr = this;
AST::FormalParameterList *f = nullptr;
- if (AST::Expression *commaExpr = AST::cast<AST::Expression *>(expr)) {
+ if (AST::CommaExpression *commaExpr = AST::cast<AST::CommaExpression *>(expr)) {
f = commaExpr->left->reparseAsFormalParameterList(pool);
if (!f)
return nullptr;
@@ -713,7 +713,7 @@ void ConditionalExpression::accept0(BaseVisitor *visitor)
visitor->endVisit(this);
}
-void Expression::accept0(BaseVisitor *visitor)
+void CommaExpression::accept0(BaseVisitor *visitor)
{
if (visitor->visit(this)) {
accept(left, visitor);
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index a6a0f3a5c0..60ae4028e4 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -1657,12 +1657,12 @@ public:
SourceLocation colonToken;
};
-class QML_PARSER_EXPORT Expression: public ExpressionNode // ### rename
+class QML_PARSER_EXPORT CommaExpression: public ExpressionNode
{
public:
QQMLJS_DECLARE_AST_NODE(Expression)
- Expression(ExpressionNode *l, ExpressionNode *r):
+ CommaExpression(ExpressionNode *l, ExpressionNode *r):
left (l), right (r) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -1678,6 +1678,8 @@ public:
ExpressionNode *right;
SourceLocation commaToken;
};
+// Don't break other users of the parser
+using Expression = CommaExpression;
class QML_PARSER_EXPORT Block: public Statement
{
diff --git a/src/qml/parser/qqmljsastfwd_p.h b/src/qml/parser/qqmljsastfwd_p.h
index c87f67c67e..43179d9f26 100644
--- a/src/qml/parser/qqmljsastfwd_p.h
+++ b/src/qml/parser/qqmljsastfwd_p.h
@@ -72,7 +72,7 @@ class TildeExpression;
class NotExpression;
class BinaryExpression;
class ConditionalExpression;
-class Expression; // ### rename
+class CommaExpression;
class YieldExpression;
class Block;
class LeftHandSideExpression;
diff --git a/src/qml/parser/qqmljsastvisitor_p.h b/src/qml/parser/qqmljsastvisitor_p.h
index 540d21d725..228537ab5a 100644
--- a/src/qml/parser/qqmljsastvisitor_p.h
+++ b/src/qml/parser/qqmljsastvisitor_p.h
@@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
X(NotExpression) \
X(BinaryExpression) \
X(ConditionalExpression) \
- X(Expression) \
+ X(CommaExpression) \
X(Block) \
X(StatementList) \
X(VariableStatement) \