gameStatusUpdate/node_modules/@babel/generator/lib/generators/template-literals.js

36 lines
1,007 B
JavaScript
Raw Normal View History

2024-09-18 08:27:46 -07:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TaggedTemplateExpression = TaggedTemplateExpression;
exports.TemplateElement = TemplateElement;
exports.TemplateLiteral = TemplateLiteral;
function TaggedTemplateExpression(node) {
this.print(node.tag);
this.print(node.typeParameters);
this.print(node.quasi);
}
function TemplateElement() {
throw new Error("TemplateElement printing is handled in TemplateLiteral");
}
function TemplateLiteral(node) {
const quasis = node.quasis;
let partRaw = "`";
for (let i = 0; i < quasis.length; i++) {
partRaw += quasis[i].value.raw;
if (i + 1 < quasis.length) {
this.token(partRaw + "${", true);
this.print(node.expressions[i]);
partRaw = "}";
2024-11-04 11:06:36 -08:00
if (this.tokenMap) {
const token = this.tokenMap.findMatching(node, "}", i);
if (token) this._catchUpTo(token.loc.start);
}
2024-09-18 08:27:46 -07:00
}
}
this.token(partRaw + "`", true);
}
//# sourceMappingURL=template-literals.js.map