Index: src/ast.h |
diff --git a/src/ast.h b/src/ast.h |
index ae7ec1a659bf7bb70ae4faeeadc6763c8bef88a0..b2cc273fb8de49c49c00fc359b2baa9b010d821b 100644 |
--- a/src/ast.h |
+++ b/src/ast.h |
@@ -96,7 +96,8 @@ namespace internal { |
V(CompareOperation) \ |
V(ThisFunction) \ |
V(SuperReference) \ |
- V(CaseClause) |
+ V(CaseClause) \ |
+ V(TemplateLiteral) |
#define AST_NODE_LIST(V) \ |
DECLARATION_NODE_LIST(V) \ |
@@ -1432,6 +1433,29 @@ class Literal FINAL : public Expression { |
}; |
+class TemplateLiteral FINAL : public Expression { |
+ public: |
+ DECLARE_NODE_TYPE(TemplateLiteral) |
+ |
+ ZoneList<const AstTemplateSpan*>* spans() const { return spans_; } |
+ ZoneList<Expression*>* expressions() const { return expressions_; } |
+ |
+ static int num_ids() { return parent_num_ids() + 1; } |
+ |
+ private: |
+ TemplateLiteral(Zone* zone, ZoneList<const AstTemplateSpan*>* spans, |
+ ZoneList<Expression*>* expressions, int pos) |
+ : Expression(zone, pos), spans_(spans), expressions_(expressions) {} |
+ |
+ static int parent_num_ids() { return Expression::num_ids(); } |
+ |
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; } |
+ |
+ ZoneList<const AstTemplateSpan*>* spans_; |
+ ZoneList<Expression*>* expressions_; |
+}; |
+ |
+ |
// Base class for literals that needs space in the corresponding JSFunction. |
class MaterializedLiteral : public Expression { |
public: |
@@ -3389,6 +3413,13 @@ class AstNodeFactory FINAL BASE_EMBEDDED { |
VISIT_AND_RETURN(Literal, lit) |
} |
+ TemplateLiteral* NewTemplateLiteral(ZoneList<const AstTemplateSpan*>* spans, |
+ ZoneList<Expression*>* exprs, int pos) { |
+ TemplateLiteral* lit = |
+ new (zone_) TemplateLiteral(zone_, spans, exprs, pos); |
+ VISIT_AND_RETURN(TemplateLiteral, lit); |
+ } |
+ |
// A JavaScript symbol (ECMA-262 edition 6). |
Literal* NewSymbolLiteral(const char* name, int pos) { |
Literal* lit = |