feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -12,9 +12,9 @@ exports.Placeholder = Placeholder;
exports.Program = Program;
function File(node) {
if (node.program) {
this.print(node.program.interpreter, node);
this.print(node.program.interpreter);
}
this.print(node.program, node);
this.print(node.program);
}
function Program(node) {
var _node$directives;
@@ -24,23 +24,24 @@ function Program(node) {
if (directivesLen) {
var _node$directives$trai;
const newline = node.body.length ? 2 : 1;
this.printSequence(node.directives, node, {
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, node);
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, node, {
this.printSequence(node.directives, {
indent: true,
trailingCommentsLineOffset: newline
});
@@ -48,15 +49,14 @@ function BlockStatement(node) {
this.newline(newline);
}
}
const exit = this.enterForStatementInit(false);
this.printSequence(node.body, node, {
this.printSequence(node.body, {
indent: true
});
exit();
this.rightBrace(node);
}
function Directive(node) {
this.print(node.value, node);
this.print(node.value);
this.semicolon();
}
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;