aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-03-14 16:24:04 +0100
committerLars Knoll <lars.knoll@qt.io>2018-04-26 20:26:51 +0000
commitc68dc99c92480b7794d4866602fc8a6fb0439a7a (patch)
tree203cfb19cd25d57ac925aa65ccd2810e658cbf8e /src/qml/parser/qqmljsast_p.h
parent2ca47e49a25b92e70f6fa6c7a15cb7102a52435c (diff)
Add support for arrow functions
Arrow parameter lists are tricky and require some reparsing by the standard to avoid conflicts in the parser with expression statements. Add an IsArrowFunction flag to the CompiledData::Function. This information is required in the runtime, when creating Function objects, as it does influence their behaviour in subtle ways. Change-Id: I298801b091f98e30a9269d3c77d9ff94e519dabc 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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index 6c8a5c7af6..db41528a02 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -1327,7 +1327,7 @@ public:
void accept0(Visitor *visitor) override;
SourceLocation firstSourceLocation() const override
- { return statement ? statement->firstSourceLocation() : statement->firstSourceLocation(); }
+ { return statement->firstSourceLocation(); }
SourceLocation lastSourceLocation() const override
{ return next ? next->lastSourceLocation() : statement->lastSourceLocation(); }
@@ -2061,6 +2061,7 @@ public:
// attributes
QStringRef name;
+ bool isArrowFunction = false;
FormalParameterList *formals;
StatementList *body;
SourceLocation functionToken;