@danielx/civet 0.5.43 → 0.5.44

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 CHANGED
@@ -530,6 +530,20 @@ ${input.slice(result.pos)}
530
530
  BindingElement,
531
531
  BindingRestElement,
532
532
  EmptyBindingPattern,
533
+ MatchingPattern,
534
+ ObjectMatchingPattern,
535
+ ObjectMatchingPatternContent,
536
+ NestedMatchingProperties,
537
+ NestedMatchingProperty,
538
+ MatchingProperty,
539
+ NestedMatchingRestProperty,
540
+ MatchingRestProperty,
541
+ ArrayMatchingPattern,
542
+ ArrayMatchingPatternContent,
543
+ NestedMatchingElements,
544
+ NestedMatchingElement,
545
+ MatchingElement,
546
+ MatchingRestElement,
533
547
  FunctionDeclaration,
534
548
  FunctionSignature,
535
549
  FunctionExpression,
@@ -4334,6 +4348,492 @@ ${input.slice(result.pos)}
4334
4348
  return result;
4335
4349
  }
4336
4350
  }
4351
+ var MatchingPattern$0 = ObjectMatchingPattern;
4352
+ var MatchingPattern$1 = ArrayMatchingPattern;
4353
+ var MatchingPattern$2 = Literal;
4354
+ var MatchingPattern$3 = RegularExpressionLiteral;
4355
+ function MatchingPattern(state) {
4356
+ let eventData;
4357
+ if (state.events) {
4358
+ const result = state.events.enter?.("MatchingPattern", state);
4359
+ if (result) {
4360
+ if (result.cache)
4361
+ return result.cache;
4362
+ eventData = result.data;
4363
+ }
4364
+ }
4365
+ if (state.tokenize) {
4366
+ const result = $TOKEN("MatchingPattern", state, MatchingPattern$0(state) || MatchingPattern$1(state) || MatchingPattern$2(state) || MatchingPattern$3(state));
4367
+ if (state.events)
4368
+ state.events.exit?.("MatchingPattern", state, result, eventData);
4369
+ return result;
4370
+ } else {
4371
+ const result = MatchingPattern$0(state) || MatchingPattern$1(state) || MatchingPattern$2(state) || MatchingPattern$3(state);
4372
+ if (state.events)
4373
+ state.events.exit?.("MatchingPattern", state, result, eventData);
4374
+ return result;
4375
+ }
4376
+ }
4377
+ var ObjectMatchingPattern$0 = $TS($S(OpenBrace, ObjectMatchingPatternContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
4378
+ var open = $1;
4379
+ var content = $2;
4380
+ var ws = $3;
4381
+ var close = $4;
4382
+ return {
4383
+ type: "ObjectMatchingPattern",
4384
+ children: [open, ...content.children, ...ws, close]
4385
+ };
4386
+ });
4387
+ function ObjectMatchingPattern(state) {
4388
+ let eventData;
4389
+ if (state.events) {
4390
+ const result = state.events.enter?.("ObjectMatchingPattern", state);
4391
+ if (result) {
4392
+ if (result.cache)
4393
+ return result.cache;
4394
+ eventData = result.data;
4395
+ }
4396
+ }
4397
+ if (state.tokenize) {
4398
+ const result = $TOKEN("ObjectMatchingPattern", state, ObjectMatchingPattern$0(state));
4399
+ if (state.events)
4400
+ state.events.exit?.("ObjectMatchingPattern", state, result, eventData);
4401
+ return result;
4402
+ } else {
4403
+ const result = ObjectMatchingPattern$0(state);
4404
+ if (state.events)
4405
+ state.events.exit?.("ObjectMatchingPattern", state, result, eventData);
4406
+ return result;
4407
+ }
4408
+ }
4409
+ var ObjectMatchingPatternContent$0 = NestedMatchingProperties;
4410
+ var ObjectMatchingPatternContent$1 = $TS($S($Q(MatchingProperty), $E(MatchingRestProperty), $Q(MatchingProperty)), function($skip, $loc, $0, $1, $2, $3) {
4411
+ var props = $1;
4412
+ var rest = $2;
4413
+ var after = $3;
4414
+ const names = props.flatMap((p) => p.names);
4415
+ const children = [...props];
4416
+ if (rest) {
4417
+ [rest, after] = module.reorderBindingRestProperty(rest, after);
4418
+ children.push(...after, rest);
4419
+ names.push(...after.flatMap((p) => p.names), ...rest.names);
4420
+ }
4421
+ return {
4422
+ names,
4423
+ children
4424
+ };
4425
+ });
4426
+ function ObjectMatchingPatternContent(state) {
4427
+ let eventData;
4428
+ if (state.events) {
4429
+ const result = state.events.enter?.("ObjectMatchingPatternContent", state);
4430
+ if (result) {
4431
+ if (result.cache)
4432
+ return result.cache;
4433
+ eventData = result.data;
4434
+ }
4435
+ }
4436
+ if (state.tokenize) {
4437
+ const result = $TOKEN("ObjectMatchingPatternContent", state, ObjectMatchingPatternContent$0(state) || ObjectMatchingPatternContent$1(state));
4438
+ if (state.events)
4439
+ state.events.exit?.("ObjectMatchingPatternContent", state, result, eventData);
4440
+ return result;
4441
+ } else {
4442
+ const result = ObjectMatchingPatternContent$0(state) || ObjectMatchingPatternContent$1(state);
4443
+ if (state.events)
4444
+ state.events.exit?.("ObjectMatchingPatternContent", state, result, eventData);
4445
+ return result;
4446
+ }
4447
+ }
4448
+ var NestedMatchingProperties$0 = $TS($S(PushIndent, $Q(NestedMatchingProperty), $E(NestedMatchingRestProperty), $Q(NestedMatchingProperty), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
4449
+ var props = $2;
4450
+ var rest = $3;
4451
+ var after = $4;
4452
+ if (!(props.length || rest))
4453
+ return $skip;
4454
+ const names = props.flatMap((p) => p.names);
4455
+ const children = [...props];
4456
+ if (rest) {
4457
+ [rest, after] = module.reorderBindingRestProperty(rest, after);
4458
+ children.push(...after, rest);
4459
+ names.push(...after.flatMap((p) => p.names), ...rest.names);
4460
+ }
4461
+ return {
4462
+ children,
4463
+ names
4464
+ };
4465
+ });
4466
+ function NestedMatchingProperties(state) {
4467
+ let eventData;
4468
+ if (state.events) {
4469
+ const result = state.events.enter?.("NestedMatchingProperties", state);
4470
+ if (result) {
4471
+ if (result.cache)
4472
+ return result.cache;
4473
+ eventData = result.data;
4474
+ }
4475
+ }
4476
+ if (state.tokenize) {
4477
+ const result = $TOKEN("NestedMatchingProperties", state, NestedMatchingProperties$0(state));
4478
+ if (state.events)
4479
+ state.events.exit?.("NestedMatchingProperties", state, result, eventData);
4480
+ return result;
4481
+ } else {
4482
+ const result = NestedMatchingProperties$0(state);
4483
+ if (state.events)
4484
+ state.events.exit?.("NestedMatchingProperties", state, result, eventData);
4485
+ return result;
4486
+ }
4487
+ }
4488
+ var NestedMatchingProperty$0 = $TS($S(Nested, MatchingProperty), function($skip, $loc, $0, $1, $2) {
4489
+ var indent = $1;
4490
+ var prop = $2;
4491
+ return {
4492
+ ...prop,
4493
+ children: [...indent, ...prop.children]
4494
+ };
4495
+ });
4496
+ function NestedMatchingProperty(state) {
4497
+ let eventData;
4498
+ if (state.events) {
4499
+ const result = state.events.enter?.("NestedMatchingProperty", state);
4500
+ if (result) {
4501
+ if (result.cache)
4502
+ return result.cache;
4503
+ eventData = result.data;
4504
+ }
4505
+ }
4506
+ if (state.tokenize) {
4507
+ const result = $TOKEN("NestedMatchingProperty", state, NestedMatchingProperty$0(state));
4508
+ if (state.events)
4509
+ state.events.exit?.("NestedMatchingProperty", state, result, eventData);
4510
+ return result;
4511
+ } else {
4512
+ const result = NestedMatchingProperty$0(state);
4513
+ if (state.events)
4514
+ state.events.exit?.("NestedMatchingProperty", state, result, eventData);
4515
+ return result;
4516
+ }
4517
+ }
4518
+ var MatchingProperty$0 = $TS($S(__, PropertyName, __, Colon, $C(BindingIdentifier, MatchingPattern), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
4519
+ var m = $5;
4520
+ return {
4521
+ names: m.names,
4522
+ children: $0
4523
+ };
4524
+ });
4525
+ var MatchingProperty$1 = $TS($S(BindingIdentifier, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2) {
4526
+ var b = $1;
4527
+ if (b.type === "AtBinding") {
4528
+ return {
4529
+ type: "AtBindingProperty",
4530
+ ref: b.ref,
4531
+ names: [],
4532
+ children: $0
4533
+ };
4534
+ }
4535
+ return {
4536
+ names: b.names,
4537
+ children: $0
4538
+ };
4539
+ });
4540
+ function MatchingProperty(state) {
4541
+ let eventData;
4542
+ if (state.events) {
4543
+ const result = state.events.enter?.("MatchingProperty", state);
4544
+ if (result) {
4545
+ if (result.cache)
4546
+ return result.cache;
4547
+ eventData = result.data;
4548
+ }
4549
+ }
4550
+ if (state.tokenize) {
4551
+ const result = $TOKEN("MatchingProperty", state, MatchingProperty$0(state) || MatchingProperty$1(state));
4552
+ if (state.events)
4553
+ state.events.exit?.("MatchingProperty", state, result, eventData);
4554
+ return result;
4555
+ } else {
4556
+ const result = MatchingProperty$0(state) || MatchingProperty$1(state);
4557
+ if (state.events)
4558
+ state.events.exit?.("MatchingProperty", state, result, eventData);
4559
+ return result;
4560
+ }
4561
+ }
4562
+ var NestedMatchingRestProperty$0 = $TS($S(Nested, MatchingRestProperty), function($skip, $loc, $0, $1, $2) {
4563
+ var indent = $1;
4564
+ var prop = $2;
4565
+ return {
4566
+ ...prop,
4567
+ children: [indent, ...prop.children]
4568
+ };
4569
+ });
4570
+ function NestedMatchingRestProperty(state) {
4571
+ let eventData;
4572
+ if (state.events) {
4573
+ const result = state.events.enter?.("NestedMatchingRestProperty", state);
4574
+ if (result) {
4575
+ if (result.cache)
4576
+ return result.cache;
4577
+ eventData = result.data;
4578
+ }
4579
+ }
4580
+ if (state.tokenize) {
4581
+ const result = $TOKEN("NestedMatchingRestProperty", state, NestedMatchingRestProperty$0(state));
4582
+ if (state.events)
4583
+ state.events.exit?.("NestedMatchingRestProperty", state, result, eventData);
4584
+ return result;
4585
+ } else {
4586
+ const result = NestedMatchingRestProperty$0(state);
4587
+ if (state.events)
4588
+ state.events.exit?.("NestedMatchingRestProperty", state, result, eventData);
4589
+ return result;
4590
+ }
4591
+ }
4592
+ var MatchingRestProperty$0 = BindingRestProperty;
4593
+ function MatchingRestProperty(state) {
4594
+ let eventData;
4595
+ if (state.events) {
4596
+ const result = state.events.enter?.("MatchingRestProperty", state);
4597
+ if (result) {
4598
+ if (result.cache)
4599
+ return result.cache;
4600
+ eventData = result.data;
4601
+ }
4602
+ }
4603
+ if (state.tokenize) {
4604
+ const result = $TOKEN("MatchingRestProperty", state, MatchingRestProperty$0(state));
4605
+ if (state.events)
4606
+ state.events.exit?.("MatchingRestProperty", state, result, eventData);
4607
+ return result;
4608
+ } else {
4609
+ const result = MatchingRestProperty$0(state);
4610
+ if (state.events)
4611
+ state.events.exit?.("MatchingRestProperty", state, result, eventData);
4612
+ return result;
4613
+ }
4614
+ }
4615
+ var ArrayMatchingPattern$0 = $TS($S(OpenBracket, ArrayMatchingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
4616
+ var open = $1;
4617
+ var content = $2;
4618
+ var ws = $3;
4619
+ var close = $4;
4620
+ return {
4621
+ type: "ArrayMatchingPattern",
4622
+ children: $0
4623
+ };
4624
+ });
4625
+ function ArrayMatchingPattern(state) {
4626
+ let eventData;
4627
+ if (state.events) {
4628
+ const result = state.events.enter?.("ArrayMatchingPattern", state);
4629
+ if (result) {
4630
+ if (result.cache)
4631
+ return result.cache;
4632
+ eventData = result.data;
4633
+ }
4634
+ }
4635
+ if (state.tokenize) {
4636
+ const result = $TOKEN("ArrayMatchingPattern", state, ArrayMatchingPattern$0(state));
4637
+ if (state.events)
4638
+ state.events.exit?.("ArrayMatchingPattern", state, result, eventData);
4639
+ return result;
4640
+ } else {
4641
+ const result = ArrayMatchingPattern$0(state);
4642
+ if (state.events)
4643
+ state.events.exit?.("ArrayMatchingPattern", state, result, eventData);
4644
+ return result;
4645
+ }
4646
+ }
4647
+ var ArrayMatchingPatternContent$0 = NestedMatchingElements;
4648
+ var ArrayMatchingPatternContent$1 = $TS($S($Q($C(MatchingElement, Elision)), $E($S(MatchingRestElement, ArrayElementDelimiter)), $Q($C(MatchingElement, Elision))), function($skip, $loc, $0, $1, $2, $3) {
4649
+ var props = $1;
4650
+ var rest = $2;
4651
+ var after = $3;
4652
+ const names = props.flatMap((p) => p.names || []);
4653
+ const children = [...props];
4654
+ let blockPrefix;
4655
+ if (rest) {
4656
+ const [restBinding] = rest;
4657
+ children.push(restBinding);
4658
+ let restIdentifier;
4659
+ if (restBinding.ref) {
4660
+ restIdentifier = restBinding.ref;
4661
+ } else {
4662
+ restIdentifier = restBinding.names[0];
4663
+ names.push(...restBinding.names);
4664
+ }
4665
+ if (after.length) {
4666
+ const spliceRef = module.getRef("splice");
4667
+ blockPrefix = {
4668
+ children: ["[", module.insertTrimmingSpace(after, ""), "] = ", spliceRef, ".call(", restIdentifier, ", -", after.length.toString(), ")"],
4669
+ names: after.flatMap((p) => p.names)
4670
+ };
4671
+ }
4672
+ }
4673
+ return {
4674
+ names,
4675
+ children,
4676
+ blockPrefix
4677
+ };
4678
+ });
4679
+ function ArrayMatchingPatternContent(state) {
4680
+ let eventData;
4681
+ if (state.events) {
4682
+ const result = state.events.enter?.("ArrayMatchingPatternContent", state);
4683
+ if (result) {
4684
+ if (result.cache)
4685
+ return result.cache;
4686
+ eventData = result.data;
4687
+ }
4688
+ }
4689
+ if (state.tokenize) {
4690
+ const result = $TOKEN("ArrayMatchingPatternContent", state, ArrayMatchingPatternContent$0(state) || ArrayMatchingPatternContent$1(state));
4691
+ if (state.events)
4692
+ state.events.exit?.("ArrayMatchingPatternContent", state, result, eventData);
4693
+ return result;
4694
+ } else {
4695
+ const result = ArrayMatchingPatternContent$0(state) || ArrayMatchingPatternContent$1(state);
4696
+ if (state.events)
4697
+ state.events.exit?.("ArrayMatchingPatternContent", state, result, eventData);
4698
+ return result;
4699
+ }
4700
+ }
4701
+ var NestedMatchingElements$0 = $TS($S(PushIndent, $Q(NestedMatchingElement), $E($S(Nested, MatchingRestElement, ArrayElementDelimiter)), $Q(NestedMatchingElement), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
4702
+ var props = $2;
4703
+ var rest = $3;
4704
+ var after = $4;
4705
+ if (!(props.length || rest))
4706
+ return $skip;
4707
+ const names = props.flatMap((p) => p.names), children = [...props];
4708
+ let blockPrefix;
4709
+ if (rest) {
4710
+ const [, restBinding] = rest;
4711
+ let restIdentifier;
4712
+ if (restBinding.ref) {
4713
+ restIdentifier = restBinding.binding.ref;
4714
+ } else {
4715
+ restIdentifier = restBinding.names[0];
4716
+ }
4717
+ if (after.length) {
4718
+ const spliceRef = module.getRef("splice");
4719
+ blockPrefix = {
4720
+ children: ["[", module.insertTrimmingSpace(after, ""), "] = ", spliceRef, ".call(", restIdentifier, ", -", after.length.toString(), ")"],
4721
+ names: after.flatMap((p) => p.names)
4722
+ };
4723
+ }
4724
+ children.push(...rest);
4725
+ names.push(...restBinding.names);
4726
+ }
4727
+ return {
4728
+ children,
4729
+ names,
4730
+ blockPrefix
4731
+ };
4732
+ });
4733
+ function NestedMatchingElements(state) {
4734
+ let eventData;
4735
+ if (state.events) {
4736
+ const result = state.events.enter?.("NestedMatchingElements", state);
4737
+ if (result) {
4738
+ if (result.cache)
4739
+ return result.cache;
4740
+ eventData = result.data;
4741
+ }
4742
+ }
4743
+ if (state.tokenize) {
4744
+ const result = $TOKEN("NestedMatchingElements", state, NestedMatchingElements$0(state));
4745
+ if (state.events)
4746
+ state.events.exit?.("NestedMatchingElements", state, result, eventData);
4747
+ return result;
4748
+ } else {
4749
+ const result = NestedMatchingElements$0(state);
4750
+ if (state.events)
4751
+ state.events.exit?.("NestedMatchingElements", state, result, eventData);
4752
+ return result;
4753
+ }
4754
+ }
4755
+ var NestedMatchingElement$0 = $TS($S(Nested, MatchingElement), function($skip, $loc, $0, $1, $2) {
4756
+ var indent = $1;
4757
+ var element = $2;
4758
+ return {
4759
+ ...element,
4760
+ children: [indent, ...element.children]
4761
+ };
4762
+ });
4763
+ function NestedMatchingElement(state) {
4764
+ let eventData;
4765
+ if (state.events) {
4766
+ const result = state.events.enter?.("NestedMatchingElement", state);
4767
+ if (result) {
4768
+ if (result.cache)
4769
+ return result.cache;
4770
+ eventData = result.data;
4771
+ }
4772
+ }
4773
+ if (state.tokenize) {
4774
+ const result = $TOKEN("NestedMatchingElement", state, NestedMatchingElement$0(state));
4775
+ if (state.events)
4776
+ state.events.exit?.("NestedMatchingElement", state, result, eventData);
4777
+ return result;
4778
+ } else {
4779
+ const result = NestedMatchingElement$0(state);
4780
+ if (state.events)
4781
+ state.events.exit?.("NestedMatchingElement", state, result, eventData);
4782
+ return result;
4783
+ }
4784
+ }
4785
+ var MatchingElement$0 = $TS($S($C(BindingIdentifier, MatchingPattern), ArrayElementDelimiter), function($skip, $loc, $0, $1, $2) {
4786
+ var binding = $1;
4787
+ return {
4788
+ names: binding.names,
4789
+ children: $0
4790
+ };
4791
+ });
4792
+ function MatchingElement(state) {
4793
+ let eventData;
4794
+ if (state.events) {
4795
+ const result = state.events.enter?.("MatchingElement", state);
4796
+ if (result) {
4797
+ if (result.cache)
4798
+ return result.cache;
4799
+ eventData = result.data;
4800
+ }
4801
+ }
4802
+ if (state.tokenize) {
4803
+ const result = $TOKEN("MatchingElement", state, MatchingElement$0(state));
4804
+ if (state.events)
4805
+ state.events.exit?.("MatchingElement", state, result, eventData);
4806
+ return result;
4807
+ } else {
4808
+ const result = MatchingElement$0(state);
4809
+ if (state.events)
4810
+ state.events.exit?.("MatchingElement", state, result, eventData);
4811
+ return result;
4812
+ }
4813
+ }
4814
+ var MatchingRestElement$0 = BindingRestElement;
4815
+ function MatchingRestElement(state) {
4816
+ let eventData;
4817
+ if (state.events) {
4818
+ const result = state.events.enter?.("MatchingRestElement", state);
4819
+ if (result) {
4820
+ if (result.cache)
4821
+ return result.cache;
4822
+ eventData = result.data;
4823
+ }
4824
+ }
4825
+ if (state.tokenize) {
4826
+ const result = $TOKEN("MatchingRestElement", state, MatchingRestElement$0(state));
4827
+ if (state.events)
4828
+ state.events.exit?.("MatchingRestElement", state, result, eventData);
4829
+ return result;
4830
+ } else {
4831
+ const result = MatchingRestElement$0(state);
4832
+ if (state.events)
4833
+ state.events.exit?.("MatchingRestElement", state, result, eventData);
4834
+ return result;
4835
+ }
4836
+ }
4337
4837
  var FunctionDeclaration$0 = FunctionExpression;
4338
4838
  function FunctionDeclaration(state) {
4339
4839
  let eventData;