summaryrefslogtreecommitdiff
path: root/node_modules/@babel/generator/lib/generators/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/generator/lib/generators/base.js')
-rw-r--r--node_modules/@babel/generator/lib/generators/base.js94
1 files changed, 0 insertions, 94 deletions
diff --git a/node_modules/@babel/generator/lib/generators/base.js b/node_modules/@babel/generator/lib/generators/base.js
deleted file mode 100644
index 826b3101..00000000
--- a/node_modules/@babel/generator/lib/generators/base.js
+++ /dev/null
@@ -1,94 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.BlockStatement = BlockStatement;
-exports.Directive = Directive;
-exports.DirectiveLiteral = DirectiveLiteral;
-exports.File = File;
-exports.InterpreterDirective = InterpreterDirective;
-exports.Placeholder = Placeholder;
-exports.Program = Program;
-function File(node) {
- if (node.program) {
- this.print(node.program.interpreter);
- }
- this.print(node.program);
-}
-function Program(node) {
- var _node$directives;
- this.noIndentInnerCommentsHere();
- this.printInnerComments();
- const directivesLen = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
- if (directivesLen) {
- var _node$directives$trai;
- const newline = node.body.length ? 2 : 1;
- this.printSequence(node.directives, {
- trailingCommentsLineOffset: newline
- });
- if (!((_node$directives$trai = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai.length)) {
- this.newline(newline);
- }
- }
- this.printSequence(node.body);
-}
-function BlockStatement(node) {
- var _node$directives2;
- this.tokenChar(123);
- const exit = this.enterDelimited();
- const directivesLen = (_node$directives2 = node.directives) == null ? void 0 : _node$directives2.length;
- if (directivesLen) {
- var _node$directives$trai2;
- const newline = node.body.length ? 2 : 1;
- this.printSequence(node.directives, {
- indent: true,
- trailingCommentsLineOffset: newline
- });
- if (!((_node$directives$trai2 = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai2.length)) {
- this.newline(newline);
- }
- }
- this.printSequence(node.body, {
- indent: true
- });
- exit();
- this.rightBrace(node);
-}
-function Directive(node) {
- this.print(node.value);
- this.semicolon();
-}
-const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
-const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
-function DirectiveLiteral(node) {
- const raw = this.getPossibleRaw(node);
- if (!this.format.minified && raw !== undefined) {
- this.token(raw);
- return;
- }
- const {
- value
- } = node;
- if (!unescapedDoubleQuoteRE.test(value)) {
- this.token(`"${value}"`);
- } else if (!unescapedSingleQuoteRE.test(value)) {
- this.token(`'${value}'`);
- } else {
- throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
- }
-}
-function InterpreterDirective(node) {
- this.token(`#!${node.value}`);
- this.newline(1, true);
-}
-function Placeholder(node) {
- this.token("%%");
- this.print(node.name);
- this.token("%%");
- if (node.expectedNode === "Statement") {
- this.semicolon();
- }
-}
-
-//# sourceMappingURL=base.js.map