diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-03-22 16:34:05 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-27 08:11:28 +0000 |
commit | 02252ae08dc36ba44f65fb932c428849c7369299 (patch) | |
tree | 5c7627b08cce5bfa2df5e04b3427bcc93ef2b2fe /src/qml/compiler/qv4compilerscanfunctions_p.h | |
parent | e07a03365ad07cd4294f487b15a57f31bd0a3d40 (diff) |
Rework the AST for Literals and destructuring expressions
Array/ObjectLiterals and destructuring expressions are
syntactically very similar. In some cases (when using
a destructuring expression as the lhs of an assigment),
the parser needs to convert the literal into a destructuring
expression.
To support these, use the same data structures for both in
the AST. Those Patterns can be converted with little
additional work from a Literal to an AssignmentPattern and
be used in all places where we need destructuring in addition
to literals.
Change-Id: I177599b46eab0f6e8cb2a40c3b3b11ed00a07d6a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions_p.h')
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions_p.h b/src/qml/compiler/qv4compilerscanfunctions_p.h index 8ab6bbbe8d..b479b65e6c 100644 --- a/src/qml/compiler/qv4compilerscanfunctions_p.h +++ b/src/qml/compiler/qv4compilerscanfunctions_p.h @@ -117,8 +117,8 @@ protected: bool visit(AST::ObjectPattern *ast) override; - bool visit(AST::PropertyGetterSetter *ast) override; - void endVisit(AST::PropertyGetterSetter *) override; + bool visit(AST::PatternProperty *ast) override; + void endVisit(AST::PatternProperty *) override; bool visit(AST::FunctionDeclaration *ast) override; void endVisit(AST::FunctionDeclaration *) override; |