diff options
Diffstat (limited to 'src/qml')
| -rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 2 | ||||
| -rw-r--r-- | src/qml/compiler/qv4codegen_p.h | 2 | ||||
| -rw-r--r-- | src/qml/parser/qqmljs.g | 3 | ||||
| -rw-r--r-- | src/qml/parser/qqmljsast.cpp | 4 | ||||
| -rw-r--r-- | src/qml/parser/qqmljsast_p.h | 6 | ||||
| -rw-r--r-- | src/qml/parser/qqmljsastfwd_p.h | 2 | ||||
| -rw-r--r-- | src/qml/parser/qqmljsastvisitor_p.h | 2 |
7 files changed, 12 insertions, 9 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 48807ad480..24672c367f 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -1144,7 +1144,7 @@ bool Codegen::visit(ClassDeclaration *ast) return false; } -bool Codegen::visit(Expression *ast) +bool Codegen::visit(CommaExpression *ast) { if (hasError()) return false; diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index 52ac2c546a..c65131ace3 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -623,12 +623,12 @@ protected: bool visit(QQmlJS::AST::TypeAnnotation *ast) override; // expressions - bool visit(QQmlJS::AST::Expression *ast) override; bool visit(QQmlJS::AST::ArrayPattern *ast) override; bool visit(QQmlJS::AST::ArrayMemberExpression *ast) override; bool visit(QQmlJS::AST::BinaryExpression *ast) override; bool visit(QQmlJS::AST::CallExpression *ast) override; void endVisit(QQmlJS::AST::CallExpression *ast) override; + bool visit(QQmlJS::AST::CommaExpression *ast) override; bool visit(QQmlJS::AST::ConditionalExpression *ast) override; bool visit(QQmlJS::AST::DeleteExpression *ast) override; void endVisit(QQmlJS::AST::DeleteExpression *ast) override; 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) \ |
