diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-02-09 20:22:09 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-25 17:49:03 +0000 |
commit | 2683a22364f742e3809b6c48570b0b4aaf37b31f (patch) | |
tree | aff06f7313424ee8481da880168b7129455e6bc9 /src/qml/parser/qqmljsast_p.h | |
parent | dad5d1cc82a57a4f657aa3f37ad2f55b69d5b015 (diff) |
Implement support for tagged templates
Get Foo`...` to work as intended by the spec.
Change-Id: If6ccdd7486d3c983c177a3e126e3a661e210a8ae
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.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index 5f094ad4f5..b03e15700a 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -189,6 +189,7 @@ public: Kind_StringLiteralPropertyName, Kind_SwitchStatement, Kind_TemplateLiteral, + Kind_TaggedTemplate, Kind_ThisExpression, Kind_ThrowStatement, Kind_TildeExpression, @@ -838,6 +839,28 @@ public: SourceLocation identifierToken; }; +class QML_PARSER_EXPORT TaggedTemplate : public ExpressionNode +{ +public: + QQMLJS_DECLARE_AST_NODE(TaggedTemplate) + + TaggedTemplate(ExpressionNode *b, TemplateLiteral *t) + : base (b), templateLiteral(t) + { kind = K; } + + void accept0(Visitor *visitor) override; + + SourceLocation firstSourceLocation() const override + { return base->firstSourceLocation(); } + + SourceLocation lastSourceLocation() const override + { return templateLiteral->lastSourceLocation(); } + + // attributes + ExpressionNode *base; + TemplateLiteral *templateLiteral; +}; + class QML_PARSER_EXPORT NewMemberExpression: public ExpressionNode { public: |