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