@danielx/civet 0.5.94 → 0.6.1
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/dist/browser.js +441 -747
- package/dist/browser.js.gzip +0 -0
- package/dist/civet +0 -0
- package/dist/main.js +441 -747
- package/dist/main.mjs +441 -747
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -424,13 +424,13 @@ var Civet = (() => {
|
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
426
|
function convertObjectToJSXAttributes(obj) {
|
|
427
|
-
const {
|
|
427
|
+
const { properties } = obj;
|
|
428
428
|
const parts = [];
|
|
429
429
|
const rest = [];
|
|
430
|
-
for (let i = 0; i <
|
|
430
|
+
for (let i = 0; i < properties.length; i++) {
|
|
431
431
|
if (i > 0)
|
|
432
432
|
parts.push(" ");
|
|
433
|
-
const part =
|
|
433
|
+
const part = properties[i];
|
|
434
434
|
switch (part.type) {
|
|
435
435
|
case "Identifier":
|
|
436
436
|
parts.push([part.name, "={", part.name, "}"]);
|
|
@@ -1069,6 +1069,7 @@ ${input.slice(result.pos)}
|
|
|
1069
1069
|
NonPipelineArgumentPart,
|
|
1070
1070
|
BinaryOpExpression,
|
|
1071
1071
|
BinaryOpRHS,
|
|
1072
|
+
SingleLineBinaryOpRHS,
|
|
1072
1073
|
RHS,
|
|
1073
1074
|
ParenthesizedAssignment,
|
|
1074
1075
|
UnaryExpression,
|
|
@@ -1144,6 +1145,7 @@ ${input.slice(result.pos)}
|
|
|
1144
1145
|
BindingIdentifier,
|
|
1145
1146
|
NWBindingIdentifier,
|
|
1146
1147
|
AtIdentifierRef,
|
|
1148
|
+
PinPattern,
|
|
1147
1149
|
BindingPattern,
|
|
1148
1150
|
ObjectBindingPattern,
|
|
1149
1151
|
ObjectBindingPatternContent,
|
|
@@ -1162,21 +1164,6 @@ ${input.slice(result.pos)}
|
|
|
1162
1164
|
BindingElement,
|
|
1163
1165
|
BindingRestElement,
|
|
1164
1166
|
EmptyBindingPattern,
|
|
1165
|
-
MatchingPattern,
|
|
1166
|
-
ObjectMatchingPattern,
|
|
1167
|
-
ObjectMatchingPatternContent,
|
|
1168
|
-
NestedMatchingProperties,
|
|
1169
|
-
MatchingPropertyList,
|
|
1170
|
-
NestedMatchingPropertyList,
|
|
1171
|
-
MatchingProperty,
|
|
1172
|
-
MatchingRestProperty,
|
|
1173
|
-
ArrayMatchingPattern,
|
|
1174
|
-
ArrayMatchingPatternContent,
|
|
1175
|
-
NestedMatchingElements,
|
|
1176
|
-
MatchingElementList,
|
|
1177
|
-
NestedMatchingElementList,
|
|
1178
|
-
MatchingElement,
|
|
1179
|
-
MatchingRestElement,
|
|
1180
1167
|
FunctionDeclaration,
|
|
1181
1168
|
FunctionSignature,
|
|
1182
1169
|
FunctionExpression,
|
|
@@ -1338,6 +1325,10 @@ ${input.slice(result.pos)}
|
|
|
1338
1325
|
AllowMultiLineImplicitObjectLiteral,
|
|
1339
1326
|
RestoreMultiLineImplicitObjectLiteral,
|
|
1340
1327
|
MultiLineImplicitObjectLiteralAllowed,
|
|
1328
|
+
AllowNewlineBinaryOp,
|
|
1329
|
+
ForbidNewlineBinaryOp,
|
|
1330
|
+
RestoreNewlineBinaryOp,
|
|
1331
|
+
NewlineBinaryOpAllowed,
|
|
1341
1332
|
AllowAll,
|
|
1342
1333
|
RestoreAll,
|
|
1343
1334
|
ExpressionStatement,
|
|
@@ -2752,7 +2743,13 @@ ${input.slice(result.pos)}
|
|
|
2752
2743
|
var rhs = $2;
|
|
2753
2744
|
return [[], op, [], rhs];
|
|
2754
2745
|
});
|
|
2755
|
-
var BinaryOpRHS$1 = $S(NotDedented, BinaryOp, $C(_, $S(EOS, __)), RHS)
|
|
2746
|
+
var BinaryOpRHS$1 = $T($S(NewlineBinaryOpAllowed, $S(NotDedented, BinaryOp, $C(_, $S(EOS, __)), RHS)), function(value) {
|
|
2747
|
+
var rhs = value[1];
|
|
2748
|
+
return rhs;
|
|
2749
|
+
});
|
|
2750
|
+
var BinaryOpRHS$2 = $T($S($N(NewlineBinaryOpAllowed), SingleLineBinaryOpRHS), function(value) {
|
|
2751
|
+
return value[1];
|
|
2752
|
+
});
|
|
2756
2753
|
function BinaryOpRHS(state) {
|
|
2757
2754
|
let eventData;
|
|
2758
2755
|
if (state.events) {
|
|
@@ -2764,17 +2761,46 @@ ${input.slice(result.pos)}
|
|
|
2764
2761
|
}
|
|
2765
2762
|
}
|
|
2766
2763
|
if (state.tokenize) {
|
|
2767
|
-
const result = $TOKEN("BinaryOpRHS", state, BinaryOpRHS$0(state) || BinaryOpRHS$1(state));
|
|
2764
|
+
const result = $TOKEN("BinaryOpRHS", state, BinaryOpRHS$0(state) || BinaryOpRHS$1(state) || BinaryOpRHS$2(state));
|
|
2768
2765
|
if (state.events)
|
|
2769
2766
|
state.events.exit?.("BinaryOpRHS", state, result, eventData);
|
|
2770
2767
|
return result;
|
|
2771
2768
|
} else {
|
|
2772
|
-
const result = BinaryOpRHS$0(state) || BinaryOpRHS$1(state);
|
|
2769
|
+
const result = BinaryOpRHS$0(state) || BinaryOpRHS$1(state) || BinaryOpRHS$2(state);
|
|
2773
2770
|
if (state.events)
|
|
2774
2771
|
state.events.exit?.("BinaryOpRHS", state, result, eventData);
|
|
2775
2772
|
return result;
|
|
2776
2773
|
}
|
|
2777
2774
|
}
|
|
2775
|
+
var SingleLineBinaryOpRHS$0 = $TS($S($E(_), BinaryOp, $C(_, $S(EOS, __)), RHS), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
2776
|
+
var ws1 = $1;
|
|
2777
|
+
var op = $2;
|
|
2778
|
+
var ws2 = $3;
|
|
2779
|
+
var rhs = $4;
|
|
2780
|
+
return [ws1 || [], op, ws2, rhs];
|
|
2781
|
+
});
|
|
2782
|
+
function SingleLineBinaryOpRHS(state) {
|
|
2783
|
+
let eventData;
|
|
2784
|
+
if (state.events) {
|
|
2785
|
+
const result = state.events.enter?.("SingleLineBinaryOpRHS", state);
|
|
2786
|
+
if (result) {
|
|
2787
|
+
if (result.cache)
|
|
2788
|
+
return result.cache;
|
|
2789
|
+
eventData = result.data;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
if (state.tokenize) {
|
|
2793
|
+
const result = $TOKEN("SingleLineBinaryOpRHS", state, SingleLineBinaryOpRHS$0(state));
|
|
2794
|
+
if (state.events)
|
|
2795
|
+
state.events.exit?.("SingleLineBinaryOpRHS", state, result, eventData);
|
|
2796
|
+
return result;
|
|
2797
|
+
} else {
|
|
2798
|
+
const result = SingleLineBinaryOpRHS$0(state);
|
|
2799
|
+
if (state.events)
|
|
2800
|
+
state.events.exit?.("SingleLineBinaryOpRHS", state, result, eventData);
|
|
2801
|
+
return result;
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2778
2804
|
var RHS$0 = ParenthesizedAssignment;
|
|
2779
2805
|
var RHS$1 = UnaryExpression;
|
|
2780
2806
|
var RHS$2 = ExpressionizedStatement;
|
|
@@ -5112,20 +5138,41 @@ ${input.slice(result.pos)}
|
|
|
5112
5138
|
return result;
|
|
5113
5139
|
}
|
|
5114
5140
|
}
|
|
5115
|
-
var
|
|
5116
|
-
var
|
|
5117
|
-
return {
|
|
5118
|
-
children: [...$1, p],
|
|
5119
|
-
names: p.names
|
|
5120
|
-
};
|
|
5121
|
-
});
|
|
5122
|
-
var BindingPattern$1 = $TS($S(__, ArrayBindingPattern), function($skip, $loc, $0, $1, $2) {
|
|
5123
|
-
var p = $2;
|
|
5141
|
+
var PinPattern$0 = $TS($S($EXPECT($L17, fail, 'PinPattern "^"'), Identifier), function($skip, $loc, $0, $1, $2) {
|
|
5142
|
+
var identifier = $2;
|
|
5124
5143
|
return {
|
|
5125
|
-
|
|
5126
|
-
|
|
5144
|
+
type: "PinPattern",
|
|
5145
|
+
children: $0,
|
|
5146
|
+
identifier
|
|
5127
5147
|
};
|
|
5128
5148
|
});
|
|
5149
|
+
function PinPattern(state) {
|
|
5150
|
+
let eventData;
|
|
5151
|
+
if (state.events) {
|
|
5152
|
+
const result = state.events.enter?.("PinPattern", state);
|
|
5153
|
+
if (result) {
|
|
5154
|
+
if (result.cache)
|
|
5155
|
+
return result.cache;
|
|
5156
|
+
eventData = result.data;
|
|
5157
|
+
}
|
|
5158
|
+
}
|
|
5159
|
+
if (state.tokenize) {
|
|
5160
|
+
const result = $TOKEN("PinPattern", state, PinPattern$0(state));
|
|
5161
|
+
if (state.events)
|
|
5162
|
+
state.events.exit?.("PinPattern", state, result, eventData);
|
|
5163
|
+
return result;
|
|
5164
|
+
} else {
|
|
5165
|
+
const result = PinPattern$0(state);
|
|
5166
|
+
if (state.events)
|
|
5167
|
+
state.events.exit?.("PinPattern", state, result, eventData);
|
|
5168
|
+
return result;
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
var BindingPattern$0 = ObjectBindingPattern;
|
|
5172
|
+
var BindingPattern$1 = ArrayBindingPattern;
|
|
5173
|
+
var BindingPattern$2 = PinPattern;
|
|
5174
|
+
var BindingPattern$3 = Literal;
|
|
5175
|
+
var BindingPattern$4 = RegularExpressionLiteral;
|
|
5129
5176
|
function BindingPattern(state) {
|
|
5130
5177
|
let eventData;
|
|
5131
5178
|
if (state.events) {
|
|
@@ -5137,24 +5184,24 @@ ${input.slice(result.pos)}
|
|
|
5137
5184
|
}
|
|
5138
5185
|
}
|
|
5139
5186
|
if (state.tokenize) {
|
|
5140
|
-
const result = $TOKEN("BindingPattern", state, BindingPattern$0(state) || BindingPattern$1(state));
|
|
5187
|
+
const result = $TOKEN("BindingPattern", state, BindingPattern$0(state) || BindingPattern$1(state) || BindingPattern$2(state) || BindingPattern$3(state) || BindingPattern$4(state));
|
|
5141
5188
|
if (state.events)
|
|
5142
5189
|
state.events.exit?.("BindingPattern", state, result, eventData);
|
|
5143
5190
|
return result;
|
|
5144
5191
|
} else {
|
|
5145
|
-
const result = BindingPattern$0(state) || BindingPattern$1(state);
|
|
5192
|
+
const result = BindingPattern$0(state) || BindingPattern$1(state) || BindingPattern$2(state) || BindingPattern$3(state) || BindingPattern$4(state);
|
|
5146
5193
|
if (state.events)
|
|
5147
5194
|
state.events.exit?.("BindingPattern", state, result, eventData);
|
|
5148
5195
|
return result;
|
|
5149
5196
|
}
|
|
5150
5197
|
}
|
|
5151
|
-
var ObjectBindingPattern$0 = $TS($S(OpenBrace, ObjectBindingPatternContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
5152
|
-
var c = $
|
|
5198
|
+
var ObjectBindingPattern$0 = $TS($S($E(_), OpenBrace, ObjectBindingPatternContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
5199
|
+
var c = $3;
|
|
5153
5200
|
return {
|
|
5154
5201
|
type: "ObjectBindingPattern",
|
|
5155
|
-
children:
|
|
5156
|
-
|
|
5157
|
-
|
|
5202
|
+
children: $0,
|
|
5203
|
+
names: c.names,
|
|
5204
|
+
properties: c.children
|
|
5158
5205
|
};
|
|
5159
5206
|
});
|
|
5160
5207
|
function ObjectBindingPattern(state) {
|
|
@@ -5181,10 +5228,10 @@ ${input.slice(result.pos)}
|
|
|
5181
5228
|
}
|
|
5182
5229
|
var ObjectBindingPatternContent$0 = NestedBindingProperties;
|
|
5183
5230
|
var ObjectBindingPatternContent$1 = $TV($E(BindingPropertyList), function($skip, $loc, $0, $1) {
|
|
5184
|
-
var
|
|
5185
|
-
if (!
|
|
5231
|
+
var props = $0;
|
|
5232
|
+
if (!props)
|
|
5186
5233
|
return { children: [], names: [] };
|
|
5187
|
-
return module.reorderBindingRestProperty(
|
|
5234
|
+
return module.reorderBindingRestProperty(props);
|
|
5188
5235
|
});
|
|
5189
5236
|
function ObjectBindingPatternContent(state) {
|
|
5190
5237
|
let eventData;
|
|
@@ -5209,8 +5256,8 @@ ${input.slice(result.pos)}
|
|
|
5209
5256
|
}
|
|
5210
5257
|
}
|
|
5211
5258
|
var BindingPropertyList$0 = $TV($P($S(BindingProperty, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
|
|
5212
|
-
var
|
|
5213
|
-
return
|
|
5259
|
+
var props = $0;
|
|
5260
|
+
return props.map(([prop, delim]) => {
|
|
5214
5261
|
return {
|
|
5215
5262
|
...prop,
|
|
5216
5263
|
children: [...prop.children, delim]
|
|
@@ -5239,12 +5286,14 @@ ${input.slice(result.pos)}
|
|
|
5239
5286
|
return result;
|
|
5240
5287
|
}
|
|
5241
5288
|
}
|
|
5242
|
-
var ArrayBindingPattern$0 = $TS($S(OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
5243
|
-
var c = $
|
|
5289
|
+
var ArrayBindingPattern$0 = $TS($S($E(_), OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
5290
|
+
var c = $3;
|
|
5244
5291
|
return {
|
|
5245
5292
|
type: "ArrayBindingPattern",
|
|
5293
|
+
children: $0,
|
|
5246
5294
|
names: c.names,
|
|
5247
|
-
|
|
5295
|
+
elements: c.children,
|
|
5296
|
+
length: c.length
|
|
5248
5297
|
};
|
|
5249
5298
|
});
|
|
5250
5299
|
function ArrayBindingPattern(state) {
|
|
@@ -5273,7 +5322,7 @@ ${input.slice(result.pos)}
|
|
|
5273
5322
|
var ArrayBindingPatternContent$1 = $TV($E(BindingElementList), function($skip, $loc, $0, $1) {
|
|
5274
5323
|
var elements = $0;
|
|
5275
5324
|
if (!elements)
|
|
5276
|
-
return { children: [], names: [] };
|
|
5325
|
+
return { children: [], names: [], length: 0 };
|
|
5277
5326
|
return module.adjustBindingElements(elements);
|
|
5278
5327
|
});
|
|
5279
5328
|
function ArrayBindingPatternContent(state) {
|
|
@@ -5387,10 +5436,10 @@ ${input.slice(result.pos)}
|
|
|
5387
5436
|
}
|
|
5388
5437
|
}
|
|
5389
5438
|
var NestedBindingProperties$0 = $TS($S(PushIndent, $Q(NestedBindingPropertyList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
5390
|
-
var
|
|
5391
|
-
if (!
|
|
5439
|
+
var props = $2;
|
|
5440
|
+
if (!props.length)
|
|
5392
5441
|
return $skip;
|
|
5393
|
-
return module.reorderBindingRestProperty(
|
|
5442
|
+
return module.reorderBindingRestProperty(props.flat());
|
|
5394
5443
|
});
|
|
5395
5444
|
function NestedBindingProperties(state) {
|
|
5396
5445
|
let eventData;
|
|
@@ -5416,8 +5465,8 @@ ${input.slice(result.pos)}
|
|
|
5416
5465
|
}
|
|
5417
5466
|
var NestedBindingPropertyList$0 = $TS($S(Nested, BindingPropertyList), function($skip, $loc, $0, $1, $2) {
|
|
5418
5467
|
var ws = $1;
|
|
5419
|
-
var
|
|
5420
|
-
return
|
|
5468
|
+
var props = $2;
|
|
5469
|
+
return props.map((prop, i) => {
|
|
5421
5470
|
if (i > 0)
|
|
5422
5471
|
return prop;
|
|
5423
5472
|
return {
|
|
@@ -5449,35 +5498,53 @@ ${input.slice(result.pos)}
|
|
|
5449
5498
|
}
|
|
5450
5499
|
}
|
|
5451
5500
|
var BindingProperty$0 = BindingRestProperty;
|
|
5452
|
-
var BindingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
5501
|
+
var BindingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
5453
5502
|
var name = $2;
|
|
5454
|
-
var
|
|
5455
|
-
var init = $
|
|
5503
|
+
var value = $6;
|
|
5504
|
+
var init = $7;
|
|
5456
5505
|
return {
|
|
5506
|
+
type: "BindingProperty",
|
|
5507
|
+
children: $0,
|
|
5457
5508
|
name,
|
|
5458
|
-
value
|
|
5509
|
+
value,
|
|
5459
5510
|
init,
|
|
5460
|
-
names:
|
|
5461
|
-
children: $0
|
|
5511
|
+
names: value.names
|
|
5462
5512
|
};
|
|
5463
5513
|
});
|
|
5464
|
-
var BindingProperty$2 = $TS($S(BindingIdentifier, $E(Initializer)), function($skip, $loc, $0, $1, $2) {
|
|
5465
|
-
var
|
|
5466
|
-
var
|
|
5467
|
-
|
|
5514
|
+
var BindingProperty$2 = $TS($S($E(_), $E($EXPECT($L17, fail, 'BindingProperty "^"')), BindingIdentifier, $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
5515
|
+
var ws = $1;
|
|
5516
|
+
var pin = $2;
|
|
5517
|
+
var binding = $3;
|
|
5518
|
+
var init = $4;
|
|
5519
|
+
if (binding.type === "AtBinding") {
|
|
5468
5520
|
return {
|
|
5469
5521
|
type: "AtBindingProperty",
|
|
5470
|
-
|
|
5522
|
+
children: $0,
|
|
5523
|
+
binding,
|
|
5524
|
+
ref: binding.ref,
|
|
5471
5525
|
init,
|
|
5472
|
-
names: []
|
|
5473
|
-
|
|
5526
|
+
names: []
|
|
5527
|
+
};
|
|
5528
|
+
}
|
|
5529
|
+
if (pin) {
|
|
5530
|
+
return {
|
|
5531
|
+
type: "PinProperty",
|
|
5532
|
+
children: [ws, binding],
|
|
5533
|
+
name: binding,
|
|
5534
|
+
value: {
|
|
5535
|
+
type: "PinPattern",
|
|
5536
|
+
identifier: binding
|
|
5537
|
+
}
|
|
5474
5538
|
};
|
|
5475
5539
|
}
|
|
5476
5540
|
return {
|
|
5477
|
-
|
|
5541
|
+
type: "BindingProperty",
|
|
5542
|
+
children: $0,
|
|
5543
|
+
name: binding,
|
|
5544
|
+
value: void 0,
|
|
5478
5545
|
init,
|
|
5479
|
-
names:
|
|
5480
|
-
|
|
5546
|
+
names: binding.names,
|
|
5547
|
+
identifier: binding
|
|
5481
5548
|
};
|
|
5482
5549
|
});
|
|
5483
5550
|
function BindingProperty(state) {
|
|
@@ -5522,501 +5589,10 @@ ${input.slice(result.pos)}
|
|
|
5522
5589
|
children: [...ws || [], dots, ...id.children]
|
|
5523
5590
|
};
|
|
5524
5591
|
});
|
|
5525
|
-
function BindingRestProperty(state) {
|
|
5526
|
-
let eventData;
|
|
5527
|
-
if (state.events) {
|
|
5528
|
-
const result = state.events.enter?.("BindingRestProperty", state);
|
|
5529
|
-
if (result) {
|
|
5530
|
-
if (result.cache)
|
|
5531
|
-
return result.cache;
|
|
5532
|
-
eventData = result.data;
|
|
5533
|
-
}
|
|
5534
|
-
}
|
|
5535
|
-
if (state.tokenize) {
|
|
5536
|
-
const result = $TOKEN("BindingRestProperty", state, BindingRestProperty$0(state) || BindingRestProperty$1(state));
|
|
5537
|
-
if (state.events)
|
|
5538
|
-
state.events.exit?.("BindingRestProperty", state, result, eventData);
|
|
5539
|
-
return result;
|
|
5540
|
-
} else {
|
|
5541
|
-
const result = BindingRestProperty$0(state) || BindingRestProperty$1(state);
|
|
5542
|
-
if (state.events)
|
|
5543
|
-
state.events.exit?.("BindingRestProperty", state, result, eventData);
|
|
5544
|
-
return result;
|
|
5545
|
-
}
|
|
5546
|
-
}
|
|
5547
|
-
var NestedBindingElements$0 = $TS($S(PushIndent, $Q(NestedBindingElementList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
5548
|
-
var elements = $2;
|
|
5549
|
-
if (!elements.length)
|
|
5550
|
-
return $skip;
|
|
5551
|
-
return module.adjustBindingElements(elements.flat());
|
|
5552
|
-
});
|
|
5553
|
-
function NestedBindingElements(state) {
|
|
5554
|
-
let eventData;
|
|
5555
|
-
if (state.events) {
|
|
5556
|
-
const result = state.events.enter?.("NestedBindingElements", state);
|
|
5557
|
-
if (result) {
|
|
5558
|
-
if (result.cache)
|
|
5559
|
-
return result.cache;
|
|
5560
|
-
eventData = result.data;
|
|
5561
|
-
}
|
|
5562
|
-
}
|
|
5563
|
-
if (state.tokenize) {
|
|
5564
|
-
const result = $TOKEN("NestedBindingElements", state, NestedBindingElements$0(state));
|
|
5565
|
-
if (state.events)
|
|
5566
|
-
state.events.exit?.("NestedBindingElements", state, result, eventData);
|
|
5567
|
-
return result;
|
|
5568
|
-
} else {
|
|
5569
|
-
const result = NestedBindingElements$0(state);
|
|
5570
|
-
if (state.events)
|
|
5571
|
-
state.events.exit?.("NestedBindingElements", state, result, eventData);
|
|
5572
|
-
return result;
|
|
5573
|
-
}
|
|
5574
|
-
}
|
|
5575
|
-
var NestedBindingElement$0 = $TS($S(Nested, BindingElement), function($skip, $loc, $0, $1, $2) {
|
|
5576
|
-
var indent = $1;
|
|
5577
|
-
var element = $2;
|
|
5578
|
-
return {
|
|
5579
|
-
...element,
|
|
5580
|
-
children: [indent, ...element.children]
|
|
5581
|
-
};
|
|
5582
|
-
});
|
|
5583
|
-
function NestedBindingElement(state) {
|
|
5584
|
-
let eventData;
|
|
5585
|
-
if (state.events) {
|
|
5586
|
-
const result = state.events.enter?.("NestedBindingElement", state);
|
|
5587
|
-
if (result) {
|
|
5588
|
-
if (result.cache)
|
|
5589
|
-
return result.cache;
|
|
5590
|
-
eventData = result.data;
|
|
5591
|
-
}
|
|
5592
|
-
}
|
|
5593
|
-
if (state.tokenize) {
|
|
5594
|
-
const result = $TOKEN("NestedBindingElement", state, NestedBindingElement$0(state));
|
|
5595
|
-
if (state.events)
|
|
5596
|
-
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
5597
|
-
return result;
|
|
5598
|
-
} else {
|
|
5599
|
-
const result = NestedBindingElement$0(state);
|
|
5600
|
-
if (state.events)
|
|
5601
|
-
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
5602
|
-
return result;
|
|
5603
|
-
}
|
|
5604
|
-
}
|
|
5605
|
-
var BindingElement$0 = BindingRestElement;
|
|
5606
|
-
var BindingElement$1 = $TS($S($C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2) {
|
|
5607
|
-
var binding = $1;
|
|
5608
|
-
return {
|
|
5609
|
-
names: binding.names,
|
|
5610
|
-
children: $0
|
|
5611
|
-
};
|
|
5612
|
-
});
|
|
5613
|
-
var BindingElement$2 = $TV($Y($S($E(_), $EXPECT($L21, fail, 'BindingElement ","'))), function($skip, $loc, $0, $1) {
|
|
5614
|
-
return {
|
|
5615
|
-
children: [{
|
|
5616
|
-
type: "ElisionElement",
|
|
5617
|
-
children: [""]
|
|
5618
|
-
}],
|
|
5619
|
-
names: []
|
|
5620
|
-
};
|
|
5621
|
-
});
|
|
5622
|
-
function BindingElement(state) {
|
|
5623
|
-
let eventData;
|
|
5624
|
-
if (state.events) {
|
|
5625
|
-
const result = state.events.enter?.("BindingElement", state);
|
|
5626
|
-
if (result) {
|
|
5627
|
-
if (result.cache)
|
|
5628
|
-
return result.cache;
|
|
5629
|
-
eventData = result.data;
|
|
5630
|
-
}
|
|
5631
|
-
}
|
|
5632
|
-
if (state.tokenize) {
|
|
5633
|
-
const result = $TOKEN("BindingElement", state, BindingElement$0(state) || BindingElement$1(state) || BindingElement$2(state));
|
|
5634
|
-
if (state.events)
|
|
5635
|
-
state.events.exit?.("BindingElement", state, result, eventData);
|
|
5636
|
-
return result;
|
|
5637
|
-
} else {
|
|
5638
|
-
const result = BindingElement$0(state) || BindingElement$1(state) || BindingElement$2(state);
|
|
5639
|
-
if (state.events)
|
|
5640
|
-
state.events.exit?.("BindingElement", state, result, eventData);
|
|
5641
|
-
return result;
|
|
5642
|
-
}
|
|
5643
|
-
}
|
|
5644
|
-
var BindingRestElement$0 = $TS($S($E(_), DotDotDot, $C(BindingIdentifier, BindingPattern, EmptyBindingPattern)), function($skip, $loc, $0, $1, $2, $3) {
|
|
5645
|
-
var ws = $1;
|
|
5646
|
-
var dots = $2;
|
|
5647
|
-
var binding = $3;
|
|
5648
|
-
return {
|
|
5649
|
-
...binding,
|
|
5650
|
-
children: [...ws || [], dots, ...binding.children],
|
|
5651
|
-
rest: true
|
|
5652
|
-
};
|
|
5653
|
-
});
|
|
5654
|
-
var BindingRestElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), DotDotDot), function($skip, $loc, $0, $1, $2, $3) {
|
|
5655
|
-
var ws = $1;
|
|
5656
|
-
var binding = $2;
|
|
5657
|
-
var dots = $3;
|
|
5658
|
-
return {
|
|
5659
|
-
...binding,
|
|
5660
|
-
children: [...ws || [], dots, ...binding.children],
|
|
5661
|
-
rest: true
|
|
5662
|
-
};
|
|
5663
|
-
});
|
|
5664
|
-
function BindingRestElement(state) {
|
|
5665
|
-
let eventData;
|
|
5666
|
-
if (state.events) {
|
|
5667
|
-
const result = state.events.enter?.("BindingRestElement", state);
|
|
5668
|
-
if (result) {
|
|
5669
|
-
if (result.cache)
|
|
5670
|
-
return result.cache;
|
|
5671
|
-
eventData = result.data;
|
|
5672
|
-
}
|
|
5673
|
-
}
|
|
5674
|
-
if (state.tokenize) {
|
|
5675
|
-
const result = $TOKEN("BindingRestElement", state, BindingRestElement$0(state) || BindingRestElement$1(state));
|
|
5676
|
-
if (state.events)
|
|
5677
|
-
state.events.exit?.("BindingRestElement", state, result, eventData);
|
|
5678
|
-
return result;
|
|
5679
|
-
} else {
|
|
5680
|
-
const result = BindingRestElement$0(state) || BindingRestElement$1(state);
|
|
5681
|
-
if (state.events)
|
|
5682
|
-
state.events.exit?.("BindingRestElement", state, result, eventData);
|
|
5683
|
-
return result;
|
|
5684
|
-
}
|
|
5685
|
-
}
|
|
5686
|
-
var EmptyBindingPattern$0 = $TV($EXPECT($L0, fail, 'EmptyBindingPattern ""'), function($skip, $loc, $0, $1) {
|
|
5687
|
-
const ref = {
|
|
5688
|
-
type: "Ref",
|
|
5689
|
-
base: "ref",
|
|
5690
|
-
id: "ref"
|
|
5691
|
-
};
|
|
5692
|
-
return {
|
|
5693
|
-
type: "EmptyBinding",
|
|
5694
|
-
children: [ref],
|
|
5695
|
-
names: [],
|
|
5696
|
-
ref
|
|
5697
|
-
};
|
|
5698
|
-
});
|
|
5699
|
-
function EmptyBindingPattern(state) {
|
|
5700
|
-
let eventData;
|
|
5701
|
-
if (state.events) {
|
|
5702
|
-
const result = state.events.enter?.("EmptyBindingPattern", state);
|
|
5703
|
-
if (result) {
|
|
5704
|
-
if (result.cache)
|
|
5705
|
-
return result.cache;
|
|
5706
|
-
eventData = result.data;
|
|
5707
|
-
}
|
|
5708
|
-
}
|
|
5709
|
-
if (state.tokenize) {
|
|
5710
|
-
const result = $TOKEN("EmptyBindingPattern", state, EmptyBindingPattern$0(state));
|
|
5711
|
-
if (state.events)
|
|
5712
|
-
state.events.exit?.("EmptyBindingPattern", state, result, eventData);
|
|
5713
|
-
return result;
|
|
5714
|
-
} else {
|
|
5715
|
-
const result = EmptyBindingPattern$0(state);
|
|
5716
|
-
if (state.events)
|
|
5717
|
-
state.events.exit?.("EmptyBindingPattern", state, result, eventData);
|
|
5718
|
-
return result;
|
|
5719
|
-
}
|
|
5720
|
-
}
|
|
5721
|
-
var MatchingPattern$0 = ObjectMatchingPattern;
|
|
5722
|
-
var MatchingPattern$1 = ArrayMatchingPattern;
|
|
5723
|
-
var MatchingPattern$2 = Literal;
|
|
5724
|
-
var MatchingPattern$3 = RegularExpressionLiteral;
|
|
5725
|
-
function MatchingPattern(state) {
|
|
5726
|
-
let eventData;
|
|
5727
|
-
if (state.events) {
|
|
5728
|
-
const result = state.events.enter?.("MatchingPattern", state);
|
|
5729
|
-
if (result) {
|
|
5730
|
-
if (result.cache)
|
|
5731
|
-
return result.cache;
|
|
5732
|
-
eventData = result.data;
|
|
5733
|
-
}
|
|
5734
|
-
}
|
|
5735
|
-
if (state.tokenize) {
|
|
5736
|
-
const result = $TOKEN("MatchingPattern", state, MatchingPattern$0(state) || MatchingPattern$1(state) || MatchingPattern$2(state) || MatchingPattern$3(state));
|
|
5737
|
-
if (state.events)
|
|
5738
|
-
state.events.exit?.("MatchingPattern", state, result, eventData);
|
|
5739
|
-
return result;
|
|
5740
|
-
} else {
|
|
5741
|
-
const result = MatchingPattern$0(state) || MatchingPattern$1(state) || MatchingPattern$2(state) || MatchingPattern$3(state);
|
|
5742
|
-
if (state.events)
|
|
5743
|
-
state.events.exit?.("MatchingPattern", state, result, eventData);
|
|
5744
|
-
return result;
|
|
5745
|
-
}
|
|
5746
|
-
}
|
|
5747
|
-
var ObjectMatchingPattern$0 = $TS($S($E(_), OpenBrace, ObjectMatchingPatternContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
5748
|
-
var ws = $1;
|
|
5749
|
-
var open = $2;
|
|
5750
|
-
var properties = $3;
|
|
5751
|
-
var ws = $4;
|
|
5752
|
-
var close = $5;
|
|
5753
|
-
return {
|
|
5754
|
-
type: "ObjectMatchingPattern",
|
|
5755
|
-
children: [ws, open, ...properties.children, ...ws, close],
|
|
5756
|
-
properties: properties.children
|
|
5757
|
-
};
|
|
5758
|
-
});
|
|
5759
|
-
function ObjectMatchingPattern(state) {
|
|
5760
|
-
let eventData;
|
|
5761
|
-
if (state.events) {
|
|
5762
|
-
const result = state.events.enter?.("ObjectMatchingPattern", state);
|
|
5763
|
-
if (result) {
|
|
5764
|
-
if (result.cache)
|
|
5765
|
-
return result.cache;
|
|
5766
|
-
eventData = result.data;
|
|
5767
|
-
}
|
|
5768
|
-
}
|
|
5769
|
-
if (state.tokenize) {
|
|
5770
|
-
const result = $TOKEN("ObjectMatchingPattern", state, ObjectMatchingPattern$0(state));
|
|
5771
|
-
if (state.events)
|
|
5772
|
-
state.events.exit?.("ObjectMatchingPattern", state, result, eventData);
|
|
5773
|
-
return result;
|
|
5774
|
-
} else {
|
|
5775
|
-
const result = ObjectMatchingPattern$0(state);
|
|
5776
|
-
if (state.events)
|
|
5777
|
-
state.events.exit?.("ObjectMatchingPattern", state, result, eventData);
|
|
5778
|
-
return result;
|
|
5779
|
-
}
|
|
5780
|
-
}
|
|
5781
|
-
var ObjectMatchingPatternContent$0 = NestedMatchingProperties;
|
|
5782
|
-
var ObjectMatchingPatternContent$1 = $TV($E(MatchingPropertyList), function($skip, $loc, $0, $1) {
|
|
5783
|
-
var properties = $0;
|
|
5784
|
-
if (!properties)
|
|
5785
|
-
return { children: [], names: [] };
|
|
5786
|
-
return module.reorderBindingRestProperty(properties);
|
|
5787
|
-
});
|
|
5788
|
-
function ObjectMatchingPatternContent(state) {
|
|
5789
|
-
let eventData;
|
|
5790
|
-
if (state.events) {
|
|
5791
|
-
const result = state.events.enter?.("ObjectMatchingPatternContent", state);
|
|
5792
|
-
if (result) {
|
|
5793
|
-
if (result.cache)
|
|
5794
|
-
return result.cache;
|
|
5795
|
-
eventData = result.data;
|
|
5796
|
-
}
|
|
5797
|
-
}
|
|
5798
|
-
if (state.tokenize) {
|
|
5799
|
-
const result = $TOKEN("ObjectMatchingPatternContent", state, ObjectMatchingPatternContent$0(state) || ObjectMatchingPatternContent$1(state));
|
|
5800
|
-
if (state.events)
|
|
5801
|
-
state.events.exit?.("ObjectMatchingPatternContent", state, result, eventData);
|
|
5802
|
-
return result;
|
|
5803
|
-
} else {
|
|
5804
|
-
const result = ObjectMatchingPatternContent$0(state) || ObjectMatchingPatternContent$1(state);
|
|
5805
|
-
if (state.events)
|
|
5806
|
-
state.events.exit?.("ObjectMatchingPatternContent", state, result, eventData);
|
|
5807
|
-
return result;
|
|
5808
|
-
}
|
|
5809
|
-
}
|
|
5810
|
-
var NestedMatchingProperties$0 = $TS($S(PushIndent, $Q(NestedMatchingPropertyList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
5811
|
-
var properties = $2;
|
|
5812
|
-
if (!props.length)
|
|
5813
|
-
return $skip;
|
|
5814
|
-
return module.reorderBindingRestProperty(props.flat());
|
|
5815
|
-
});
|
|
5816
|
-
function NestedMatchingProperties(state) {
|
|
5817
|
-
let eventData;
|
|
5818
|
-
if (state.events) {
|
|
5819
|
-
const result = state.events.enter?.("NestedMatchingProperties", state);
|
|
5820
|
-
if (result) {
|
|
5821
|
-
if (result.cache)
|
|
5822
|
-
return result.cache;
|
|
5823
|
-
eventData = result.data;
|
|
5824
|
-
}
|
|
5825
|
-
}
|
|
5826
|
-
if (state.tokenize) {
|
|
5827
|
-
const result = $TOKEN("NestedMatchingProperties", state, NestedMatchingProperties$0(state));
|
|
5828
|
-
if (state.events)
|
|
5829
|
-
state.events.exit?.("NestedMatchingProperties", state, result, eventData);
|
|
5830
|
-
return result;
|
|
5831
|
-
} else {
|
|
5832
|
-
const result = NestedMatchingProperties$0(state);
|
|
5833
|
-
if (state.events)
|
|
5834
|
-
state.events.exit?.("NestedMatchingProperties", state, result, eventData);
|
|
5835
|
-
return result;
|
|
5836
|
-
}
|
|
5837
|
-
}
|
|
5838
|
-
var MatchingPropertyList$0 = $TV($P($S(MatchingProperty, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
|
|
5839
|
-
var props2 = $0;
|
|
5840
|
-
return props2.map(([prop, delim]) => {
|
|
5841
|
-
return {
|
|
5842
|
-
...prop,
|
|
5843
|
-
children: [...prop.children, delim]
|
|
5844
|
-
};
|
|
5845
|
-
});
|
|
5846
|
-
});
|
|
5847
|
-
function MatchingPropertyList(state) {
|
|
5848
|
-
let eventData;
|
|
5849
|
-
if (state.events) {
|
|
5850
|
-
const result = state.events.enter?.("MatchingPropertyList", state);
|
|
5851
|
-
if (result) {
|
|
5852
|
-
if (result.cache)
|
|
5853
|
-
return result.cache;
|
|
5854
|
-
eventData = result.data;
|
|
5855
|
-
}
|
|
5856
|
-
}
|
|
5857
|
-
if (state.tokenize) {
|
|
5858
|
-
const result = $TOKEN("MatchingPropertyList", state, MatchingPropertyList$0(state));
|
|
5859
|
-
if (state.events)
|
|
5860
|
-
state.events.exit?.("MatchingPropertyList", state, result, eventData);
|
|
5861
|
-
return result;
|
|
5862
|
-
} else {
|
|
5863
|
-
const result = MatchingPropertyList$0(state);
|
|
5864
|
-
if (state.events)
|
|
5865
|
-
state.events.exit?.("MatchingPropertyList", state, result, eventData);
|
|
5866
|
-
return result;
|
|
5867
|
-
}
|
|
5868
|
-
}
|
|
5869
|
-
var NestedMatchingPropertyList$0 = $TS($S(Nested, MatchingPropertyList), function($skip, $loc, $0, $1, $2) {
|
|
5870
|
-
var ws = $1;
|
|
5871
|
-
var props2 = $2;
|
|
5872
|
-
return props2.map((prop, i) => {
|
|
5873
|
-
if (i > 0)
|
|
5874
|
-
return prop;
|
|
5875
|
-
return {
|
|
5876
|
-
...prop,
|
|
5877
|
-
children: [ws, ...prop.children]
|
|
5878
|
-
};
|
|
5879
|
-
});
|
|
5880
|
-
});
|
|
5881
|
-
function NestedMatchingPropertyList(state) {
|
|
5882
|
-
let eventData;
|
|
5883
|
-
if (state.events) {
|
|
5884
|
-
const result = state.events.enter?.("NestedMatchingPropertyList", state);
|
|
5885
|
-
if (result) {
|
|
5886
|
-
if (result.cache)
|
|
5887
|
-
return result.cache;
|
|
5888
|
-
eventData = result.data;
|
|
5889
|
-
}
|
|
5890
|
-
}
|
|
5891
|
-
if (state.tokenize) {
|
|
5892
|
-
const result = $TOKEN("NestedMatchingPropertyList", state, NestedMatchingPropertyList$0(state));
|
|
5893
|
-
if (state.events)
|
|
5894
|
-
state.events.exit?.("NestedMatchingPropertyList", state, result, eventData);
|
|
5895
|
-
return result;
|
|
5896
|
-
} else {
|
|
5897
|
-
const result = NestedMatchingPropertyList$0(state);
|
|
5898
|
-
if (state.events)
|
|
5899
|
-
state.events.exit?.("NestedMatchingPropertyList", state, result, eventData);
|
|
5900
|
-
return result;
|
|
5901
|
-
}
|
|
5902
|
-
}
|
|
5903
|
-
var MatchingProperty$0 = MatchingRestProperty;
|
|
5904
|
-
var MatchingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $E(_), $C(BindingIdentifier, MatchingPattern)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
5905
|
-
var name = $2;
|
|
5906
|
-
var match = $6;
|
|
5907
|
-
return {
|
|
5908
|
-
type: "BindingMatchProperty",
|
|
5909
|
-
name,
|
|
5910
|
-
match,
|
|
5911
|
-
children: $0
|
|
5912
|
-
};
|
|
5913
|
-
});
|
|
5914
|
-
var MatchingProperty$2 = $TS($S($E(_), BindingIdentifier), function($skip, $loc, $0, $1, $2) {
|
|
5915
|
-
var ws = $1;
|
|
5916
|
-
var b = $2;
|
|
5917
|
-
if (b.type === "AtBinding") {
|
|
5918
|
-
return {
|
|
5919
|
-
type: "AtBindingProperty",
|
|
5920
|
-
ref: b.ref,
|
|
5921
|
-
names: [],
|
|
5922
|
-
children: [ws, b]
|
|
5923
|
-
};
|
|
5924
|
-
}
|
|
5925
|
-
return {
|
|
5926
|
-
type: "BindingProperty",
|
|
5927
|
-
names: b.names,
|
|
5928
|
-
children: [ws, b],
|
|
5929
|
-
identifier: b
|
|
5930
|
-
};
|
|
5931
|
-
});
|
|
5932
|
-
function MatchingProperty(state) {
|
|
5933
|
-
let eventData;
|
|
5934
|
-
if (state.events) {
|
|
5935
|
-
const result = state.events.enter?.("MatchingProperty", state);
|
|
5936
|
-
if (result) {
|
|
5937
|
-
if (result.cache)
|
|
5938
|
-
return result.cache;
|
|
5939
|
-
eventData = result.data;
|
|
5940
|
-
}
|
|
5941
|
-
}
|
|
5942
|
-
if (state.tokenize) {
|
|
5943
|
-
const result = $TOKEN("MatchingProperty", state, MatchingProperty$0(state) || MatchingProperty$1(state) || MatchingProperty$2(state));
|
|
5944
|
-
if (state.events)
|
|
5945
|
-
state.events.exit?.("MatchingProperty", state, result, eventData);
|
|
5946
|
-
return result;
|
|
5947
|
-
} else {
|
|
5948
|
-
const result = MatchingProperty$0(state) || MatchingProperty$1(state) || MatchingProperty$2(state);
|
|
5949
|
-
if (state.events)
|
|
5950
|
-
state.events.exit?.("MatchingProperty", state, result, eventData);
|
|
5951
|
-
return result;
|
|
5952
|
-
}
|
|
5953
|
-
}
|
|
5954
|
-
var MatchingRestProperty$0 = BindingRestProperty;
|
|
5955
|
-
function MatchingRestProperty(state) {
|
|
5956
|
-
let eventData;
|
|
5957
|
-
if (state.events) {
|
|
5958
|
-
const result = state.events.enter?.("MatchingRestProperty", state);
|
|
5959
|
-
if (result) {
|
|
5960
|
-
if (result.cache)
|
|
5961
|
-
return result.cache;
|
|
5962
|
-
eventData = result.data;
|
|
5963
|
-
}
|
|
5964
|
-
}
|
|
5965
|
-
if (state.tokenize) {
|
|
5966
|
-
const result = $TOKEN("MatchingRestProperty", state, MatchingRestProperty$0(state));
|
|
5967
|
-
if (state.events)
|
|
5968
|
-
state.events.exit?.("MatchingRestProperty", state, result, eventData);
|
|
5969
|
-
return result;
|
|
5970
|
-
} else {
|
|
5971
|
-
const result = MatchingRestProperty$0(state);
|
|
5972
|
-
if (state.events)
|
|
5973
|
-
state.events.exit?.("MatchingRestProperty", state, result, eventData);
|
|
5974
|
-
return result;
|
|
5975
|
-
}
|
|
5976
|
-
}
|
|
5977
|
-
var ArrayMatchingPattern$0 = $TS($S($E(_), OpenBracket, ArrayMatchingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
5978
|
-
var ws = $1;
|
|
5979
|
-
var elements = $3;
|
|
5980
|
-
return {
|
|
5981
|
-
type: "ArrayMatchingPattern",
|
|
5982
|
-
children: $0,
|
|
5983
|
-
elements: elements.children,
|
|
5984
|
-
length: elements.length
|
|
5985
|
-
};
|
|
5986
|
-
});
|
|
5987
|
-
function ArrayMatchingPattern(state) {
|
|
5988
|
-
let eventData;
|
|
5989
|
-
if (state.events) {
|
|
5990
|
-
const result = state.events.enter?.("ArrayMatchingPattern", state);
|
|
5991
|
-
if (result) {
|
|
5992
|
-
if (result.cache)
|
|
5993
|
-
return result.cache;
|
|
5994
|
-
eventData = result.data;
|
|
5995
|
-
}
|
|
5996
|
-
}
|
|
5997
|
-
if (state.tokenize) {
|
|
5998
|
-
const result = $TOKEN("ArrayMatchingPattern", state, ArrayMatchingPattern$0(state));
|
|
5999
|
-
if (state.events)
|
|
6000
|
-
state.events.exit?.("ArrayMatchingPattern", state, result, eventData);
|
|
6001
|
-
return result;
|
|
6002
|
-
} else {
|
|
6003
|
-
const result = ArrayMatchingPattern$0(state);
|
|
6004
|
-
if (state.events)
|
|
6005
|
-
state.events.exit?.("ArrayMatchingPattern", state, result, eventData);
|
|
6006
|
-
return result;
|
|
6007
|
-
}
|
|
6008
|
-
}
|
|
6009
|
-
var ArrayMatchingPatternContent$0 = NestedMatchingElements;
|
|
6010
|
-
var ArrayMatchingPatternContent$1 = $TV($E(MatchingElementList), function($skip, $loc, $0, $1) {
|
|
6011
|
-
var elements = $0;
|
|
6012
|
-
if (!elements)
|
|
6013
|
-
return { children: [], names: [], length: 0 };
|
|
6014
|
-
return module.adjustBindingElements(elements);
|
|
6015
|
-
});
|
|
6016
|
-
function ArrayMatchingPatternContent(state) {
|
|
5592
|
+
function BindingRestProperty(state) {
|
|
6017
5593
|
let eventData;
|
|
6018
5594
|
if (state.events) {
|
|
6019
|
-
const result = state.events.enter?.("
|
|
5595
|
+
const result = state.events.enter?.("BindingRestProperty", state);
|
|
6020
5596
|
if (result) {
|
|
6021
5597
|
if (result.cache)
|
|
6022
5598
|
return result.cache;
|
|
@@ -6024,25 +5600,27 @@ ${input.slice(result.pos)}
|
|
|
6024
5600
|
}
|
|
6025
5601
|
}
|
|
6026
5602
|
if (state.tokenize) {
|
|
6027
|
-
const result = $TOKEN("
|
|
5603
|
+
const result = $TOKEN("BindingRestProperty", state, BindingRestProperty$0(state) || BindingRestProperty$1(state));
|
|
6028
5604
|
if (state.events)
|
|
6029
|
-
state.events.exit?.("
|
|
5605
|
+
state.events.exit?.("BindingRestProperty", state, result, eventData);
|
|
6030
5606
|
return result;
|
|
6031
5607
|
} else {
|
|
6032
|
-
const result =
|
|
5608
|
+
const result = BindingRestProperty$0(state) || BindingRestProperty$1(state);
|
|
6033
5609
|
if (state.events)
|
|
6034
|
-
state.events.exit?.("
|
|
5610
|
+
state.events.exit?.("BindingRestProperty", state, result, eventData);
|
|
6035
5611
|
return result;
|
|
6036
5612
|
}
|
|
6037
5613
|
}
|
|
6038
|
-
var
|
|
5614
|
+
var NestedBindingElements$0 = $TS($S(PushIndent, $Q(NestedBindingElementList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
6039
5615
|
var elements = $2;
|
|
5616
|
+
if (!elements.length)
|
|
5617
|
+
return $skip;
|
|
6040
5618
|
return module.adjustBindingElements(elements.flat());
|
|
6041
5619
|
});
|
|
6042
|
-
function
|
|
5620
|
+
function NestedBindingElements(state) {
|
|
6043
5621
|
let eventData;
|
|
6044
5622
|
if (state.events) {
|
|
6045
|
-
const result = state.events.enter?.("
|
|
5623
|
+
const result = state.events.enter?.("NestedBindingElements", state);
|
|
6046
5624
|
if (result) {
|
|
6047
5625
|
if (result.cache)
|
|
6048
5626
|
return result.cache;
|
|
@@ -6050,30 +5628,29 @@ ${input.slice(result.pos)}
|
|
|
6050
5628
|
}
|
|
6051
5629
|
}
|
|
6052
5630
|
if (state.tokenize) {
|
|
6053
|
-
const result = $TOKEN("
|
|
5631
|
+
const result = $TOKEN("NestedBindingElements", state, NestedBindingElements$0(state));
|
|
6054
5632
|
if (state.events)
|
|
6055
|
-
state.events.exit?.("
|
|
5633
|
+
state.events.exit?.("NestedBindingElements", state, result, eventData);
|
|
6056
5634
|
return result;
|
|
6057
5635
|
} else {
|
|
6058
|
-
const result =
|
|
5636
|
+
const result = NestedBindingElements$0(state);
|
|
6059
5637
|
if (state.events)
|
|
6060
|
-
state.events.exit?.("
|
|
5638
|
+
state.events.exit?.("NestedBindingElements", state, result, eventData);
|
|
6061
5639
|
return result;
|
|
6062
5640
|
}
|
|
6063
5641
|
}
|
|
6064
|
-
var
|
|
6065
|
-
var
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
});
|
|
5642
|
+
var NestedBindingElement$0 = $TS($S(Nested, BindingElement), function($skip, $loc, $0, $1, $2) {
|
|
5643
|
+
var indent = $1;
|
|
5644
|
+
var element = $2;
|
|
5645
|
+
return {
|
|
5646
|
+
...element,
|
|
5647
|
+
children: [indent, ...element.children]
|
|
5648
|
+
};
|
|
6072
5649
|
});
|
|
6073
|
-
function
|
|
5650
|
+
function NestedBindingElement(state) {
|
|
6074
5651
|
let eventData;
|
|
6075
5652
|
if (state.events) {
|
|
6076
|
-
const result = state.events.enter?.("
|
|
5653
|
+
const result = state.events.enter?.("NestedBindingElement", state);
|
|
6077
5654
|
if (result) {
|
|
6078
5655
|
if (result.cache)
|
|
6079
5656
|
return result.cache;
|
|
@@ -6081,33 +5658,46 @@ ${input.slice(result.pos)}
|
|
|
6081
5658
|
}
|
|
6082
5659
|
}
|
|
6083
5660
|
if (state.tokenize) {
|
|
6084
|
-
const result = $TOKEN("
|
|
5661
|
+
const result = $TOKEN("NestedBindingElement", state, NestedBindingElement$0(state));
|
|
6085
5662
|
if (state.events)
|
|
6086
|
-
state.events.exit?.("
|
|
5663
|
+
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
6087
5664
|
return result;
|
|
6088
5665
|
} else {
|
|
6089
|
-
const result =
|
|
5666
|
+
const result = NestedBindingElement$0(state);
|
|
6090
5667
|
if (state.events)
|
|
6091
|
-
state.events.exit?.("
|
|
5668
|
+
state.events.exit?.("NestedBindingElement", state, result, eventData);
|
|
6092
5669
|
return result;
|
|
6093
5670
|
}
|
|
6094
5671
|
}
|
|
6095
|
-
var
|
|
5672
|
+
var BindingElement$0 = BindingRestElement;
|
|
5673
|
+
var BindingElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
|
|
6096
5674
|
var ws = $1;
|
|
6097
|
-
var
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
...
|
|
6103
|
-
children: [ws, ...element.children]
|
|
5675
|
+
var binding = $2;
|
|
5676
|
+
var initializer = $3;
|
|
5677
|
+
if (binding.children) {
|
|
5678
|
+
binding = {
|
|
5679
|
+
...binding,
|
|
5680
|
+
children: [...binding.children, initializer]
|
|
6104
5681
|
};
|
|
6105
|
-
}
|
|
5682
|
+
}
|
|
5683
|
+
return {
|
|
5684
|
+
names: binding.names,
|
|
5685
|
+
children: [ws, binding]
|
|
5686
|
+
};
|
|
5687
|
+
});
|
|
5688
|
+
var BindingElement$2 = $TV($Y($S($E(_), $EXPECT($L21, fail, 'BindingElement ","'))), function($skip, $loc, $0, $1) {
|
|
5689
|
+
return {
|
|
5690
|
+
children: [{
|
|
5691
|
+
type: "ElisionElement",
|
|
5692
|
+
children: [""]
|
|
5693
|
+
}],
|
|
5694
|
+
names: []
|
|
5695
|
+
};
|
|
6106
5696
|
});
|
|
6107
|
-
function
|
|
5697
|
+
function BindingElement(state) {
|
|
6108
5698
|
let eventData;
|
|
6109
5699
|
if (state.events) {
|
|
6110
|
-
const result = state.events.enter?.("
|
|
5700
|
+
const result = state.events.enter?.("BindingElement", state);
|
|
6111
5701
|
if (result) {
|
|
6112
5702
|
if (result.cache)
|
|
6113
5703
|
return result.cache;
|
|
@@ -6115,63 +5705,41 @@ ${input.slice(result.pos)}
|
|
|
6115
5705
|
}
|
|
6116
5706
|
}
|
|
6117
5707
|
if (state.tokenize) {
|
|
6118
|
-
const result = $TOKEN("
|
|
5708
|
+
const result = $TOKEN("BindingElement", state, BindingElement$0(state) || BindingElement$1(state) || BindingElement$2(state));
|
|
6119
5709
|
if (state.events)
|
|
6120
|
-
state.events.exit?.("
|
|
5710
|
+
state.events.exit?.("BindingElement", state, result, eventData);
|
|
6121
5711
|
return result;
|
|
6122
5712
|
} else {
|
|
6123
|
-
const result =
|
|
5713
|
+
const result = BindingElement$0(state) || BindingElement$1(state) || BindingElement$2(state);
|
|
6124
5714
|
if (state.events)
|
|
6125
|
-
state.events.exit?.("
|
|
5715
|
+
state.events.exit?.("BindingElement", state, result, eventData);
|
|
6126
5716
|
return result;
|
|
6127
5717
|
}
|
|
6128
5718
|
}
|
|
6129
|
-
var
|
|
6130
|
-
var MatchingElement$1 = $TS($S($E(_), BindingIdentifier, $E(_), Colon, $E(_), $C(BindingIdentifier, MatchingPattern)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
|
|
5719
|
+
var BindingRestElement$0 = $TS($S($E(_), DotDotDot, $C(BindingIdentifier, BindingPattern, EmptyBindingPattern)), function($skip, $loc, $0, $1, $2, $3) {
|
|
6131
5720
|
var ws = $1;
|
|
6132
|
-
var
|
|
6133
|
-
var
|
|
6134
|
-
let blockPrefix;
|
|
6135
|
-
switch (match.type) {
|
|
6136
|
-
case "ArrayMatchingPattern":
|
|
6137
|
-
case "ObjectMatchingPattern":
|
|
6138
|
-
blockPrefix = [match, " = ", name];
|
|
6139
|
-
break;
|
|
6140
|
-
default:
|
|
6141
|
-
break;
|
|
6142
|
-
}
|
|
5721
|
+
var dots = $2;
|
|
5722
|
+
var binding = $3;
|
|
6143
5723
|
return {
|
|
6144
|
-
|
|
6145
|
-
children: [ws,
|
|
6146
|
-
|
|
6147
|
-
name,
|
|
6148
|
-
match,
|
|
6149
|
-
children: [name],
|
|
6150
|
-
blockPrefix
|
|
6151
|
-
}]
|
|
5724
|
+
...binding,
|
|
5725
|
+
children: [...ws || [], dots, ...binding.children],
|
|
5726
|
+
rest: true
|
|
6152
5727
|
};
|
|
6153
5728
|
});
|
|
6154
|
-
var
|
|
5729
|
+
var BindingRestElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), DotDotDot), function($skip, $loc, $0, $1, $2, $3) {
|
|
6155
5730
|
var ws = $1;
|
|
6156
5731
|
var binding = $2;
|
|
5732
|
+
var dots = $3;
|
|
6157
5733
|
return {
|
|
6158
|
-
|
|
6159
|
-
children: [ws, binding]
|
|
6160
|
-
|
|
6161
|
-
});
|
|
6162
|
-
var MatchingElement$3 = $TV($Y($S($E(_), $EXPECT($L21, fail, 'MatchingElement ","'))), function($skip, $loc, $0, $1) {
|
|
6163
|
-
return {
|
|
6164
|
-
children: [{
|
|
6165
|
-
type: "ElisionElement",
|
|
6166
|
-
children: [""]
|
|
6167
|
-
}],
|
|
6168
|
-
names: []
|
|
5734
|
+
...binding,
|
|
5735
|
+
children: [...ws || [], dots, ...binding.children],
|
|
5736
|
+
rest: true
|
|
6169
5737
|
};
|
|
6170
5738
|
});
|
|
6171
|
-
function
|
|
5739
|
+
function BindingRestElement(state) {
|
|
6172
5740
|
let eventData;
|
|
6173
5741
|
if (state.events) {
|
|
6174
|
-
const result = state.events.enter?.("
|
|
5742
|
+
const result = state.events.enter?.("BindingRestElement", state);
|
|
6175
5743
|
if (result) {
|
|
6176
5744
|
if (result.cache)
|
|
6177
5745
|
return result.cache;
|
|
@@ -6179,22 +5747,34 @@ ${input.slice(result.pos)}
|
|
|
6179
5747
|
}
|
|
6180
5748
|
}
|
|
6181
5749
|
if (state.tokenize) {
|
|
6182
|
-
const result = $TOKEN("
|
|
5750
|
+
const result = $TOKEN("BindingRestElement", state, BindingRestElement$0(state) || BindingRestElement$1(state));
|
|
6183
5751
|
if (state.events)
|
|
6184
|
-
state.events.exit?.("
|
|
5752
|
+
state.events.exit?.("BindingRestElement", state, result, eventData);
|
|
6185
5753
|
return result;
|
|
6186
5754
|
} else {
|
|
6187
|
-
const result =
|
|
5755
|
+
const result = BindingRestElement$0(state) || BindingRestElement$1(state);
|
|
6188
5756
|
if (state.events)
|
|
6189
|
-
state.events.exit?.("
|
|
5757
|
+
state.events.exit?.("BindingRestElement", state, result, eventData);
|
|
6190
5758
|
return result;
|
|
6191
5759
|
}
|
|
6192
5760
|
}
|
|
6193
|
-
var
|
|
6194
|
-
|
|
5761
|
+
var EmptyBindingPattern$0 = $TV($EXPECT($L0, fail, 'EmptyBindingPattern ""'), function($skip, $loc, $0, $1) {
|
|
5762
|
+
const ref = {
|
|
5763
|
+
type: "Ref",
|
|
5764
|
+
base: "ref",
|
|
5765
|
+
id: "ref"
|
|
5766
|
+
};
|
|
5767
|
+
return {
|
|
5768
|
+
type: "EmptyBinding",
|
|
5769
|
+
children: [ref],
|
|
5770
|
+
names: [],
|
|
5771
|
+
ref
|
|
5772
|
+
};
|
|
5773
|
+
});
|
|
5774
|
+
function EmptyBindingPattern(state) {
|
|
6195
5775
|
let eventData;
|
|
6196
5776
|
if (state.events) {
|
|
6197
|
-
const result = state.events.enter?.("
|
|
5777
|
+
const result = state.events.enter?.("EmptyBindingPattern", state);
|
|
6198
5778
|
if (result) {
|
|
6199
5779
|
if (result.cache)
|
|
6200
5780
|
return result.cache;
|
|
@@ -6202,14 +5782,14 @@ ${input.slice(result.pos)}
|
|
|
6202
5782
|
}
|
|
6203
5783
|
}
|
|
6204
5784
|
if (state.tokenize) {
|
|
6205
|
-
const result = $TOKEN("
|
|
5785
|
+
const result = $TOKEN("EmptyBindingPattern", state, EmptyBindingPattern$0(state));
|
|
6206
5786
|
if (state.events)
|
|
6207
|
-
state.events.exit?.("
|
|
5787
|
+
state.events.exit?.("EmptyBindingPattern", state, result, eventData);
|
|
6208
5788
|
return result;
|
|
6209
5789
|
} else {
|
|
6210
|
-
const result =
|
|
5790
|
+
const result = EmptyBindingPattern$0(state);
|
|
6211
5791
|
if (state.events)
|
|
6212
|
-
state.events.exit?.("
|
|
5792
|
+
state.events.exit?.("EmptyBindingPattern", state, result, eventData);
|
|
6213
5793
|
return result;
|
|
6214
5794
|
}
|
|
6215
5795
|
}
|
|
@@ -7914,16 +7494,16 @@ ${input.slice(result.pos)}
|
|
|
7914
7494
|
var open = $1;
|
|
7915
7495
|
if (!$3)
|
|
7916
7496
|
return $skip;
|
|
7917
|
-
const [
|
|
7918
|
-
if (
|
|
7919
|
-
const children = [open, ...
|
|
7497
|
+
const [properties, ...close] = $3;
|
|
7498
|
+
if (properties) {
|
|
7499
|
+
const children = [open, ...properties, close];
|
|
7920
7500
|
return {
|
|
7921
7501
|
type: "ObjectExpression",
|
|
7922
|
-
content,
|
|
7923
7502
|
children,
|
|
7924
7503
|
names: children.flatMap((c) => {
|
|
7925
7504
|
return c.names || [];
|
|
7926
|
-
})
|
|
7505
|
+
}),
|
|
7506
|
+
properties
|
|
7927
7507
|
};
|
|
7928
7508
|
}
|
|
7929
7509
|
return {
|
|
@@ -11030,7 +10610,7 @@ ${input.slice(result.pos)}
|
|
|
11030
10610
|
return result;
|
|
11031
10611
|
}
|
|
11032
10612
|
}
|
|
11033
|
-
var CaseClause$0 = $TS($S(
|
|
10613
|
+
var CaseClause$0 = $TS($S(BindingPattern, $C(ThenClause, NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2) {
|
|
11034
10614
|
var pattern = $1;
|
|
11035
10615
|
var block = $2;
|
|
11036
10616
|
return {
|
|
@@ -11040,10 +10620,23 @@ ${input.slice(result.pos)}
|
|
|
11040
10620
|
pattern
|
|
11041
10621
|
};
|
|
11042
10622
|
});
|
|
11043
|
-
var CaseClause$1 = $
|
|
10623
|
+
var CaseClause$1 = $TS($S($P(SingleLineBinaryOpRHS), $C(ThenClause, NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2) {
|
|
10624
|
+
var pattern = $1;
|
|
10625
|
+
var block = $2;
|
|
10626
|
+
return {
|
|
10627
|
+
type: "PatternClause",
|
|
10628
|
+
children: $0,
|
|
10629
|
+
block,
|
|
10630
|
+
pattern: {
|
|
10631
|
+
type: "ConditionFragment",
|
|
10632
|
+
children: pattern
|
|
10633
|
+
}
|
|
10634
|
+
};
|
|
10635
|
+
});
|
|
10636
|
+
var CaseClause$2 = $T($S(Case, CaseExpressionList, $C(NestedBlockStatements, EmptyBareBlock)), function(value) {
|
|
11044
10637
|
return { "type": "CaseClause", "children": value };
|
|
11045
10638
|
});
|
|
11046
|
-
var CaseClause$
|
|
10639
|
+
var CaseClause$3 = $TS($S(When, CaseExpressionList, InsertOpenBrace, $C(ThenClause, NestedBlockStatements, EmptyBareBlock), InsertBreak, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
|
|
11047
10640
|
var cases = $2;
|
|
11048
10641
|
var block = $4;
|
|
11049
10642
|
var b = $5;
|
|
@@ -11055,7 +10648,7 @@ ${input.slice(result.pos)}
|
|
|
11055
10648
|
children: $0
|
|
11056
10649
|
};
|
|
11057
10650
|
});
|
|
11058
|
-
var CaseClause$
|
|
10651
|
+
var CaseClause$4 = $TS($S(Default, ImpliedColon, $C(NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2, $3) {
|
|
11059
10652
|
var block = $3;
|
|
11060
10653
|
return {
|
|
11061
10654
|
type: "DefaultClause",
|
|
@@ -11063,7 +10656,7 @@ ${input.slice(result.pos)}
|
|
|
11063
10656
|
children: $0
|
|
11064
10657
|
};
|
|
11065
10658
|
});
|
|
11066
|
-
var CaseClause$
|
|
10659
|
+
var CaseClause$5 = $TS($S(Else, ImpliedColon, $C(ThenClause, BracedBlock, EmptyBlock)), function($skip, $loc, $0, $1, $2, $3) {
|
|
11067
10660
|
var block = $3;
|
|
11068
10661
|
$1.token = "default";
|
|
11069
10662
|
return {
|
|
@@ -11083,12 +10676,12 @@ ${input.slice(result.pos)}
|
|
|
11083
10676
|
}
|
|
11084
10677
|
}
|
|
11085
10678
|
if (state.tokenize) {
|
|
11086
|
-
const result = $TOKEN("CaseClause", state, CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state));
|
|
10679
|
+
const result = $TOKEN("CaseClause", state, CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state) || CaseClause$5(state));
|
|
11087
10680
|
if (state.events)
|
|
11088
10681
|
state.events.exit?.("CaseClause", state, result, eventData);
|
|
11089
10682
|
return result;
|
|
11090
10683
|
} else {
|
|
11091
|
-
const result = CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state);
|
|
10684
|
+
const result = CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state) || CaseClause$5(state);
|
|
11092
10685
|
if (state.events)
|
|
11093
10686
|
state.events.exit?.("CaseClause", state, result, eventData);
|
|
11094
10687
|
return result;
|
|
@@ -11442,8 +11035,8 @@ ${input.slice(result.pos)}
|
|
|
11442
11035
|
return result;
|
|
11443
11036
|
}
|
|
11444
11037
|
}
|
|
11445
|
-
var ExpressionWithIndentedApplicationForbidden$0 = $TS($S(ForbidIndentedApplication, $E(ExtendedExpression), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3) {
|
|
11446
|
-
var exp = $
|
|
11038
|
+
var ExpressionWithIndentedApplicationForbidden$0 = $TS($S(ForbidIndentedApplication, ForbidNewlineBinaryOp, $E(ExtendedExpression), RestoreNewlineBinaryOp, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
11039
|
+
var exp = $3;
|
|
11447
11040
|
if (exp)
|
|
11448
11041
|
return exp;
|
|
11449
11042
|
return $skip;
|
|
@@ -11885,7 +11478,111 @@ ${input.slice(result.pos)}
|
|
|
11885
11478
|
return result;
|
|
11886
11479
|
}
|
|
11887
11480
|
}
|
|
11888
|
-
var
|
|
11481
|
+
var AllowNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'AllowNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
|
|
11482
|
+
module.forbidNewlineBinaryOp.push(false);
|
|
11483
|
+
});
|
|
11484
|
+
function AllowNewlineBinaryOp(state) {
|
|
11485
|
+
let eventData;
|
|
11486
|
+
if (state.events) {
|
|
11487
|
+
const result = state.events.enter?.("AllowNewlineBinaryOp", state);
|
|
11488
|
+
if (result) {
|
|
11489
|
+
if (result.cache)
|
|
11490
|
+
return result.cache;
|
|
11491
|
+
eventData = result.data;
|
|
11492
|
+
}
|
|
11493
|
+
}
|
|
11494
|
+
if (state.tokenize) {
|
|
11495
|
+
const result = $TOKEN("AllowNewlineBinaryOp", state, AllowNewlineBinaryOp$0(state));
|
|
11496
|
+
if (state.events)
|
|
11497
|
+
state.events.exit?.("AllowNewlineBinaryOp", state, result, eventData);
|
|
11498
|
+
return result;
|
|
11499
|
+
} else {
|
|
11500
|
+
const result = AllowNewlineBinaryOp$0(state);
|
|
11501
|
+
if (state.events)
|
|
11502
|
+
state.events.exit?.("AllowNewlineBinaryOp", state, result, eventData);
|
|
11503
|
+
return result;
|
|
11504
|
+
}
|
|
11505
|
+
}
|
|
11506
|
+
var ForbidNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'ForbidNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
|
|
11507
|
+
module.forbidNewlineBinaryOp.push(true);
|
|
11508
|
+
});
|
|
11509
|
+
function ForbidNewlineBinaryOp(state) {
|
|
11510
|
+
let eventData;
|
|
11511
|
+
if (state.events) {
|
|
11512
|
+
const result = state.events.enter?.("ForbidNewlineBinaryOp", state);
|
|
11513
|
+
if (result) {
|
|
11514
|
+
if (result.cache)
|
|
11515
|
+
return result.cache;
|
|
11516
|
+
eventData = result.data;
|
|
11517
|
+
}
|
|
11518
|
+
}
|
|
11519
|
+
if (state.tokenize) {
|
|
11520
|
+
const result = $TOKEN("ForbidNewlineBinaryOp", state, ForbidNewlineBinaryOp$0(state));
|
|
11521
|
+
if (state.events)
|
|
11522
|
+
state.events.exit?.("ForbidNewlineBinaryOp", state, result, eventData);
|
|
11523
|
+
return result;
|
|
11524
|
+
} else {
|
|
11525
|
+
const result = ForbidNewlineBinaryOp$0(state);
|
|
11526
|
+
if (state.events)
|
|
11527
|
+
state.events.exit?.("ForbidNewlineBinaryOp", state, result, eventData);
|
|
11528
|
+
return result;
|
|
11529
|
+
}
|
|
11530
|
+
}
|
|
11531
|
+
var RestoreNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'RestoreNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
|
|
11532
|
+
module.forbidNewlineBinaryOp.pop();
|
|
11533
|
+
});
|
|
11534
|
+
function RestoreNewlineBinaryOp(state) {
|
|
11535
|
+
let eventData;
|
|
11536
|
+
if (state.events) {
|
|
11537
|
+
const result = state.events.enter?.("RestoreNewlineBinaryOp", state);
|
|
11538
|
+
if (result) {
|
|
11539
|
+
if (result.cache)
|
|
11540
|
+
return result.cache;
|
|
11541
|
+
eventData = result.data;
|
|
11542
|
+
}
|
|
11543
|
+
}
|
|
11544
|
+
if (state.tokenize) {
|
|
11545
|
+
const result = $TOKEN("RestoreNewlineBinaryOp", state, RestoreNewlineBinaryOp$0(state));
|
|
11546
|
+
if (state.events)
|
|
11547
|
+
state.events.exit?.("RestoreNewlineBinaryOp", state, result, eventData);
|
|
11548
|
+
return result;
|
|
11549
|
+
} else {
|
|
11550
|
+
const result = RestoreNewlineBinaryOp$0(state);
|
|
11551
|
+
if (state.events)
|
|
11552
|
+
state.events.exit?.("RestoreNewlineBinaryOp", state, result, eventData);
|
|
11553
|
+
return result;
|
|
11554
|
+
}
|
|
11555
|
+
}
|
|
11556
|
+
var NewlineBinaryOpAllowed$0 = $TV($EXPECT($L0, fail, 'NewlineBinaryOpAllowed ""'), function($skip, $loc, $0, $1) {
|
|
11557
|
+
if (module.config.verbose) {
|
|
11558
|
+
console.log("forbidNewlineBinaryOp:", module.forbidNewlineBinaryOp);
|
|
11559
|
+
}
|
|
11560
|
+
if (module.newlineBinaryOpForbidden)
|
|
11561
|
+
return $skip;
|
|
11562
|
+
});
|
|
11563
|
+
function NewlineBinaryOpAllowed(state) {
|
|
11564
|
+
let eventData;
|
|
11565
|
+
if (state.events) {
|
|
11566
|
+
const result = state.events.enter?.("NewlineBinaryOpAllowed", state);
|
|
11567
|
+
if (result) {
|
|
11568
|
+
if (result.cache)
|
|
11569
|
+
return result.cache;
|
|
11570
|
+
eventData = result.data;
|
|
11571
|
+
}
|
|
11572
|
+
}
|
|
11573
|
+
if (state.tokenize) {
|
|
11574
|
+
const result = $TOKEN("NewlineBinaryOpAllowed", state, NewlineBinaryOpAllowed$0(state));
|
|
11575
|
+
if (state.events)
|
|
11576
|
+
state.events.exit?.("NewlineBinaryOpAllowed", state, result, eventData);
|
|
11577
|
+
return result;
|
|
11578
|
+
} else {
|
|
11579
|
+
const result = NewlineBinaryOpAllowed$0(state);
|
|
11580
|
+
if (state.events)
|
|
11581
|
+
state.events.exit?.("NewlineBinaryOpAllowed", state, result, eventData);
|
|
11582
|
+
return result;
|
|
11583
|
+
}
|
|
11584
|
+
}
|
|
11585
|
+
var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowIndentedApplication, AllowMultiLineImplicitObjectLiteral, AllowClassImplicitCall, AllowNewlineBinaryOp);
|
|
11889
11586
|
function AllowAll(state) {
|
|
11890
11587
|
let eventData;
|
|
11891
11588
|
if (state.events) {
|
|
@@ -11908,7 +11605,7 @@ ${input.slice(result.pos)}
|
|
|
11908
11605
|
return result;
|
|
11909
11606
|
}
|
|
11910
11607
|
}
|
|
11911
|
-
var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreIndentedApplication, RestoreMultiLineImplicitObjectLiteral, RestoreClassImplicitCall);
|
|
11608
|
+
var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreIndentedApplication, RestoreMultiLineImplicitObjectLiteral, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
|
|
11912
11609
|
function RestoreAll(state) {
|
|
11913
11610
|
let eventData;
|
|
11914
11611
|
if (state.events) {
|
|
@@ -18576,9 +18273,9 @@ ${input.slice(result.pos)}
|
|
|
18576
18273
|
}
|
|
18577
18274
|
}
|
|
18578
18275
|
var NestedInterfaceProperties$0 = $TS($S(PushIndent, $Q(NestedInterfaceProperty), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
18579
|
-
var
|
|
18580
|
-
if (
|
|
18581
|
-
return
|
|
18276
|
+
var props = $2;
|
|
18277
|
+
if (props.length)
|
|
18278
|
+
return props;
|
|
18582
18279
|
return $skip;
|
|
18583
18280
|
});
|
|
18584
18281
|
function NestedInterfaceProperties(state) {
|
|
@@ -18959,23 +18656,23 @@ ${input.slice(result.pos)}
|
|
|
18959
18656
|
}
|
|
18960
18657
|
}
|
|
18961
18658
|
var EnumBlock$0 = $TS($S(__, OpenBrace, NestedEnumProperties, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
18962
|
-
var
|
|
18659
|
+
var props = $3;
|
|
18963
18660
|
return {
|
|
18964
|
-
properties:
|
|
18661
|
+
properties: props.properties,
|
|
18965
18662
|
children: $0
|
|
18966
18663
|
};
|
|
18967
18664
|
});
|
|
18968
18665
|
var EnumBlock$1 = $TS($S(__, OpenBrace, $Q($S(__, EnumProperty)), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
18969
|
-
var
|
|
18666
|
+
var props = $3;
|
|
18970
18667
|
return {
|
|
18971
|
-
properties:
|
|
18668
|
+
properties: props.map((p) => p[1]),
|
|
18972
18669
|
children: $0
|
|
18973
18670
|
};
|
|
18974
18671
|
});
|
|
18975
18672
|
var EnumBlock$2 = $TS($S(InsertOpenBrace, NestedEnumProperties, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
|
|
18976
|
-
var
|
|
18673
|
+
var props = $2;
|
|
18977
18674
|
return {
|
|
18978
|
-
properties:
|
|
18675
|
+
properties: props.properties,
|
|
18979
18676
|
children: $0
|
|
18980
18677
|
};
|
|
18981
18678
|
});
|
|
@@ -19002,11 +18699,11 @@ ${input.slice(result.pos)}
|
|
|
19002
18699
|
}
|
|
19003
18700
|
}
|
|
19004
18701
|
var NestedEnumProperties$0 = $TS($S(PushIndent, $Q(NestedEnumProperty), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
|
|
19005
|
-
var
|
|
19006
|
-
if (!
|
|
18702
|
+
var props = $2;
|
|
18703
|
+
if (!props.length)
|
|
19007
18704
|
return $skip;
|
|
19008
18705
|
return {
|
|
19009
|
-
properties:
|
|
18706
|
+
properties: props.map((p) => p.property),
|
|
19010
18707
|
children: $0
|
|
19011
18708
|
};
|
|
19012
18709
|
});
|
|
@@ -21178,6 +20875,7 @@ ${input.slice(result.pos)}
|
|
|
21178
20875
|
module.forbidIndentedApplication = [false];
|
|
21179
20876
|
module.forbidTrailingMemberProperty = [false];
|
|
21180
20877
|
module.forbidMultiLineImplicitObjectLiteral = [false];
|
|
20878
|
+
module.forbidNewlineBinaryOp = [false];
|
|
21181
20879
|
module.JSXTagStack = [];
|
|
21182
20880
|
module.operators = /* @__PURE__ */ new Set();
|
|
21183
20881
|
if (!module._init) {
|
|
@@ -21213,6 +20911,12 @@ ${input.slice(result.pos)}
|
|
|
21213
20911
|
return s[s.length - 1];
|
|
21214
20912
|
}
|
|
21215
20913
|
},
|
|
20914
|
+
newlineBinaryOpForbidden: {
|
|
20915
|
+
get() {
|
|
20916
|
+
const { forbidNewlineBinaryOp: s } = module;
|
|
20917
|
+
return s[s.length - 1];
|
|
20918
|
+
}
|
|
20919
|
+
},
|
|
21216
20920
|
currentJSXTag: {
|
|
21217
20921
|
get() {
|
|
21218
20922
|
const { JSXTagStack: s } = module;
|
|
@@ -21487,7 +21191,7 @@ ${input.slice(result.pos)}
|
|
|
21487
21191
|
if (glob?.type === "PropertyGlob") {
|
|
21488
21192
|
const prefix = children.slice(0, i).concat(glob.dot);
|
|
21489
21193
|
const parts = [];
|
|
21490
|
-
for (const part of glob.object.
|
|
21194
|
+
for (const part of glob.object.properties) {
|
|
21491
21195
|
if (part.type === "MethodDefinition") {
|
|
21492
21196
|
throw new Error("Glob pattern cannot have method definition");
|
|
21493
21197
|
}
|
|
@@ -21528,12 +21232,12 @@ ${input.slice(result.pos)}
|
|
|
21528
21232
|
}
|
|
21529
21233
|
const object = {
|
|
21530
21234
|
type: "ObjectExpression",
|
|
21531
|
-
content: parts,
|
|
21532
21235
|
children: [
|
|
21533
21236
|
glob.object.children[0],
|
|
21534
21237
|
...parts,
|
|
21535
21238
|
glob.object.children.at(-1)
|
|
21536
|
-
]
|
|
21239
|
+
],
|
|
21240
|
+
properties: parts
|
|
21537
21241
|
};
|
|
21538
21242
|
if (i === children.length - 1)
|
|
21539
21243
|
return object;
|
|
@@ -22143,11 +21847,11 @@ ${input.slice(result.pos)}
|
|
|
22143
21847
|
length
|
|
22144
21848
|
};
|
|
22145
21849
|
};
|
|
22146
|
-
module.reorderBindingRestProperty = function(
|
|
22147
|
-
const names =
|
|
21850
|
+
module.reorderBindingRestProperty = function(props) {
|
|
21851
|
+
const names = props.flatMap((p) => p.names);
|
|
22148
21852
|
let restIndex = -1;
|
|
22149
21853
|
let restCount = 0;
|
|
22150
|
-
|
|
21854
|
+
props.forEach(({ type }, i) => {
|
|
22151
21855
|
if (type === "BindingRestProperty") {
|
|
22152
21856
|
if (restIndex < 0)
|
|
22153
21857
|
restIndex = i;
|
|
@@ -22156,19 +21860,19 @@ ${input.slice(result.pos)}
|
|
|
22156
21860
|
});
|
|
22157
21861
|
if (restCount === 0) {
|
|
22158
21862
|
return {
|
|
22159
|
-
children:
|
|
21863
|
+
children: props,
|
|
22160
21864
|
names
|
|
22161
21865
|
};
|
|
22162
21866
|
} else if (restCount === 1) {
|
|
22163
|
-
let after =
|
|
22164
|
-
let rest =
|
|
22165
|
-
|
|
21867
|
+
let after = props.slice(restIndex + 1);
|
|
21868
|
+
let rest = props[restIndex];
|
|
21869
|
+
props = props.slice(0, restIndex);
|
|
22166
21870
|
if (after.length) {
|
|
22167
21871
|
const [restDelim] = rest.children.slice(-1), lastAfterProp = after[after.length - 1], lastAfterChildren = lastAfterProp.children, [lastDelim] = lastAfterChildren.slice(-1);
|
|
22168
21872
|
rest = { ...rest, children: [...rest.children.slice(0, -1), lastDelim] };
|
|
22169
21873
|
after = [...after.slice(0, -1), { ...lastAfterProp, children: [...lastAfterChildren.slice(0, -1), restDelim] }];
|
|
22170
21874
|
}
|
|
22171
|
-
const children = [...
|
|
21875
|
+
const children = [...props, ...after, rest];
|
|
22172
21876
|
return {
|
|
22173
21877
|
children,
|
|
22174
21878
|
names
|
|
@@ -22178,7 +21882,7 @@ ${input.slice(result.pos)}
|
|
|
22178
21882
|
children: [{
|
|
22179
21883
|
type: "Error",
|
|
22180
21884
|
message: "Multiple rest properties in object pattern"
|
|
22181
|
-
},
|
|
21885
|
+
}, props]
|
|
22182
21886
|
};
|
|
22183
21887
|
};
|
|
22184
21888
|
function addParentPointers(node, parent) {
|
|
@@ -22252,7 +21956,7 @@ ${input.slice(result.pos)}
|
|
|
22252
21956
|
gatherRecursiveAll(statements, (n) => n.type === "AtBindingProperty").forEach((binding) => {
|
|
22253
21957
|
const { ref } = binding;
|
|
22254
21958
|
if (asThis) {
|
|
22255
|
-
const atBinding = binding.
|
|
21959
|
+
const atBinding = binding.binding;
|
|
22256
21960
|
atBinding.children.pop();
|
|
22257
21961
|
atBinding.type = void 0;
|
|
22258
21962
|
binding.children.unshift(ref.id, ": this.", ref.base);
|
|
@@ -22499,8 +22203,10 @@ ${input.slice(result.pos)}
|
|
|
22499
22203
|
}
|
|
22500
22204
|
};
|
|
22501
22205
|
function getPatternConditions(pattern, ref, conditions) {
|
|
22206
|
+
if (pattern.rest)
|
|
22207
|
+
return;
|
|
22502
22208
|
switch (pattern.type) {
|
|
22503
|
-
case "
|
|
22209
|
+
case "ArrayBindingPattern": {
|
|
22504
22210
|
const { elements, length } = pattern, hasRest = elements.some((e) => e.rest), comparator = hasRest ? " >= " : " === ", l = [comparator, (length - hasRest).toString()];
|
|
22505
22211
|
conditions.push(
|
|
22506
22212
|
["Array.isArray(", ref, ")"],
|
|
@@ -22508,46 +22214,28 @@ ${input.slice(result.pos)}
|
|
|
22508
22214
|
);
|
|
22509
22215
|
elements.forEach(({ children: [, e] }, i) => {
|
|
22510
22216
|
const subRef = [ref, "[", i.toString(), "]"];
|
|
22511
|
-
|
|
22512
|
-
case "ArrayMatchingPattern":
|
|
22513
|
-
case "ObjectMatchingPattern":
|
|
22514
|
-
case "RegularExpressionLiteral":
|
|
22515
|
-
getPatternConditions(e, subRef, conditions);
|
|
22516
|
-
break;
|
|
22517
|
-
case "BindingMatchElement":
|
|
22518
|
-
getPatternConditions(e.match, subRef, conditions);
|
|
22519
|
-
break;
|
|
22520
|
-
}
|
|
22217
|
+
getPatternConditions(e, subRef, conditions);
|
|
22521
22218
|
});
|
|
22522
22219
|
const postRest = pattern.children.find((c) => c?.blockPrefix);
|
|
22523
22220
|
if (postRest) {
|
|
22524
22221
|
const postElements = postRest.blockPrefix.children[1], { length: postLength } = postElements;
|
|
22525
22222
|
postElements.forEach(({ children: [, e] }, i) => {
|
|
22526
22223
|
const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
|
|
22527
|
-
|
|
22528
|
-
case "ArrayMatchingPattern":
|
|
22529
|
-
case "ObjectMatchingPattern":
|
|
22530
|
-
case "RegularExpressionLiteral":
|
|
22531
|
-
case "Literal":
|
|
22532
|
-
getPatternConditions(e, subRef, conditions);
|
|
22533
|
-
break;
|
|
22534
|
-
case "BindingMatchElement":
|
|
22535
|
-
getPatternConditions(e.match, subRef, conditions);
|
|
22536
|
-
break;
|
|
22537
|
-
}
|
|
22224
|
+
getPatternConditions(e, subRef, conditions);
|
|
22538
22225
|
});
|
|
22539
22226
|
}
|
|
22540
22227
|
break;
|
|
22541
22228
|
}
|
|
22542
|
-
case "
|
|
22229
|
+
case "ObjectBindingPattern": {
|
|
22543
22230
|
conditions.push(
|
|
22544
22231
|
["typeof ", ref, " === 'object'"],
|
|
22545
22232
|
[ref, " != null"]
|
|
22546
22233
|
);
|
|
22547
22234
|
pattern.properties.forEach((p) => {
|
|
22548
22235
|
switch (p.type) {
|
|
22549
|
-
case "
|
|
22550
|
-
|
|
22236
|
+
case "PinProperty":
|
|
22237
|
+
case "BindingProperty": {
|
|
22238
|
+
const { name, value } = p;
|
|
22551
22239
|
let subRef;
|
|
22552
22240
|
switch (name.type) {
|
|
22553
22241
|
case "ComputedPropertyName":
|
|
@@ -22564,16 +22252,20 @@ ${input.slice(result.pos)}
|
|
|
22564
22252
|
conditions.push(["'", name, "' in ", ref]);
|
|
22565
22253
|
subRef = [ref, ".", name];
|
|
22566
22254
|
}
|
|
22567
|
-
|
|
22255
|
+
if (value) {
|
|
22256
|
+
getPatternConditions(value, subRef, conditions);
|
|
22257
|
+
}
|
|
22568
22258
|
break;
|
|
22569
22259
|
}
|
|
22570
|
-
case "BindingProperty":
|
|
22571
|
-
conditions.push(["'", p.identifier, "' in ", ref]);
|
|
22572
|
-
break;
|
|
22573
22260
|
}
|
|
22574
22261
|
});
|
|
22575
22262
|
break;
|
|
22576
22263
|
}
|
|
22264
|
+
case "ConditionFragment":
|
|
22265
|
+
conditions.push(
|
|
22266
|
+
[ref, " ", pattern.children]
|
|
22267
|
+
);
|
|
22268
|
+
break;
|
|
22577
22269
|
case "RegularExpressionLiteral": {
|
|
22578
22270
|
conditions.push(
|
|
22579
22271
|
["typeof ", ref, " === 'string'"],
|
|
@@ -22581,13 +22273,22 @@ ${input.slice(result.pos)}
|
|
|
22581
22273
|
);
|
|
22582
22274
|
break;
|
|
22583
22275
|
}
|
|
22584
|
-
|
|
22276
|
+
case "PinPattern":
|
|
22277
|
+
conditions.push([
|
|
22278
|
+
ref,
|
|
22279
|
+
" === ",
|
|
22280
|
+
pattern.identifier
|
|
22281
|
+
]);
|
|
22282
|
+
break;
|
|
22283
|
+
case "Literal":
|
|
22585
22284
|
conditions.push([
|
|
22586
22285
|
ref,
|
|
22587
22286
|
" === ",
|
|
22588
22287
|
pattern
|
|
22589
22288
|
]);
|
|
22590
|
-
|
|
22289
|
+
break;
|
|
22290
|
+
default:
|
|
22291
|
+
break;
|
|
22591
22292
|
}
|
|
22592
22293
|
}
|
|
22593
22294
|
function elideMatchersFromArrayBindings(elements) {
|
|
@@ -22596,6 +22297,7 @@ ${input.slice(result.pos)}
|
|
|
22596
22297
|
case "Literal":
|
|
22597
22298
|
case "RegularExpressionLiteral":
|
|
22598
22299
|
case "StringLiteral":
|
|
22300
|
+
case "PinPattern":
|
|
22599
22301
|
return sep;
|
|
22600
22302
|
default:
|
|
22601
22303
|
return [ws, nonMatcherBindings(e), sep];
|
|
@@ -22605,27 +22307,19 @@ ${input.slice(result.pos)}
|
|
|
22605
22307
|
function elideMatchersFromPropertyBindings(properties) {
|
|
22606
22308
|
return properties.map((p) => {
|
|
22607
22309
|
switch (p.type) {
|
|
22608
|
-
case "
|
|
22609
|
-
const { children, name,
|
|
22610
|
-
const [ws
|
|
22611
|
-
|
|
22612
|
-
|
|
22613
|
-
case "
|
|
22310
|
+
case "BindingProperty": {
|
|
22311
|
+
const { children, name, value } = p;
|
|
22312
|
+
const [ws] = children;
|
|
22313
|
+
const sep = children[children.length - 1];
|
|
22314
|
+
switch (value && value.type) {
|
|
22315
|
+
case "ArrayBindingPattern":
|
|
22316
|
+
case "ObjectBindingPattern":
|
|
22614
22317
|
return {
|
|
22615
22318
|
...p,
|
|
22616
|
-
children: [ws, name, ": ", nonMatcherBindings(
|
|
22319
|
+
children: [ws, name, ": ", nonMatcherBindings(value)]
|
|
22617
22320
|
};
|
|
22618
22321
|
case "Identifier":
|
|
22619
|
-
|
|
22620
|
-
case "ComputedPropertyName":
|
|
22621
|
-
case "Literal":
|
|
22622
|
-
case "StringLiteral":
|
|
22623
|
-
case "NumericLiteral":
|
|
22624
|
-
return {
|
|
22625
|
-
...p,
|
|
22626
|
-
children: [ws, name, ": ", match, sep]
|
|
22627
|
-
};
|
|
22628
|
-
}
|
|
22322
|
+
return p;
|
|
22629
22323
|
case "Literal":
|
|
22630
22324
|
case "RegularExpressionLiteral":
|
|
22631
22325
|
case "StringLiteral":
|
|
@@ -22636,7 +22330,7 @@ ${input.slice(result.pos)}
|
|
|
22636
22330
|
};
|
|
22637
22331
|
}
|
|
22638
22332
|
}
|
|
22639
|
-
case "
|
|
22333
|
+
case "PinProperty":
|
|
22640
22334
|
case "BindingRestProperty":
|
|
22641
22335
|
default:
|
|
22642
22336
|
return p;
|
|
@@ -22645,7 +22339,7 @@ ${input.slice(result.pos)}
|
|
|
22645
22339
|
}
|
|
22646
22340
|
function nonMatcherBindings(pattern) {
|
|
22647
22341
|
switch (pattern.type) {
|
|
22648
|
-
case "
|
|
22342
|
+
case "ArrayBindingPattern":
|
|
22649
22343
|
return ["[", elideMatchersFromArrayBindings(pattern.elements), "]"];
|
|
22650
22344
|
case "PostRestBindingElements": {
|
|
22651
22345
|
const els = elideMatchersFromArrayBindings(pattern.children[1]);
|
|
@@ -22658,19 +22352,19 @@ ${input.slice(result.pos)}
|
|
|
22658
22352
|
]
|
|
22659
22353
|
};
|
|
22660
22354
|
}
|
|
22661
|
-
case "
|
|
22355
|
+
case "ObjectBindingPattern":
|
|
22662
22356
|
return ["{", elideMatchersFromPropertyBindings(pattern.properties), "}"];
|
|
22663
22357
|
default:
|
|
22664
22358
|
return pattern;
|
|
22665
22359
|
}
|
|
22666
22360
|
}
|
|
22667
22361
|
function aggregateDuplicateBindings(bindings) {
|
|
22668
|
-
const
|
|
22362
|
+
const props = gatherRecursiveAll(bindings, (n) => n.type === "BindingProperty");
|
|
22669
22363
|
const declarations = [];
|
|
22670
22364
|
const propsGroupedByName = /* @__PURE__ */ new Map();
|
|
22671
|
-
for (const p of
|
|
22672
|
-
const { name } = p;
|
|
22673
|
-
const key = name.name;
|
|
22365
|
+
for (const p of props) {
|
|
22366
|
+
const { name, value } = p;
|
|
22367
|
+
const key = value?.name || name.name;
|
|
22674
22368
|
if (propsGroupedByName.has(key)) {
|
|
22675
22369
|
propsGroupedByName.get(key).push(p);
|
|
22676
22370
|
} else {
|
|
@@ -22758,10 +22452,10 @@ ${input.slice(result.pos)}
|
|
|
22758
22452
|
};
|
|
22759
22453
|
const prefix = [];
|
|
22760
22454
|
switch (pattern.type) {
|
|
22761
|
-
case "
|
|
22455
|
+
case "ArrayBindingPattern":
|
|
22762
22456
|
if (pattern.length === 0)
|
|
22763
22457
|
break;
|
|
22764
|
-
case "
|
|
22458
|
+
case "ObjectBindingPattern": {
|
|
22765
22459
|
if (pattern.properties?.length === 0)
|
|
22766
22460
|
break;
|
|
22767
22461
|
let [splices, thisAssignments] = gatherBindingCode(pattern);
|
|
@@ -23939,7 +23633,7 @@ ${input.slice(result.pos)}
|
|
|
23939
23633
|
var uncacheable;
|
|
23940
23634
|
({ parse } = import_parser.default);
|
|
23941
23635
|
({ SourceMap: SourceMap2 } = util_exports);
|
|
23942
|
-
uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedFurther", "IndentedJSXChildExpression", "InlineObjectLiteral", "InsertIndent", "JSXChild", "JSXChildren", "JSXElement", "JSXFragment", "JSXImplicitFragment", "JSXMixedChildren", "JSXNested", "JSXNestedChildren", "JSXOptionalClosingElement", "JSXOptionalClosingFragment", "JSXTag", "LeftHandSideExpression", "MemberExpression", "MemberExpressionRest", "Nested", "NestedBindingElement", "NestedBindingElements", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatement", "NestedBlockStatements", "NestedClassSignatureElement", "NestedClassSignatureElements", "NestedDeclareElement", "NestedDeclareElements", "NestedElement", "NestedElementList", "NestedImplicitObjectLiteral", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedInterfaceProperty", "NestedJSXChildExpression", "NestedModuleItem", "NestedModuleItems", "NestedNonAssignmentExtendedExpression", "NestedObject", "NestedPropertyDefinitions", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RHS", "Samedent", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
|
|
23636
|
+
uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowNewlineBinaryOp", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidNewlineBinaryOp", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedFurther", "IndentedJSXChildExpression", "InlineObjectLiteral", "InsertIndent", "JSXChild", "JSXChildren", "JSXElement", "JSXFragment", "JSXImplicitFragment", "JSXMixedChildren", "JSXNested", "JSXNestedChildren", "JSXOptionalClosingElement", "JSXOptionalClosingFragment", "JSXTag", "LeftHandSideExpression", "MemberExpression", "MemberExpressionRest", "Nested", "NestedBindingElement", "NestedBindingElements", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatement", "NestedBlockStatements", "NestedClassSignatureElement", "NestedClassSignatureElements", "NestedDeclareElement", "NestedDeclareElements", "NestedElement", "NestedElementList", "NestedImplicitObjectLiteral", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedInterfaceProperty", "NestedJSXChildExpression", "NestedModuleItem", "NestedModuleItems", "NestedNonAssignmentExtendedExpression", "NestedObject", "NestedPropertyDefinitions", "NewlineBinaryOpAllowed", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RestoreNewlineBinaryOp", "RHS", "Samedent", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineBinaryOpRHS", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
|
|
23943
23637
|
var compile = function(src, options) {
|
|
23944
23638
|
var ast, code, events, filename, ref, result, sm;
|
|
23945
23639
|
if (!options) {
|