From dad5d1cc82a57a4f657aa3f37ad2f55b69d5b015 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 9 Feb 2018 13:33:35 +0100 Subject: Add support for ES6 template strings This requires a bit of bookeeping in the lexer, as we can have arbitrary expressions inside the ${...}. To make this work, keep a stack of template states, in which we count the unclosed braces to match up with the correct closing brace. Implements support for `...`. Expressions of the type Foo`...` and Foo()`...` will come in follow-up commits. Change-Id: Ia332796cfb77895583d0093732e6f56c8b0662c9 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compilerscanfunctions_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/compiler/qv4compilerscanfunctions_p.h') diff --git a/src/qml/compiler/qv4compilerscanfunctions_p.h b/src/qml/compiler/qv4compilerscanfunctions_p.h index 87b7210879..0494a3248d 100644 --- a/src/qml/compiler/qv4compilerscanfunctions_p.h +++ b/src/qml/compiler/qv4compilerscanfunctions_p.h @@ -110,6 +110,7 @@ protected: bool visit(AST::IdentifierExpression *ast) override; bool visit(AST::ExpressionStatement *ast) override; bool visit(AST::FunctionExpression *ast) override; + bool visit(AST::TemplateLiteral *ast) override; void enterFunction(AST::FunctionExpression *ast, bool enterName); -- cgit v1.2.3