main
Last change
on this file was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago |
Pred finalna verzija
|
-
Property mode
set to
100644
|
File size:
1007 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.TaggedTemplateExpression = TaggedTemplateExpression;
|
---|
7 | exports.TemplateElement = TemplateElement;
|
---|
8 | exports.TemplateLiteral = TemplateLiteral;
|
---|
9 | function TaggedTemplateExpression(node) {
|
---|
10 | this.print(node.tag);
|
---|
11 | this.print(node.typeParameters);
|
---|
12 | this.print(node.quasi);
|
---|
13 | }
|
---|
14 | function TemplateElement() {
|
---|
15 | throw new Error("TemplateElement printing is handled in TemplateLiteral");
|
---|
16 | }
|
---|
17 | function TemplateLiteral(node) {
|
---|
18 | const quasis = node.quasis;
|
---|
19 | let partRaw = "`";
|
---|
20 | for (let i = 0; i < quasis.length; i++) {
|
---|
21 | partRaw += quasis[i].value.raw;
|
---|
22 | if (i + 1 < quasis.length) {
|
---|
23 | this.token(partRaw + "${", true);
|
---|
24 | this.print(node.expressions[i]);
|
---|
25 | partRaw = "}";
|
---|
26 | if (this.tokenMap) {
|
---|
27 | const token = this.tokenMap.findMatching(node, "}", i);
|
---|
28 | if (token) this._catchUpTo(token.loc.start);
|
---|
29 | }
|
---|
30 | }
|
---|
31 | }
|
---|
32 | this.token(partRaw + "`", true);
|
---|
33 | }
|
---|
34 |
|
---|
35 | //# sourceMappingURL=template-literals.js.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.