aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-05-10 22:25:46 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-11 07:17:26 +0000
commite203a868470ab2e435111127f00530f4d8cc581d (patch)
treeff7313f90b62b6953ac8369dbd93600bcbe437ff /src/qml/parser/qqmljsast_p.h
parente3b9726483cb7336aa54ae7d9455becbd148b2b6 (diff)
Unify AST for the different 'for' statements
Change-Id: I70ca83b0ce933d64dad4984a236e48592e989742 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsast_p.h')
-rw-r--r--src/qml/parser/qqmljsast_p.h33
1 files changed, 4 insertions, 29 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index 9ed7ba79e5..91d6410132 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -174,7 +174,6 @@ public:
Kind_ComputedPropertyName,
Kind_IfStatement,
Kind_LabelledStatement,
- Kind_LocalForStatement,
Kind_NewExpression,
Kind_NewMemberExpression,
Kind_NotExpression,
@@ -1650,35 +1649,11 @@ public:
initialiser (i), condition (c), expression (e), statement (stmt)
{ kind = K; }
- void accept0(Visitor *visitor) override;
-
- SourceLocation firstSourceLocation() const override
- { return forToken; }
-
- SourceLocation lastSourceLocation() const override
- { return statement->lastSourceLocation(); }
-
-// attributes
- ExpressionNode *initialiser;
- ExpressionNode *condition;
- ExpressionNode *expression;
- Statement *statement;
- SourceLocation forToken;
- SourceLocation lparenToken;
- SourceLocation firstSemicolonToken;
- SourceLocation secondSemicolonToken;
- SourceLocation rparenToken;
-};
-
-class QML_PARSER_EXPORT LocalForStatement: public Statement
-{
-public:
- QQMLJS_DECLARE_AST_NODE(LocalForStatement)
-
- LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
+ ForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
declarations (vlist), condition (c), expression (e), statement (stmt)
{ kind = K; }
+
void accept0(Visitor *visitor) override;
SourceLocation firstSourceLocation() const override
@@ -1688,13 +1663,13 @@ public:
{ return statement->lastSourceLocation(); }
// attributes
- VariableDeclarationList *declarations;
+ ExpressionNode *initialiser = nullptr;
+ VariableDeclarationList *declarations = nullptr;
ExpressionNode *condition;
ExpressionNode *expression;
Statement *statement;
SourceLocation forToken;
SourceLocation lparenToken;
- SourceLocation varToken;
SourceLocation firstSemicolonToken;
SourceLocation secondSemicolonToken;
SourceLocation rparenToken;