prettier-plugin-java 1.6.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/base-cst-printer.js +3 -3
- package/dist/index.js +2 -2
- package/dist/options.js +1 -0
- package/dist/printers/arrays.js +3 -3
- package/dist/printers/blocks-and-statements.js +106 -102
- package/dist/printers/classes.js +176 -160
- package/dist/printers/comments/format-comments.js +21 -13
- package/dist/printers/comments/handle-comments.js +1 -1
- package/dist/printers/expressions.js +127 -105
- package/dist/printers/interfaces.js +56 -56
- package/dist/printers/lexical-structure.js +4 -4
- package/dist/printers/names.js +8 -8
- package/dist/printers/packages-and-modules.js +72 -59
- package/dist/printers/prettier-builder.js +24 -12
- package/dist/printers/printer-utils.js +63 -56
- package/dist/printers/types-values-and-variables.js +43 -39
- package/dist/src/base-cst-printer.js +77 -0
- package/dist/src/cst-printer.js +37 -0
- package/dist/src/index.js +67 -0
- package/dist/src/options.js +256 -0
- package/dist/src/parser.js +7 -0
- package/dist/src/printer.js +28 -0
- package/dist/src/printers/arrays.js +49 -0
- package/dist/src/printers/blocks-and-statements.js +493 -0
- package/dist/src/printers/classes.js +724 -0
- package/dist/src/printers/comments/comments-utils.js +29 -0
- package/dist/src/printers/comments/format-comments.js +187 -0
- package/dist/src/printers/comments/handle-comments.js +38 -0
- package/dist/src/printers/expressions.js +549 -0
- package/dist/src/printers/interfaces.js +251 -0
- package/dist/src/printers/lexical-structure.js +43 -0
- package/dist/src/printers/names.js +53 -0
- package/dist/src/printers/packages-and-modules.js +185 -0
- package/dist/src/printers/prettier-builder.js +47 -0
- package/dist/src/printers/printer-utils.js +577 -0
- package/dist/src/printers/types-values-and-variables.js +183 -0
- package/dist/src/types/utils.js +29 -0
- package/dist/src/utils/expressions-utils.js +29 -0
- package/dist/src/utils/index.js +10 -0
- package/dist/src/utils/printArgumentListWithBraces.js +21 -0
- package/dist/src/utils/printSingleLambdaInvocation.js +20 -0
- package/dist/test/babel-register.js +3 -0
- package/dist/test/repository-test/core-test.js +12 -0
- package/dist/test/repository-test/jhipster-1-test.js +17 -0
- package/dist/test/repository-test/jhipster-2-test.js +16 -0
- package/dist/test/test-utils.js +215 -0
- package/dist/test/unit-test/annotation_type_declaration/annotation_type_declaration-spec.js +6 -0
- package/dist/test/unit-test/args/args-spec.js +6 -0
- package/dist/test/unit-test/assert/assert-spec.js +6 -0
- package/dist/test/unit-test/binary_expressions/binary_expressions-spec.js +6 -0
- package/dist/test/unit-test/blank_lines/blank_lines-spec.js +6 -0
- package/dist/test/unit-test/bug-fixes/bug-fixes-spec.js +6 -0
- package/dist/test/unit-test/cast/cast-spec.js +6 -0
- package/dist/test/unit-test/char_literal/char_literal-spec.js +6 -0
- package/dist/test/unit-test/classes/multiple_classes-spec.js +6 -0
- package/dist/test/unit-test/comments/comments-spec.js +14 -0
- package/dist/test/unit-test/complex_generic_class/complex_generic_class-spec.js +6 -0
- package/dist/test/unit-test/constructors/constructors-spec.js +6 -0
- package/dist/test/unit-test/empty_statement/empty_statement-spec.js +6 -0
- package/dist/test/unit-test/enum/enum-spec.js +6 -0
- package/dist/test/unit-test/expressions/expressions-spec.js +6 -0
- package/dist/test/unit-test/extends_abstract_class/extends_abstract_class-spec.js +6 -0
- package/dist/test/unit-test/extends_abstract_class_and_implements_interfaces/extends_abstract_class_and_implements_interfaces-spec.js +6 -0
- package/dist/test/unit-test/for/for-spec.js +6 -0
- package/dist/test/unit-test/generic_class/generic_class-spec.js +6 -0
- package/dist/test/unit-test/generic_questionmark/generic_questionmark-spec.js +6 -0
- package/dist/test/unit-test/hello-world/hello-word-spec.js +6 -0
- package/dist/test/unit-test/if/if-spec.js +6 -0
- package/dist/test/unit-test/indent/indent-spec.js +6 -0
- package/dist/test/unit-test/instantiation/instantiation-spec.js +6 -0
- package/dist/test/unit-test/interface/interface-spec.js +6 -0
- package/dist/test/unit-test/lambda/lambda-spec.js +6 -0
- package/dist/test/unit-test/marker_annotations/marker_annotations-spec.js +6 -0
- package/dist/test/unit-test/member_chain/member_chain-spec.js +6 -0
- package/dist/test/unit-test/method_reference/method_reference-spec.js +6 -0
- package/dist/test/unit-test/modifiers/modifiers-spec.js +6 -0
- package/dist/test/unit-test/modules/modules-spec.js +6 -0
- package/dist/test/unit-test/package_and_imports/package_and_imports-spec.js +34 -0
- package/dist/test/unit-test/pattern-matching/pattern-matching-spec.js +6 -0
- package/dist/test/unit-test/prettier-ignore/prettier-ignore-spec.js +28 -0
- package/dist/test/unit-test/records/records-spec.js +6 -0
- package/dist/test/unit-test/return/return-spec.js +6 -0
- package/dist/test/unit-test/sealed/sealed-spec.js +6 -0
- package/dist/test/unit-test/snippets/arrays/array-initializer.spec.js +94 -0
- package/dist/test/unit-test/snippets/arrays/variable-initializer-list.spec.js +19 -0
- package/dist/test/unit-test/snippets/blocks-and-statements/switch.spec.js +26 -0
- package/dist/test/unit-test/snippets/classes/class-body.spec.js +181 -0
- package/dist/test/unit-test/snippets/classes/enum-body.spec.js +87 -0
- package/dist/test/unit-test/snippets/classes/variableDeclarator/test.spec.js +186 -0
- package/dist/test/unit-test/snippets/interfaces/element-value-array-initializer.spec.js +85 -0
- package/dist/test/unit-test/snippets/names/ambiguousName/test.spec.js +19 -0
- package/dist/test/unit-test/snippets/names/expressionName/test.spec.js +19 -0
- package/dist/test/unit-test/snippets/names/methodName/test.spec.js +12 -0
- package/dist/test/unit-test/snippets/names/packageOrTypeName/test.spec.js +19 -0
- package/dist/test/unit-test/snippets/types-values-and-variables/floatingPointType/test.spec.js +19 -0
- package/dist/test/unit-test/snippets/types-values-and-variables/integralType/test.spec.js +40 -0
- package/dist/test/unit-test/snippets/types-values-and-variables/numericType/test.spec.js +88 -0
- package/dist/test/unit-test/snippets/types-values-and-variables/wildcard/test.spec.js +112 -0
- package/dist/test/unit-test/snippets/types-values-and-variables/wildcardBounds/test.spec.js +81 -0
- package/dist/test/unit-test/switch/switch-spec.js +6 -0
- package/dist/test/unit-test/synchronized/synchronized-spec.js +6 -0
- package/dist/test/unit-test/text-blocks/text-block-spec.js +6 -0
- package/dist/test/unit-test/throws/throws-spec.js +6 -0
- package/dist/test/unit-test/try_catch/try_catch-spec.js +6 -0
- package/dist/test/unit-test/types/types-spec.js +6 -0
- package/dist/test/unit-test/variables/variables-spec.js +6 -0
- package/dist/test/unit-test/while/while-spec.js +6 -0
- package/dist/test/unit-test/yield-statement/yield-statement-spec.js +6 -0
- package/dist/utils/index.js +3 -1
- package/dist/utils/isEmptyDoc.js +6 -0
- package/dist/utils/printArgumentListWithBraces.js +2 -2
- package/dist/utils/printSingleLambdaInvocation.js +4 -4
- package/package.json +21 -21
- package/dist/utils/constants.js +0 -4
package/LICENSE
CHANGED
package/dist/base-cst-printer.js
CHANGED
|
@@ -32,12 +32,12 @@ var BaseCstPrettierPrinter = /** @class */ (function (_super) {
|
|
|
32
32
|
_this.getSingle = function (ctx) {
|
|
33
33
|
var ctxKeys = Object.keys(ctx);
|
|
34
34
|
if (ctxKeys.length !== 1) {
|
|
35
|
-
throw Error("Expecting single key CST ctx but found: <"
|
|
35
|
+
throw Error("Expecting single key CST ctx but found: <".concat(ctxKeys.length, "> keys"));
|
|
36
36
|
}
|
|
37
37
|
var singleElementKey = ctxKeys[0];
|
|
38
38
|
var singleElementValues = ctx[singleElementKey];
|
|
39
39
|
if ((singleElementValues === null || singleElementValues === void 0 ? void 0 : singleElementValues.length) !== 1) {
|
|
40
|
-
throw Error("Expecting single item in CST ctx key but found: <"
|
|
40
|
+
throw Error("Expecting single item in CST ctx key but found: <".concat(singleElementValues === null || singleElementValues === void 0 ? void 0 : singleElementValues.length, "> items"));
|
|
41
41
|
}
|
|
42
42
|
return singleElementValues[0];
|
|
43
43
|
};
|
|
@@ -64,7 +64,7 @@ var BaseCstPrettierPrinter = /** @class */ (function (_super) {
|
|
|
64
64
|
"\nThere might be a problem with prettier-ignore, please report an issue on https://github.com/jhipster/prettier-java/issues");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
return format_comments_1.printNodeWithComments(node, this.orgVisit.call(this, node, inParam));
|
|
67
|
+
return (0, format_comments_1.printNodeWithComments)(node, this.orgVisit.call(this, node, inParam));
|
|
68
68
|
};
|
|
69
69
|
_this.visitSingle = function (ctx, params) {
|
|
70
70
|
var singleElement = this.getSingle(ctx);
|
package/dist/index.js
CHANGED
|
@@ -22,8 +22,8 @@ function locStart( /* node */) {
|
|
|
22
22
|
function locEnd( /* node */) {
|
|
23
23
|
return -1;
|
|
24
24
|
}
|
|
25
|
-
function hasPragma(
|
|
26
|
-
return
|
|
25
|
+
function hasPragma(text) {
|
|
26
|
+
return /^\/\*\*[\n][\t\s]+\*\s@(prettier|format)[\n][\t\s]+\*\//.test(text);
|
|
27
27
|
}
|
|
28
28
|
var parsers = {
|
|
29
29
|
java: {
|
package/dist/options.js
CHANGED
|
@@ -171,6 +171,7 @@ module.exports = {
|
|
|
171
171
|
{ value: "arrayAccessSuffix" },
|
|
172
172
|
{ value: "methodReferenceSuffix" },
|
|
173
173
|
{ value: "pattern" },
|
|
174
|
+
{ value: "primaryPattern" },
|
|
174
175
|
{ value: "typePattern" },
|
|
175
176
|
{ value: "identifyNewExpressionType" },
|
|
176
177
|
{ value: "isLambdaExpression" },
|
package/dist/printers/arrays.js
CHANGED
|
@@ -27,7 +27,7 @@ var ArraysPrettierVisitor = /** @class */ (function (_super) {
|
|
|
27
27
|
}
|
|
28
28
|
ArraysPrettierVisitor.prototype.arrayInitializer = function (ctx) {
|
|
29
29
|
var optionalVariableInitializerList = this.visit(ctx.variableInitializerList);
|
|
30
|
-
return printer_utils_1.printArrayList({
|
|
30
|
+
return (0, printer_utils_1.printArrayList)({
|
|
31
31
|
list: optionalVariableInitializerList,
|
|
32
32
|
extraComma: ctx.Comma,
|
|
33
33
|
LCurly: ctx.LCurly[0],
|
|
@@ -39,10 +39,10 @@ var ArraysPrettierVisitor = /** @class */ (function (_super) {
|
|
|
39
39
|
var variableInitializers = this.mapVisit(ctx.variableInitializer);
|
|
40
40
|
var commas = ctx.Comma
|
|
41
41
|
? ctx.Comma.map(function (comma) {
|
|
42
|
-
return printer_utils_1.rejectAndConcat([comma, line]);
|
|
42
|
+
return (0, printer_utils_1.rejectAndConcat)([comma, line]);
|
|
43
43
|
})
|
|
44
44
|
: [];
|
|
45
|
-
return printer_utils_1.rejectAndJoinSeps(commas, variableInitializers);
|
|
45
|
+
return (0, printer_utils_1.rejectAndJoinSeps)(commas, variableInitializers);
|
|
46
46
|
};
|
|
47
47
|
return ArraysPrettierVisitor;
|
|
48
48
|
}(base_cst_printer_1.BaseCstPrettierPrinter));
|
|
@@ -25,10 +25,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
};
|
|
26
26
|
return __assign.apply(this, arguments);
|
|
27
27
|
};
|
|
28
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
29
|
-
for (var i = 0,
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
29
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
30
|
+
if (ar || !(i in from)) {
|
|
31
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
32
|
+
ar[i] = from[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
36
|
};
|
|
33
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
38
|
exports.BlocksAndStatementPrettierVisitor = void 0;
|
|
@@ -46,30 +50,30 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
46
50
|
}
|
|
47
51
|
BlocksAndStatementPrettierVisitor.prototype.block = function (ctx) {
|
|
48
52
|
var blockStatements = this.visit(ctx.blockStatements);
|
|
49
|
-
return printer_utils_1.putIntoBraces(blockStatements, hardline, ctx.LCurly[0], ctx.RCurly[0]);
|
|
53
|
+
return (0, printer_utils_1.putIntoBraces)(blockStatements, hardline, ctx.LCurly[0], ctx.RCurly[0]);
|
|
50
54
|
};
|
|
51
55
|
BlocksAndStatementPrettierVisitor.prototype.blockStatements = function (ctx) {
|
|
52
56
|
var blockStatement = this.mapVisit(ctx.blockStatement);
|
|
53
|
-
var separators = printer_utils_1.rejectSeparators(printer_utils_1.getBlankLinesSeparator(ctx.blockStatement), blockStatement);
|
|
54
|
-
return printer_utils_1.rejectAndJoinSeps(separators, blockStatement);
|
|
57
|
+
var separators = (0, printer_utils_1.rejectSeparators)((0, printer_utils_1.getBlankLinesSeparator)(ctx.blockStatement), blockStatement);
|
|
58
|
+
return (0, printer_utils_1.rejectAndJoinSeps)(separators, blockStatement);
|
|
55
59
|
};
|
|
56
60
|
BlocksAndStatementPrettierVisitor.prototype.blockStatement = function (ctx) {
|
|
57
61
|
return this.visitSingle(ctx);
|
|
58
62
|
};
|
|
59
63
|
BlocksAndStatementPrettierVisitor.prototype.localVariableDeclarationStatement = function (ctx) {
|
|
60
64
|
var localVariableDeclaration = this.visit(ctx.localVariableDeclaration);
|
|
61
|
-
return printer_utils_1.rejectAndConcat([localVariableDeclaration, ctx.Semicolon[0]]);
|
|
65
|
+
return (0, printer_utils_1.rejectAndConcat)([localVariableDeclaration, ctx.Semicolon[0]]);
|
|
62
66
|
};
|
|
63
67
|
BlocksAndStatementPrettierVisitor.prototype.localVariableDeclaration = function (ctx) {
|
|
64
|
-
var modifiers = printer_utils_1.sortModifiers(ctx.variableModifier);
|
|
68
|
+
var modifiers = (0, printer_utils_1.sortModifiers)(ctx.variableModifier);
|
|
65
69
|
var firstAnnotations = this.mapVisit(modifiers[0]);
|
|
66
70
|
var finalModifiers = this.mapVisit(modifiers[1]);
|
|
67
71
|
var localVariableType = this.visit(ctx.localVariableType);
|
|
68
72
|
var variableDeclaratorList = this.visit(ctx.variableDeclaratorList);
|
|
69
|
-
return printer_utils_1.rejectAndJoin(hardline, [
|
|
70
|
-
printer_utils_1.rejectAndJoin(hardline, firstAnnotations),
|
|
71
|
-
printer_utils_1.rejectAndJoin(" ", [
|
|
72
|
-
printer_utils_1.rejectAndJoin(" ", finalModifiers),
|
|
73
|
+
return (0, printer_utils_1.rejectAndJoin)(hardline, [
|
|
74
|
+
(0, printer_utils_1.rejectAndJoin)(hardline, firstAnnotations),
|
|
75
|
+
(0, printer_utils_1.rejectAndJoin)(" ", [
|
|
76
|
+
(0, printer_utils_1.rejectAndJoin)(" ", finalModifiers),
|
|
73
77
|
localVariableType,
|
|
74
78
|
variableDeclaratorList
|
|
75
79
|
])
|
|
@@ -79,7 +83,7 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
79
83
|
if (ctx.unannType) {
|
|
80
84
|
return this.visitSingle(ctx);
|
|
81
85
|
}
|
|
82
|
-
return format_comments_1.printTokenWithComments(this.getSingle(ctx));
|
|
86
|
+
return (0, format_comments_1.printTokenWithComments)(this.getSingle(ctx));
|
|
83
87
|
};
|
|
84
88
|
BlocksAndStatementPrettierVisitor.prototype.statement = function (ctx, params) {
|
|
85
89
|
// handling Labeled statements comments
|
|
@@ -109,16 +113,16 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
109
113
|
return this.visitSingle(ctx, params);
|
|
110
114
|
};
|
|
111
115
|
BlocksAndStatementPrettierVisitor.prototype.emptyStatement = function (ctx, params) {
|
|
112
|
-
return printer_utils_1.displaySemicolon(ctx.Semicolon[0], params);
|
|
116
|
+
return (0, printer_utils_1.displaySemicolon)(ctx.Semicolon[0], params);
|
|
113
117
|
};
|
|
114
118
|
BlocksAndStatementPrettierVisitor.prototype.labeledStatement = function (ctx) {
|
|
115
119
|
var identifier = ctx.Identifier[0];
|
|
116
120
|
var statement = this.visit(ctx.statement);
|
|
117
|
-
return printer_utils_1.rejectAndJoin(ctx.Colon[0], [identifier, statement]);
|
|
121
|
+
return (0, printer_utils_1.rejectAndJoin)(ctx.Colon[0], [identifier, statement]);
|
|
118
122
|
};
|
|
119
123
|
BlocksAndStatementPrettierVisitor.prototype.expressionStatement = function (ctx) {
|
|
120
124
|
var statementExpression = this.visit(ctx.statementExpression);
|
|
121
|
-
return printer_utils_1.rejectAndConcat([statementExpression, ctx.Semicolon[0]]);
|
|
125
|
+
return (0, printer_utils_1.rejectAndConcat)([statementExpression, ctx.Semicolon[0]]);
|
|
122
126
|
};
|
|
123
127
|
BlocksAndStatementPrettierVisitor.prototype.statementExpression = function (ctx) {
|
|
124
128
|
return this.visitSingle(ctx);
|
|
@@ -128,27 +132,27 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
128
132
|
var ifStatement = this.visit(ctx.statement[0], {
|
|
129
133
|
allowEmptyStatement: true
|
|
130
134
|
});
|
|
131
|
-
var ifSeparator = printer_utils_1.isStatementEmptyStatement(ifStatement) ? "" : " ";
|
|
135
|
+
var ifSeparator = (0, printer_utils_1.isStatementEmptyStatement)(ifStatement) ? "" : " ";
|
|
132
136
|
var elsePart = "";
|
|
133
137
|
if (ctx.Else !== undefined) {
|
|
134
138
|
var elseStatement = this.visit(ctx.statement[1], {
|
|
135
139
|
allowEmptyStatement: true
|
|
136
140
|
});
|
|
137
|
-
var elseSeparator = printer_utils_1.isStatementEmptyStatement(elseStatement) ? "" : " ";
|
|
138
|
-
var elseOnSameLine = comments_utils_1.hasTrailingLineComments(ctx.statement[0]) ||
|
|
139
|
-
comments_utils_1.hasLeadingLineComments(ctx.Else[0])
|
|
141
|
+
var elseSeparator = (0, printer_utils_1.isStatementEmptyStatement)(elseStatement) ? "" : " ";
|
|
142
|
+
var elseOnSameLine = (0, comments_utils_1.hasTrailingLineComments)(ctx.statement[0]) ||
|
|
143
|
+
(0, comments_utils_1.hasLeadingLineComments)(ctx.Else[0])
|
|
140
144
|
? hardline
|
|
141
145
|
: " ";
|
|
142
|
-
elsePart = printer_utils_1.rejectAndJoin(elseSeparator, [
|
|
143
|
-
prettier_builder_1.concat([elseOnSameLine, ctx.Else[0]]),
|
|
146
|
+
elsePart = (0, printer_utils_1.rejectAndJoin)(elseSeparator, [
|
|
147
|
+
(0, prettier_builder_1.concat)([elseOnSameLine, ctx.Else[0]]),
|
|
144
148
|
elseStatement
|
|
145
149
|
]);
|
|
146
150
|
}
|
|
147
|
-
return printer_utils_1.rejectAndConcat([
|
|
148
|
-
printer_utils_1.rejectAndJoin(" ", [
|
|
151
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
152
|
+
(0, printer_utils_1.rejectAndJoin)(" ", [
|
|
149
153
|
ctx.If[0],
|
|
150
|
-
prettier_builder_1.concat([
|
|
151
|
-
printer_utils_1.putIntoBraces(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
154
|
+
(0, prettier_builder_1.concat)([
|
|
155
|
+
(0, printer_utils_1.putIntoBraces)(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
152
156
|
ifSeparator
|
|
153
157
|
])
|
|
154
158
|
]),
|
|
@@ -159,18 +163,18 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
159
163
|
BlocksAndStatementPrettierVisitor.prototype.assertStatement = function (ctx) {
|
|
160
164
|
var expressions = this.mapVisit(ctx.expression);
|
|
161
165
|
var colon = ctx.Colon ? ctx.Colon[0] : ":";
|
|
162
|
-
return printer_utils_1.rejectAndConcat([
|
|
163
|
-
prettier_builder_1.concat([ctx.Assert[0], " "]),
|
|
164
|
-
printer_utils_1.rejectAndJoin(prettier_builder_1.concat([" ", colon, " "]), expressions),
|
|
166
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
167
|
+
(0, prettier_builder_1.concat)([ctx.Assert[0], " "]),
|
|
168
|
+
(0, printer_utils_1.rejectAndJoin)((0, prettier_builder_1.concat)([" ", colon, " "]), expressions),
|
|
165
169
|
ctx.Semicolon[0]
|
|
166
170
|
]);
|
|
167
171
|
};
|
|
168
172
|
BlocksAndStatementPrettierVisitor.prototype.switchStatement = function (ctx) {
|
|
169
173
|
var expression = this.visit(ctx.expression);
|
|
170
174
|
var switchBlock = this.visit(ctx.switchBlock);
|
|
171
|
-
return printer_utils_1.rejectAndJoin(" ", [
|
|
175
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [
|
|
172
176
|
ctx.Switch[0],
|
|
173
|
-
printer_utils_1.putIntoBraces(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
177
|
+
(0, printer_utils_1.putIntoBraces)(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
174
178
|
switchBlock
|
|
175
179
|
]);
|
|
176
180
|
};
|
|
@@ -178,40 +182,40 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
178
182
|
var switchCases = ctx.switchBlockStatementGroup !== undefined
|
|
179
183
|
? this.mapVisit(ctx.switchBlockStatementGroup)
|
|
180
184
|
: this.mapVisit(ctx.switchRule);
|
|
181
|
-
return printer_utils_1.putIntoBraces(printer_utils_1.rejectAndJoin(hardline, switchCases), hardline, ctx.LCurly[0], ctx.RCurly[0]);
|
|
185
|
+
return (0, printer_utils_1.putIntoBraces)((0, printer_utils_1.rejectAndJoin)(hardline, switchCases), hardline, ctx.LCurly[0], ctx.RCurly[0]);
|
|
182
186
|
};
|
|
183
187
|
BlocksAndStatementPrettierVisitor.prototype.switchBlockStatementGroup = function (ctx) {
|
|
184
188
|
var switchLabel = this.visit(ctx.switchLabel);
|
|
185
189
|
var blockStatements = this.visit(ctx.blockStatements);
|
|
186
|
-
return prettier_builder_1.concat([
|
|
190
|
+
return (0, prettier_builder_1.concat)([
|
|
187
191
|
switchLabel,
|
|
188
192
|
ctx.Colon[0],
|
|
189
|
-
blockStatements && prettier_builder_1.indent([hardline, blockStatements])
|
|
193
|
+
blockStatements && (0, prettier_builder_1.indent)([hardline, blockStatements])
|
|
190
194
|
]);
|
|
191
195
|
};
|
|
192
196
|
BlocksAndStatementPrettierVisitor.prototype.switchLabel = function (ctx) {
|
|
193
197
|
var caseOrDefaultLabels = this.mapVisit(ctx.caseOrDefaultLabel);
|
|
194
198
|
var colons = ctx.Colon
|
|
195
199
|
? ctx.Colon.map(function (elt) {
|
|
196
|
-
return prettier_builder_1.concat([elt, hardline]);
|
|
200
|
+
return (0, prettier_builder_1.concat)([elt, hardline]);
|
|
197
201
|
})
|
|
198
202
|
: [];
|
|
199
|
-
return prettier_builder_1.group(printer_utils_1.rejectAndJoinSeps(colons, caseOrDefaultLabels));
|
|
203
|
+
return (0, prettier_builder_1.group)((0, printer_utils_1.rejectAndJoinSeps)(colons, caseOrDefaultLabels));
|
|
200
204
|
};
|
|
201
205
|
BlocksAndStatementPrettierVisitor.prototype.caseOrDefaultLabel = function (ctx) {
|
|
202
206
|
if (ctx.Case) {
|
|
203
207
|
var caseLabelElements = this.mapVisit(ctx.caseLabelElement);
|
|
204
208
|
var commas = ctx.Comma
|
|
205
209
|
? ctx.Comma.map(function (elt) {
|
|
206
|
-
return prettier_builder_1.concat([elt, line]);
|
|
210
|
+
return (0, prettier_builder_1.concat)([elt, line]);
|
|
207
211
|
})
|
|
208
212
|
: [];
|
|
209
|
-
return prettier_builder_1.group(prettier_builder_1.indent(printer_utils_1.rejectAndConcat([
|
|
210
|
-
prettier_builder_1.concat([ctx.Case[0], " "]),
|
|
211
|
-
printer_utils_1.rejectAndJoinSeps(commas, caseLabelElements)
|
|
213
|
+
return (0, prettier_builder_1.group)((0, prettier_builder_1.indent)((0, printer_utils_1.rejectAndConcat)([
|
|
214
|
+
(0, prettier_builder_1.concat)([ctx.Case[0], " "]),
|
|
215
|
+
(0, printer_utils_1.rejectAndJoinSeps)(commas, caseLabelElements)
|
|
212
216
|
])));
|
|
213
217
|
}
|
|
214
|
-
return prettier_builder_1.concat([ctx.Default[0]]);
|
|
218
|
+
return (0, prettier_builder_1.concat)([ctx.Default[0]]);
|
|
215
219
|
};
|
|
216
220
|
BlocksAndStatementPrettierVisitor.prototype.caseLabelElement = function (ctx) {
|
|
217
221
|
if (ctx.Default || ctx.Null) {
|
|
@@ -229,9 +233,9 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
229
233
|
caseInstruction = this.visit(ctx.block);
|
|
230
234
|
}
|
|
231
235
|
else {
|
|
232
|
-
caseInstruction = prettier_builder_1.concat([this.visit(ctx.expression), ctx.Semicolon[0]]);
|
|
236
|
+
caseInstruction = (0, prettier_builder_1.concat)([this.visit(ctx.expression), ctx.Semicolon[0]]);
|
|
233
237
|
}
|
|
234
|
-
return prettier_builder_1.join(" ", [switchLabel, ctx.Arrow[0], caseInstruction]);
|
|
238
|
+
return (0, prettier_builder_1.join)(" ", [switchLabel, ctx.Arrow[0], caseInstruction]);
|
|
235
239
|
};
|
|
236
240
|
BlocksAndStatementPrettierVisitor.prototype.caseConstant = function (ctx) {
|
|
237
241
|
return this.visitSingle(ctx);
|
|
@@ -241,11 +245,11 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
241
245
|
var statement = this.visit(ctx.statement[0], {
|
|
242
246
|
allowEmptyStatement: true
|
|
243
247
|
});
|
|
244
|
-
var statementSeparator = printer_utils_1.isStatementEmptyStatement(statement) ? "" : " ";
|
|
245
|
-
return printer_utils_1.rejectAndJoin(" ", [
|
|
248
|
+
var statementSeparator = (0, printer_utils_1.isStatementEmptyStatement)(statement) ? "" : " ";
|
|
249
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [
|
|
246
250
|
ctx.While[0],
|
|
247
|
-
printer_utils_1.rejectAndJoin(statementSeparator, [
|
|
248
|
-
printer_utils_1.putIntoBraces(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
251
|
+
(0, printer_utils_1.rejectAndJoin)(statementSeparator, [
|
|
252
|
+
(0, printer_utils_1.putIntoBraces)(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
249
253
|
statement
|
|
250
254
|
])
|
|
251
255
|
]);
|
|
@@ -254,13 +258,13 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
254
258
|
var statement = this.visit(ctx.statement[0], {
|
|
255
259
|
allowEmptyStatement: true
|
|
256
260
|
});
|
|
257
|
-
var statementSeparator = printer_utils_1.isStatementEmptyStatement(statement) ? "" : " ";
|
|
261
|
+
var statementSeparator = (0, printer_utils_1.isStatementEmptyStatement)(statement) ? "" : " ";
|
|
258
262
|
var expression = this.visit(ctx.expression);
|
|
259
|
-
return printer_utils_1.rejectAndJoin(" ", [
|
|
260
|
-
printer_utils_1.rejectAndJoin(statementSeparator, [ctx.Do[0], statement]),
|
|
263
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [
|
|
264
|
+
(0, printer_utils_1.rejectAndJoin)(statementSeparator, [ctx.Do[0], statement]),
|
|
261
265
|
ctx.While[0],
|
|
262
|
-
printer_utils_1.rejectAndConcat([
|
|
263
|
-
printer_utils_1.putIntoBraces(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
266
|
+
(0, printer_utils_1.rejectAndConcat)([
|
|
267
|
+
(0, printer_utils_1.putIntoBraces)(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
264
268
|
ctx.Semicolon[0]
|
|
265
269
|
])
|
|
266
270
|
]);
|
|
@@ -275,14 +279,14 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
275
279
|
var statement = this.visit(ctx.statement[0], {
|
|
276
280
|
allowEmptyStatement: true
|
|
277
281
|
});
|
|
278
|
-
var statementSeparator = printer_utils_1.isStatementEmptyStatement(statement) ? "" : " ";
|
|
279
|
-
return printer_utils_1.rejectAndConcat([
|
|
280
|
-
printer_utils_1.rejectAndJoin(" ", [
|
|
282
|
+
var statementSeparator = (0, printer_utils_1.isStatementEmptyStatement)(statement) ? "" : " ";
|
|
283
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
284
|
+
(0, printer_utils_1.rejectAndJoin)(" ", [
|
|
281
285
|
ctx.For[0],
|
|
282
|
-
printer_utils_1.putIntoBraces(printer_utils_1.rejectAndConcat([
|
|
286
|
+
(0, printer_utils_1.putIntoBraces)((0, printer_utils_1.rejectAndConcat)([
|
|
283
287
|
forInit,
|
|
284
|
-
printer_utils_1.rejectAndJoin(line, [ctx.Semicolon[0], expression]),
|
|
285
|
-
printer_utils_1.rejectAndJoin(line, [ctx.Semicolon[1], forUpdate])
|
|
288
|
+
(0, printer_utils_1.rejectAndJoin)(line, [ctx.Semicolon[0], expression]),
|
|
289
|
+
(0, printer_utils_1.rejectAndJoin)(line, [ctx.Semicolon[1], forUpdate])
|
|
286
290
|
]), softline, ctx.LBrace[0], ctx.RBrace[0])
|
|
287
291
|
]),
|
|
288
292
|
statementSeparator,
|
|
@@ -299,10 +303,10 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
299
303
|
var statementExpressions = this.mapVisit(ctx.statementExpression);
|
|
300
304
|
var commas = ctx.Comma
|
|
301
305
|
? ctx.Comma.map(function (elt) {
|
|
302
|
-
return prettier_builder_1.concat([format_comments_1.printTokenWithComments(elt), " "]);
|
|
306
|
+
return (0, prettier_builder_1.concat)([(0, format_comments_1.printTokenWithComments)(elt), " "]);
|
|
303
307
|
})
|
|
304
308
|
: [];
|
|
305
|
-
return printer_utils_1.rejectAndJoinSeps(commas, statementExpressions);
|
|
309
|
+
return (0, printer_utils_1.rejectAndJoinSeps)(commas, statementExpressions);
|
|
306
310
|
};
|
|
307
311
|
BlocksAndStatementPrettierVisitor.prototype.enhancedForStatement = function (ctx) {
|
|
308
312
|
var variableModifiers = this.mapVisit(ctx.variableModifier);
|
|
@@ -312,59 +316,59 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
312
316
|
var statement = this.visit(ctx.statement[0], {
|
|
313
317
|
allowEmptyStatement: true
|
|
314
318
|
});
|
|
315
|
-
var statementSeparator = printer_utils_1.isStatementEmptyStatement(statement) ? "" : " ";
|
|
316
|
-
return printer_utils_1.rejectAndConcat([
|
|
317
|
-
printer_utils_1.rejectAndJoin(" ", [ctx.For[0], ctx.LBrace[0]]),
|
|
318
|
-
printer_utils_1.rejectAndJoin(" ", [
|
|
319
|
-
printer_utils_1.rejectAndJoin(" ", variableModifiers),
|
|
319
|
+
var statementSeparator = (0, printer_utils_1.isStatementEmptyStatement)(statement) ? "" : " ";
|
|
320
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
321
|
+
(0, printer_utils_1.rejectAndJoin)(" ", [ctx.For[0], ctx.LBrace[0]]),
|
|
322
|
+
(0, printer_utils_1.rejectAndJoin)(" ", [
|
|
323
|
+
(0, printer_utils_1.rejectAndJoin)(" ", variableModifiers),
|
|
320
324
|
localVariableType,
|
|
321
325
|
variableDeclaratorId
|
|
322
326
|
]),
|
|
323
|
-
prettier_builder_1.concat([" ", ctx.Colon[0], " "]),
|
|
327
|
+
(0, prettier_builder_1.concat)([" ", ctx.Colon[0], " "]),
|
|
324
328
|
expression,
|
|
325
|
-
prettier_builder_1.concat([ctx.RBrace[0], statementSeparator]),
|
|
329
|
+
(0, prettier_builder_1.concat)([ctx.RBrace[0], statementSeparator]),
|
|
326
330
|
statement
|
|
327
331
|
]);
|
|
328
332
|
};
|
|
329
333
|
BlocksAndStatementPrettierVisitor.prototype.breakStatement = function (ctx) {
|
|
330
334
|
if (ctx.Identifier) {
|
|
331
335
|
var identifier = ctx.Identifier[0];
|
|
332
|
-
return printer_utils_1.rejectAndConcat([
|
|
333
|
-
prettier_builder_1.concat([ctx.Break[0], " "]),
|
|
336
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
337
|
+
(0, prettier_builder_1.concat)([ctx.Break[0], " "]),
|
|
334
338
|
identifier,
|
|
335
339
|
ctx.Semicolon[0]
|
|
336
340
|
]);
|
|
337
341
|
}
|
|
338
|
-
return prettier_builder_1.concat([ctx.Break[0], ctx.Semicolon[0]]);
|
|
342
|
+
return (0, prettier_builder_1.concat)([ctx.Break[0], ctx.Semicolon[0]]);
|
|
339
343
|
};
|
|
340
344
|
BlocksAndStatementPrettierVisitor.prototype.continueStatement = function (ctx) {
|
|
341
345
|
if (ctx.Identifier) {
|
|
342
346
|
var identifier = ctx.Identifier[0];
|
|
343
|
-
return printer_utils_1.rejectAndConcat([
|
|
344
|
-
prettier_builder_1.concat([ctx.Continue[0], " "]),
|
|
347
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
348
|
+
(0, prettier_builder_1.concat)([ctx.Continue[0], " "]),
|
|
345
349
|
identifier,
|
|
346
350
|
ctx.Semicolon[0]
|
|
347
351
|
]);
|
|
348
352
|
}
|
|
349
|
-
return printer_utils_1.rejectAndConcat([ctx.Continue[0], ctx.Semicolon[0]]);
|
|
353
|
+
return (0, printer_utils_1.rejectAndConcat)([ctx.Continue[0], ctx.Semicolon[0]]);
|
|
350
354
|
};
|
|
351
355
|
BlocksAndStatementPrettierVisitor.prototype.returnStatement = function (ctx) {
|
|
352
356
|
if (ctx.expression) {
|
|
353
357
|
var expression = this.visit(ctx.expression, {
|
|
354
358
|
addParenthesisToWrapStatement: true
|
|
355
359
|
});
|
|
356
|
-
return printer_utils_1.rejectAndConcat([
|
|
357
|
-
prettier_builder_1.concat([ctx.Return[0], " "]),
|
|
360
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
361
|
+
(0, prettier_builder_1.concat)([ctx.Return[0], " "]),
|
|
358
362
|
expression,
|
|
359
363
|
ctx.Semicolon[0]
|
|
360
364
|
]);
|
|
361
365
|
}
|
|
362
|
-
return printer_utils_1.rejectAndConcat([ctx.Return[0], ctx.Semicolon[0]]);
|
|
366
|
+
return (0, printer_utils_1.rejectAndConcat)([ctx.Return[0], ctx.Semicolon[0]]);
|
|
363
367
|
};
|
|
364
368
|
BlocksAndStatementPrettierVisitor.prototype.throwStatement = function (ctx) {
|
|
365
369
|
var expression = this.visit(ctx.expression);
|
|
366
|
-
return printer_utils_1.rejectAndConcat([
|
|
367
|
-
prettier_builder_1.concat([ctx.Throw[0], " "]),
|
|
370
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
371
|
+
(0, prettier_builder_1.concat)([ctx.Throw[0], " "]),
|
|
368
372
|
expression,
|
|
369
373
|
ctx.Semicolon[0]
|
|
370
374
|
]);
|
|
@@ -372,11 +376,11 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
372
376
|
BlocksAndStatementPrettierVisitor.prototype.synchronizedStatement = function (ctx) {
|
|
373
377
|
var expression = this.visit(ctx.expression);
|
|
374
378
|
var block = this.visit(ctx.block);
|
|
375
|
-
return printer_utils_1.rejectAndConcat([
|
|
376
|
-
prettier_builder_1.join(" ", [
|
|
379
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
380
|
+
(0, prettier_builder_1.join)(" ", [
|
|
377
381
|
ctx.Synchronized[0],
|
|
378
|
-
prettier_builder_1.concat([
|
|
379
|
-
printer_utils_1.putIntoBraces(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
382
|
+
(0, prettier_builder_1.concat)([
|
|
383
|
+
(0, printer_utils_1.putIntoBraces)(expression, softline, ctx.LBrace[0], ctx.RBrace[0]),
|
|
380
384
|
" "
|
|
381
385
|
])
|
|
382
386
|
]),
|
|
@@ -390,21 +394,21 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
390
394
|
var block = this.visit(ctx.block);
|
|
391
395
|
var catches = this.visit(ctx.catches);
|
|
392
396
|
var finallyBlock = this.visit(ctx.finally);
|
|
393
|
-
return printer_utils_1.rejectAndJoin(" ", [ctx.Try[0], block, catches, finallyBlock]);
|
|
397
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [ctx.Try[0], block, catches, finallyBlock]);
|
|
394
398
|
};
|
|
395
399
|
BlocksAndStatementPrettierVisitor.prototype.catches = function (ctx) {
|
|
396
400
|
var catchClauses = this.mapVisit(ctx.catchClause);
|
|
397
|
-
return printer_utils_1.rejectAndJoin(" ", catchClauses);
|
|
401
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", catchClauses);
|
|
398
402
|
};
|
|
399
403
|
BlocksAndStatementPrettierVisitor.prototype.catchClause = function (ctx) {
|
|
400
404
|
var catchFormalParameter = this.visit(ctx.catchFormalParameter);
|
|
401
405
|
var block = this.visit(ctx.block);
|
|
402
|
-
return printer_utils_1.rejectAndConcat([
|
|
403
|
-
prettier_builder_1.group(printer_utils_1.rejectAndConcat([
|
|
404
|
-
printer_utils_1.rejectAndJoin(" ", [ctx.Catch[0], ctx.LBrace[0]]),
|
|
405
|
-
prettier_builder_1.indent(printer_utils_1.rejectAndConcat([softline, catchFormalParameter])),
|
|
406
|
+
return (0, printer_utils_1.rejectAndConcat)([
|
|
407
|
+
(0, prettier_builder_1.group)((0, printer_utils_1.rejectAndConcat)([
|
|
408
|
+
(0, printer_utils_1.rejectAndJoin)(" ", [ctx.Catch[0], ctx.LBrace[0]]),
|
|
409
|
+
(0, prettier_builder_1.indent)((0, printer_utils_1.rejectAndConcat)([softline, catchFormalParameter])),
|
|
406
410
|
softline,
|
|
407
|
-
prettier_builder_1.concat([ctx.RBrace[0], " "])
|
|
411
|
+
(0, prettier_builder_1.concat)([ctx.RBrace[0], " "])
|
|
408
412
|
])),
|
|
409
413
|
block
|
|
410
414
|
]);
|
|
@@ -413,8 +417,8 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
413
417
|
var variableModifiers = this.mapVisit(ctx.variableModifier);
|
|
414
418
|
var catchType = this.visit(ctx.catchType);
|
|
415
419
|
var variableDeclaratorId = this.visit(ctx.variableDeclaratorId);
|
|
416
|
-
return printer_utils_1.rejectAndJoin(" ", [
|
|
417
|
-
printer_utils_1.rejectAndJoin(" ", variableModifiers),
|
|
420
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [
|
|
421
|
+
(0, printer_utils_1.rejectAndJoin)(" ", variableModifiers),
|
|
418
422
|
catchType,
|
|
419
423
|
variableDeclaratorId
|
|
420
424
|
]);
|
|
@@ -422,19 +426,19 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
422
426
|
BlocksAndStatementPrettierVisitor.prototype.catchType = function (ctx) {
|
|
423
427
|
var unannClassType = this.visit(ctx.unannClassType);
|
|
424
428
|
var classTypes = this.mapVisit(ctx.classType);
|
|
425
|
-
var ors = ctx.Or ? ctx.Or.map(function (elt) { return prettier_builder_1.concat([line, elt, " "]); }) : [];
|
|
426
|
-
return prettier_builder_1.group(printer_utils_1.rejectAndJoinSeps(ors, __spreadArray([unannClassType], classTypes)));
|
|
429
|
+
var ors = ctx.Or ? ctx.Or.map(function (elt) { return (0, prettier_builder_1.concat)([line, elt, " "]); }) : [];
|
|
430
|
+
return (0, prettier_builder_1.group)((0, printer_utils_1.rejectAndJoinSeps)(ors, __spreadArray([unannClassType], classTypes, true)));
|
|
427
431
|
};
|
|
428
432
|
BlocksAndStatementPrettierVisitor.prototype.finally = function (ctx) {
|
|
429
433
|
var block = this.visit(ctx.block);
|
|
430
|
-
return printer_utils_1.rejectAndJoin(" ", [ctx.Finally[0], block]);
|
|
434
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [ctx.Finally[0], block]);
|
|
431
435
|
};
|
|
432
436
|
BlocksAndStatementPrettierVisitor.prototype.tryWithResourcesStatement = function (ctx) {
|
|
433
437
|
var resourceSpecification = this.visit(ctx.resourceSpecification);
|
|
434
438
|
var block = this.visit(ctx.block);
|
|
435
439
|
var catches = this.visit(ctx.catches);
|
|
436
440
|
var finallyBlock = this.visit(ctx.finally);
|
|
437
|
-
return printer_utils_1.rejectAndJoin(" ", [
|
|
441
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [
|
|
438
442
|
ctx.Try[0],
|
|
439
443
|
resourceSpecification,
|
|
440
444
|
block,
|
|
@@ -445,16 +449,16 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
445
449
|
BlocksAndStatementPrettierVisitor.prototype.resourceSpecification = function (ctx) {
|
|
446
450
|
var resourceList = this.visit(ctx.resourceList);
|
|
447
451
|
var optionalSemicolon = ctx.Semicolon ? ctx.Semicolon[0] : "";
|
|
448
|
-
return printer_utils_1.putIntoBraces(printer_utils_1.rejectAndConcat([resourceList, optionalSemicolon]), softline, ctx.LBrace[0], ctx.RBrace[0]);
|
|
452
|
+
return (0, printer_utils_1.putIntoBraces)((0, printer_utils_1.rejectAndConcat)([resourceList, optionalSemicolon]), softline, ctx.LBrace[0], ctx.RBrace[0]);
|
|
449
453
|
};
|
|
450
454
|
BlocksAndStatementPrettierVisitor.prototype.resourceList = function (ctx) {
|
|
451
455
|
var resources = this.mapVisit(ctx.resource);
|
|
452
456
|
var semicolons = ctx.Semicolon
|
|
453
457
|
? ctx.Semicolon.map(function (elt) {
|
|
454
|
-
return prettier_builder_1.concat([elt, line]);
|
|
458
|
+
return (0, prettier_builder_1.concat)([elt, line]);
|
|
455
459
|
})
|
|
456
460
|
: [""];
|
|
457
|
-
return printer_utils_1.rejectAndJoinSeps(semicolons, resources);
|
|
461
|
+
return (0, printer_utils_1.rejectAndJoinSeps)(semicolons, resources);
|
|
458
462
|
};
|
|
459
463
|
BlocksAndStatementPrettierVisitor.prototype.resource = function (ctx) {
|
|
460
464
|
return this.visitSingle(ctx);
|
|
@@ -464,8 +468,8 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
464
468
|
var localVariableType = this.visit(ctx.localVariableType);
|
|
465
469
|
var identifier = ctx.Identifier[0];
|
|
466
470
|
var expression = this.visit(ctx.expression);
|
|
467
|
-
return printer_utils_1.rejectAndJoin(" ", [
|
|
468
|
-
printer_utils_1.rejectAndJoin(" ", variableModifiers),
|
|
471
|
+
return (0, printer_utils_1.rejectAndJoin)(" ", [
|
|
472
|
+
(0, printer_utils_1.rejectAndJoin)(" ", variableModifiers),
|
|
469
473
|
localVariableType,
|
|
470
474
|
identifier,
|
|
471
475
|
ctx.Equals[0],
|
|
@@ -474,7 +478,7 @@ var BlocksAndStatementPrettierVisitor = /** @class */ (function (_super) {
|
|
|
474
478
|
};
|
|
475
479
|
BlocksAndStatementPrettierVisitor.prototype.yieldStatement = function (ctx) {
|
|
476
480
|
var expression = this.visit(ctx.expression);
|
|
477
|
-
return prettier_builder_1.join(" ", [ctx.Yield[0], prettier_builder_1.concat([expression, ctx.Semicolon[0]])]);
|
|
481
|
+
return (0, prettier_builder_1.join)(" ", [ctx.Yield[0], (0, prettier_builder_1.concat)([expression, ctx.Semicolon[0]])]);
|
|
478
482
|
};
|
|
479
483
|
BlocksAndStatementPrettierVisitor.prototype.variableAccess = function (ctx) {
|
|
480
484
|
return this.visitSingle(ctx);
|