source: frontend/node_modules/@babel/generator/lib/generators/deprecated.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.1 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.DecimalLiteral = DecimalLiteral;
7exports.Noop = Noop;
8exports.RecordExpression = RecordExpression;
9exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
10exports.TupleExpression = TupleExpression;
11function Noop() {}
12function TSExpressionWithTypeArguments(node) {
13 this.print(node.expression);
14 this.print(node.typeParameters);
15}
16function DecimalLiteral(node) {
17 const raw = this.getPossibleRaw(node);
18 if (!this.format.minified && raw !== undefined) {
19 this.word(raw);
20 return;
21 }
22 this.word(node.value + "m");
23}
24function RecordExpression(node) {
25 const props = node.properties;
26 let startToken;
27 let endToken;
28 if (this.format.recordAndTupleSyntaxType === "bar") {
29 startToken = "{|";
30 endToken = "|}";
31 } else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) {
32 throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
33 } else {
34 startToken = "#{";
35 endToken = "}";
36 }
37 this.token(startToken);
38 if (props.length) {
39 this.space();
40 this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);
41 this.space();
42 }
43 this.token(endToken);
44}
45function TupleExpression(node) {
46 const elems = node.elements;
47 const len = elems.length;
48 let startToken;
49 let endToken;
50 if (this.format.recordAndTupleSyntaxType === "bar") {
51 startToken = "[|";
52 endToken = "|]";
53 } else if (this.format.recordAndTupleSyntaxType === "hash") {
54 startToken = "#[";
55 endToken = "]";
56 } else {
57 throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
58 }
59 this.token(startToken);
60 for (let i = 0; i < elems.length; i++) {
61 const elem = elems[i];
62 if (elem) {
63 if (i > 0) this.space();
64 this.print(elem);
65 if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {
66 this.token(",", false, i);
67 }
68 }
69 }
70 this.token(endToken);
71}
72
73//# sourceMappingURL=deprecated.js.map
Note: See TracBrowser for help on using the repository browser.