@danielx/civet 0.6.19 → 0.6.20

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/main.mjs CHANGED
@@ -2062,10 +2062,11 @@ var require_lib = __commonJS({
2062
2062
  });
2063
2063
  }
2064
2064
  function processProgram(root, config, m, ReservedWord) {
2065
+ assert.equal(m.forbidBracedApplication.length, 1, "forbidBracedApplication");
2065
2066
  assert.equal(m.forbidClassImplicitCall.length, 1, "forbidClassImplicitCall");
2066
2067
  assert.equal(m.forbidIndentedApplication.length, 1, "forbidIndentedApplication");
2068
+ assert.equal(m.forbidNewlineBinaryOp.length, 1, "forbidNewlineBinaryOp");
2067
2069
  assert.equal(m.forbidTrailingMemberProperty.length, 1, "forbidTrailingMemberProperty");
2068
- assert.equal(m.forbidMultiLineImplicitObjectLiteral.length, 1, "forbidMultiLineImplicitObjectLiteral");
2069
2070
  assert.equal(m.JSXTagStack.length, 0, "JSXTagStack should be empty");
2070
2071
  addParentPointers(root);
2071
2072
  const { expressions: statements } = root;
@@ -3189,10 +3190,8 @@ ${input.slice(result.pos)}
3189
3190
  InlineObjectLiteral,
3190
3191
  ImplicitInlineObjectPropertyDelimiter,
3191
3192
  ObjectPropertyDelimiter,
3192
- PropertyDefinitionList,
3193
3193
  PropertyDefinition,
3194
3194
  NamedProperty,
3195
- ImplicitNamedProperty,
3196
3195
  SnugNamedProperty,
3197
3196
  PropertyName,
3198
3197
  ComputedPropertyName,
@@ -3298,10 +3297,6 @@ ${input.slice(result.pos)}
3298
3297
  AllowTrailingMemberProperty,
3299
3298
  RestoreTrailingMemberProperty,
3300
3299
  TrailingMemberPropertyAllowed,
3301
- ForbidMultiLineImplicitObjectLiteral,
3302
- AllowMultiLineImplicitObjectLiteral,
3303
- RestoreMultiLineImplicitObjectLiteral,
3304
- MultiLineImplicitObjectLiteralAllowed,
3305
3300
  AllowNewlineBinaryOp,
3306
3301
  ForbidNewlineBinaryOp,
3307
3302
  RestoreNewlineBinaryOp,
@@ -3535,6 +3530,7 @@ ${input.slice(result.pos)}
3535
3530
  NestedJSXChildExpression,
3536
3531
  TypeDeclaration,
3537
3532
  TypeDeclarationRest,
3533
+ OptionalEquals,
3538
3534
  TypeLexicalDeclaration,
3539
3535
  TypeDeclarationBinding,
3540
3536
  InterfaceExtendsClause,
@@ -3623,6 +3619,7 @@ ${input.slice(result.pos)}
3623
3619
  InsertOpenBracket,
3624
3620
  InsertCloseBracket,
3625
3621
  InsertComma,
3622
+ InsertSpaceEquals,
3626
3623
  InsertConst,
3627
3624
  InsertLet,
3628
3625
  InsertReadonly,
@@ -3650,13 +3647,13 @@ ${input.slice(result.pos)}
3650
3647
  Init,
3651
3648
  Indent,
3652
3649
  TrackIndented,
3653
- Samedent,
3654
- IndentedFurther,
3655
- NotDedented,
3656
- Dedented,
3657
3650
  PushIndent,
3658
3651
  PopIndent,
3659
- Nested
3652
+ Nested,
3653
+ IndentedFurther,
3654
+ IndentedAtLeast,
3655
+ NotDedented,
3656
+ Dedented
3660
3657
  });
3661
3658
  var $L0 = $L("");
3662
3659
  var $L1 = $L("{");
@@ -4500,7 +4497,7 @@ ${input.slice(result.pos)}
4500
4497
  return result;
4501
4498
  }
4502
4499
  }
4503
- var TrailingMemberExpressions$0 = $TS($S($Q(MemberExpressionRest), $Q($S($C(Samedent, IndentedFurther), $Y($S($E($EXPECT($L5, fail, 'TrailingMemberExpressions "?"')), $EXPECT($L6, fail, 'TrailingMemberExpressions "."'), $N($EXPECT($R1, fail, "TrailingMemberExpressions /[0-9]/")))), MemberExpressionRest))), function($skip, $loc, $0, $1, $2) {
4500
+ var TrailingMemberExpressions$0 = $TS($S($Q(MemberExpressionRest), $Q($S(IndentedAtLeast, $Y($S($E($EXPECT($L5, fail, 'TrailingMemberExpressions "?"')), $EXPECT($L6, fail, 'TrailingMemberExpressions "."'), $N($EXPECT($R1, fail, "TrailingMemberExpressions /[0-9]/")))), MemberExpressionRest))), function($skip, $loc, $0, $1, $2) {
4504
4501
  return $1.concat($2);
4505
4502
  });
4506
4503
  function TrailingMemberExpressions(state) {
@@ -4551,7 +4548,7 @@ ${input.slice(result.pos)}
4551
4548
  return result;
4552
4549
  }
4553
4550
  }
4554
- var TrailingCallExpressions$0 = $P($S($C(Samedent, IndentedFurther), $Y($S($E($EXPECT($L5, fail, 'TrailingCallExpressions "?"')), $EXPECT($L6, fail, 'TrailingCallExpressions "."'), $N($R$0($EXPECT($R1, fail, "TrailingCallExpressions /[0-9]/"))))), $P(CallExpressionRest)));
4551
+ var TrailingCallExpressions$0 = $P($S(IndentedAtLeast, $Y($S($E($EXPECT($L5, fail, 'TrailingCallExpressions "?"')), $EXPECT($L6, fail, 'TrailingCallExpressions "."'), $N($R$0($EXPECT($R1, fail, "TrailingCallExpressions /[0-9]/"))))), $P(CallExpressionRest)));
4555
4552
  function TrailingCallExpressions(state) {
4556
4553
  let eventData;
4557
4554
  if (state.events) {
@@ -4599,7 +4596,7 @@ ${input.slice(result.pos)}
4599
4596
  return result;
4600
4597
  }
4601
4598
  }
4602
- var CommaDelimiter$0 = $S($E($C(Samedent, IndentedFurther)), $Q(_), Comma);
4599
+ var CommaDelimiter$0 = $S(NotDedented, Comma);
4603
4600
  function CommaDelimiter(state) {
4604
4601
  let eventData;
4605
4602
  if (state.events) {
@@ -8755,7 +8752,7 @@ ${input.slice(result.pos)}
8755
8752
  var s = $3;
8756
8753
  var ws = $4;
8757
8754
  var c = $5;
8758
- if (!s.children.length)
8755
+ if (!s.expressions.length)
8759
8756
  return $skip;
8760
8757
  return {
8761
8758
  type: "BlockStatement",
@@ -8830,16 +8827,16 @@ ${input.slice(result.pos)}
8830
8827
  return result;
8831
8828
  }
8832
8829
  }
8833
- var SingleLineStatements$0 = $TS($S($Q($S($S($E(_), $N(EOS)), Statement, SemicolonDelimiter)), $E($S($S($E(_), $N(EOS)), Statement, $E(SemicolonDelimiter)))), function($skip, $loc, $0, $1, $2) {
8834
- var stmts = $1;
8835
- var last = $2;
8836
- const children = [...stmts];
8830
+ var SingleLineStatements$0 = $TS($S(ForbidNewlineBinaryOp, $Q($S($S($E(_), $N(EOS)), Statement, SemicolonDelimiter)), $E($S($S($E(_), $N(EOS)), Statement, $E(SemicolonDelimiter))), RestoreNewlineBinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
8831
+ var stmts = $2;
8832
+ var last = $3;
8833
+ const expressions = [...stmts];
8837
8834
  if (last)
8838
- children.push(last);
8835
+ expressions.push(last);
8839
8836
  return {
8840
8837
  type: "BlockStatement",
8841
- expressions: children,
8842
- children,
8838
+ expressions,
8839
+ children: [expressions],
8843
8840
  bare: true
8844
8841
  };
8845
8842
  });
@@ -9295,9 +9292,7 @@ ${input.slice(result.pos)}
9295
9292
  } else {
9296
9293
  children = [open, content, ...ws, close];
9297
9294
  }
9298
- const names = children.flatMap((c) => {
9299
- return c.names || [];
9300
- });
9295
+ const names = children.flatMap((c) => c?.names || []);
9301
9296
  return {
9302
9297
  type: "ArrayExpression",
9303
9298
  children,
@@ -9413,17 +9408,17 @@ ${input.slice(result.pos)}
9413
9408
  }
9414
9409
  }
9415
9410
  var ArrayLiteralContent$0 = RangeExpression;
9416
- var ArrayLiteralContent$1 = $S(NestedImplicitObjectLiteral, $Q($S(__, Comma, NestedImplicitObjectLiteral)));
9417
- var ArrayLiteralContent$2 = NestedElementList;
9418
- var ArrayLiteralContent$3 = $TS($S(ElementListWithIndentedApplicationForbidden, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
9411
+ var ArrayLiteralContent$1 = $S(NestedElementList, $Y($S(__, CloseBracket)));
9412
+ var ArrayLiteralContent$2 = $TS($S(ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter, $E(NestedElementList), $Y($S(__, CloseBracket))), function($skip, $loc, $0, $1, $2, $3, $4) {
9419
9413
  var list = $1;
9420
- var comma = $2;
9414
+ var delimiter = $2;
9421
9415
  var nested = $3;
9422
- if (nested) {
9423
- return [...list, comma, ...nested];
9424
- } else {
9416
+ if (!nested)
9425
9417
  return list;
9426
- }
9418
+ return [...list, delimiter, ...nested];
9419
+ });
9420
+ var ArrayLiteralContent$3 = $TV($Q($S(__, ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
9421
+ return $1.flat();
9427
9422
  });
9428
9423
  function ArrayLiteralContent(state) {
9429
9424
  let eventData;
@@ -9571,9 +9566,9 @@ ${input.slice(result.pos)}
9571
9566
  return result;
9572
9567
  }
9573
9568
  }
9574
- var ElementList$0 = $TS($S(ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2) {
9575
- var first = $1;
9576
- var rest = $2;
9569
+ var ElementList$0 = $TS($S($N(EOS), ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2, $3) {
9570
+ var first = $2;
9571
+ var rest = $3;
9577
9572
  if (rest.length) {
9578
9573
  return [{
9579
9574
  ...first,
@@ -9610,7 +9605,7 @@ ${input.slice(result.pos)}
9610
9605
  return result;
9611
9606
  }
9612
9607
  }
9613
- var ElementListRest$0 = $S($S(__, Comma), ArrayElementExpression);
9608
+ var ElementListRest$0 = $S($S($E(_), Comma, $N(EOS)), ArrayElementExpression);
9614
9609
  function ElementListRest(state) {
9615
9610
  let eventData;
9616
9611
  if (state.events) {
@@ -9725,26 +9720,16 @@ ${input.slice(result.pos)}
9725
9720
  return result;
9726
9721
  }
9727
9722
  }
9728
- var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S($E(BracedObjectLiteralContent), __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
9723
+ var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S(BracedObjectLiteralContent, __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
9729
9724
  var open = $1;
9730
9725
  if (!$3)
9731
9726
  return $skip;
9732
9727
  const [properties, ...close] = $3;
9733
- if (properties) {
9734
- const children = [open, ...properties, close];
9735
- return {
9736
- type: "ObjectExpression",
9737
- children,
9738
- names: children.flatMap((c) => {
9739
- return c.names || [];
9740
- }),
9741
- properties
9742
- };
9743
- }
9744
9728
  return {
9745
9729
  type: "ObjectExpression",
9746
- children: [open, close],
9747
- names: []
9730
+ children: [open, properties, close],
9731
+ names: properties.flatMap((c) => c.names || []),
9732
+ properties
9748
9733
  };
9749
9734
  });
9750
9735
  function BracedObjectLiteral(state) {
@@ -9769,8 +9754,33 @@ ${input.slice(result.pos)}
9769
9754
  return result;
9770
9755
  }
9771
9756
  }
9772
- var BracedObjectLiteralContent$0 = NestedPropertyDefinitions;
9773
- var BracedObjectLiteralContent$1 = PropertyDefinitionList;
9757
+ var BracedObjectLiteralContent$0 = $TS($S($Q($S(PropertyDefinition, ObjectPropertyDelimiter)), $E(NestedPropertyDefinitions)), function($skip, $loc, $0, $1, $2) {
9758
+ var line = $1;
9759
+ var nested = $2;
9760
+ line = line.flatMap(([prop, delim]) => {
9761
+ prop = Array.isArray(prop) ? prop : [prop];
9762
+ let last = prop[prop.length - 1];
9763
+ last = {
9764
+ ...last,
9765
+ delim,
9766
+ children: [...last.children, delim]
9767
+ };
9768
+ return [...prop.slice(0, prop.length - 1), last];
9769
+ });
9770
+ return line.concat(nested || []);
9771
+ });
9772
+ var BracedObjectLiteralContent$1 = $TV($P($S(__, PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
9773
+ return $0.flatMap(([ws, prop, delim]) => {
9774
+ prop = Array.isArray(prop) ? prop : [prop];
9775
+ let last = prop[prop.length - 1];
9776
+ last = {
9777
+ ...last,
9778
+ delim,
9779
+ children: [ws, ...last.children.slice(1), delim]
9780
+ };
9781
+ return [...prop.slice(0, prop.length - 1), last];
9782
+ });
9783
+ });
9774
9784
  function BracedObjectLiteralContent(state) {
9775
9785
  let eventData;
9776
9786
  if (state.events) {
@@ -9794,9 +9804,11 @@ ${input.slice(result.pos)}
9794
9804
  }
9795
9805
  }
9796
9806
  var NestedImplicitObjectLiteral$0 = $TS($S(InsertOpenBrace, NestedImplicitPropertyDefinitions, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9807
+ var properties = $2;
9797
9808
  return {
9798
9809
  type: "ObjectExpression",
9799
- children: [$1, ...$2, $3, $4, $5]
9810
+ properties,
9811
+ children: $0
9800
9812
  };
9801
9813
  });
9802
9814
  function NestedImplicitObjectLiteral(state) {
@@ -9849,7 +9861,7 @@ ${input.slice(result.pos)}
9849
9861
  return result;
9850
9862
  }
9851
9863
  }
9852
- var NestedImplicitPropertyDefinition$0 = $TS($S(Nested, ImplicitNamedProperty, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
9864
+ var NestedImplicitPropertyDefinition$0 = $TS($S(Nested, NamedProperty, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
9853
9865
  var ws = $1;
9854
9866
  var prop = $2;
9855
9867
  var delimiter = $3;
@@ -9952,7 +9964,7 @@ ${input.slice(result.pos)}
9952
9964
  return result;
9953
9965
  }
9954
9966
  }
9955
- var InlineObjectLiteral$0 = $TS($S(InsertInlineOpenBrace, SnugNamedProperty, $Q($S(ImplicitInlineObjectPropertyDelimiter, ImplicitNamedProperty)), $E($S($E(_), Comma, $Y(Dedented))), InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9967
+ var InlineObjectLiteral$0 = $TS($S(InsertInlineOpenBrace, SnugNamedProperty, $Q($S(ImplicitInlineObjectPropertyDelimiter, NamedProperty)), $E($S($E(_), Comma, $Y(Dedented))), InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9956
9968
  var open = $1;
9957
9969
  var first = $2;
9958
9970
  var rest = $3;
@@ -9986,7 +9998,7 @@ ${input.slice(result.pos)}
9986
9998
  }
9987
9999
  }
9988
10000
  var ImplicitInlineObjectPropertyDelimiter$0 = $S($E(_), Comma, $C(NotDedented, $E(_)));
9989
- var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(Samedent, ImplicitNamedProperty)), InsertComma, $C(Samedent, $E(_))), function(value) {
10001
+ var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(Nested, NamedProperty)), InsertComma, $C(Nested, $E(_))), function(value) {
9990
10002
  return [value[1], value[2]];
9991
10003
  });
9992
10004
  function ImplicitInlineObjectPropertyDelimiter(state) {
@@ -10038,41 +10050,7 @@ ${input.slice(result.pos)}
10038
10050
  return result;
10039
10051
  }
10040
10052
  }
10041
- var PropertyDefinitionList$0 = $TV($P($S(PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
10042
- return $0.flatMap(([prop, delim]) => {
10043
- prop = Array.isArray(prop) ? prop : [prop];
10044
- let last = prop[prop.length - 1];
10045
- last = {
10046
- ...last,
10047
- delim,
10048
- children: [...last.children, delim]
10049
- };
10050
- return [...prop.slice(0, prop.length - 1), last];
10051
- });
10052
- });
10053
- function PropertyDefinitionList(state) {
10054
- let eventData;
10055
- if (state.events) {
10056
- const result = state.events.enter?.("PropertyDefinitionList", state);
10057
- if (result) {
10058
- if (result.cache)
10059
- return result.cache;
10060
- eventData = result.data;
10061
- }
10062
- }
10063
- if (state.tokenize) {
10064
- const result = $TOKEN("PropertyDefinitionList", state, PropertyDefinitionList$0(state));
10065
- if (state.events)
10066
- state.events.exit?.("PropertyDefinitionList", state, result, eventData);
10067
- return result;
10068
- } else {
10069
- const result = PropertyDefinitionList$0(state);
10070
- if (state.events)
10071
- state.events.exit?.("PropertyDefinitionList", state, result, eventData);
10072
- return result;
10073
- }
10074
- }
10075
- var PropertyDefinition$0 = $TS($S(__, AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
10053
+ var PropertyDefinition$0 = $TS($S($E(_), AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
10076
10054
  var ws = $1;
10077
10055
  var at = $2;
10078
10056
  var id = $3;
@@ -10085,7 +10063,7 @@ ${input.slice(result.pos)}
10085
10063
  value
10086
10064
  };
10087
10065
  });
10088
- var PropertyDefinition$1 = $TS($S(__, NamedProperty), function($skip, $loc, $0, $1, $2) {
10066
+ var PropertyDefinition$1 = $TS($S($E(_), NamedProperty), function($skip, $loc, $0, $1, $2) {
10089
10067
  var ws = $1;
10090
10068
  var prop = $2;
10091
10069
  return {
@@ -10093,7 +10071,7 @@ ${input.slice(result.pos)}
10093
10071
  children: [ws, ...prop.children]
10094
10072
  };
10095
10073
  });
10096
- var PropertyDefinition$2 = $TS($S(__, $TEXT($EXPECT($R6, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
10074
+ var PropertyDefinition$2 = $TS($S($E(_), $TEXT($EXPECT($R6, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
10097
10075
  var ws = $1;
10098
10076
  var toggle = $2;
10099
10077
  var id = $3;
@@ -10106,7 +10084,7 @@ ${input.slice(result.pos)}
10106
10084
  value
10107
10085
  };
10108
10086
  });
10109
- var PropertyDefinition$3 = $TS($S(__, MethodDefinition), function($skip, $loc, $0, $1, $2) {
10087
+ var PropertyDefinition$3 = $TS($S($E(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
10110
10088
  var ws = $1;
10111
10089
  var def = $2;
10112
10090
  if (!def.block || def.block.empty)
@@ -10116,7 +10094,7 @@ ${input.slice(result.pos)}
10116
10094
  children: [ws, ...def.children]
10117
10095
  };
10118
10096
  });
10119
- var PropertyDefinition$4 = $TS($S(__, DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
10097
+ var PropertyDefinition$4 = $TS($S($E(_), DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
10120
10098
  var ws = $1;
10121
10099
  var dots = $2;
10122
10100
  var exp = $3;
@@ -10128,9 +10106,9 @@ ${input.slice(result.pos)}
10128
10106
  value: exp
10129
10107
  };
10130
10108
  });
10131
- var PropertyDefinition$5 = $TS($S(__, CallExpression), function($skip, $loc, $0, $1, $2) {
10109
+ var PropertyDefinition$5 = $TS($S($E(_), $N(EOS), CallExpression), function($skip, $loc, $0, $1, $2, $3) {
10132
10110
  var ws = $1;
10133
- var value = $2;
10111
+ var value = $3;
10134
10112
  switch (value.type) {
10135
10113
  case "Identifier":
10136
10114
  return { ...value, children: [ws, ...value.children] };
@@ -10251,41 +10229,8 @@ ${input.slice(result.pos)}
10251
10229
  return result;
10252
10230
  }
10253
10231
  }
10254
- var ImplicitNamedProperty$0 = $TS($S(PropertyName, $E(_), Colon, $C(MultiLineImplicitObjectLiteralAllowed, $N(EOS)), ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10255
- var name = $1;
10256
- var exp = $5;
10257
- return {
10258
- type: "Property",
10259
- children: $0,
10260
- name,
10261
- names: exp.names || [],
10262
- value: exp
10263
- };
10264
- });
10265
- function ImplicitNamedProperty(state) {
10266
- let eventData;
10267
- if (state.events) {
10268
- const result = state.events.enter?.("ImplicitNamedProperty", state);
10269
- if (result) {
10270
- if (result.cache)
10271
- return result.cache;
10272
- eventData = result.data;
10273
- }
10274
- }
10275
- if (state.tokenize) {
10276
- const result = $TOKEN("ImplicitNamedProperty", state, ImplicitNamedProperty$0(state));
10277
- if (state.events)
10278
- state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
10279
- return result;
10280
- } else {
10281
- const result = ImplicitNamedProperty$0(state);
10282
- if (state.events)
10283
- state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
10284
- return result;
10285
- }
10286
- }
10287
- var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, $C(MultiLineImplicitObjectLiteralAllowed, $N(EOS)), ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4) {
10288
- var exp = $4;
10232
+ var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
10233
+ var exp = $3;
10289
10234
  return {
10290
10235
  type: "Property",
10291
10236
  children: $0,
@@ -10861,7 +10806,7 @@ ${input.slice(result.pos)}
10861
10806
  ws.push(...$2);
10862
10807
  return [ws, $3];
10863
10808
  });
10864
- var NotDedentedBinaryOp$1 = $TS($S(Samedent, $E(_), $N(Identifier), BinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
10809
+ var NotDedentedBinaryOp$1 = $TS($S(Nested, $E(_), $N(Identifier), BinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
10865
10810
  const ws = [...$1];
10866
10811
  if ($2)
10867
10812
  ws.push(...$2);
@@ -11649,7 +11594,7 @@ ${input.slice(result.pos)}
11649
11594
  return result;
11650
11595
  }
11651
11596
  }
11652
- var ElseClause$0 = $S(Samedent, Else, Block);
11597
+ var ElseClause$0 = $S(Nested, Else, Block);
11653
11598
  var ElseClause$1 = $S($E(_), Else, Block);
11654
11599
  function ElseClause(state) {
11655
11600
  let eventData;
@@ -11793,7 +11738,7 @@ ${input.slice(result.pos)}
11793
11738
  return result;
11794
11739
  }
11795
11740
  }
11796
- var ElseExpressionClause$0 = $TS($S($C($S(Samedent, Else), $S($E(_), Else)), ElseExpressionBlock), function($skip, $loc, $0, $1, $2) {
11741
+ var ElseExpressionClause$0 = $TS($S($C($S(Nested, Else), $S($E(_), Else)), ElseExpressionBlock), function($skip, $loc, $0, $1, $2) {
11797
11742
  return [...$1, $2];
11798
11743
  });
11799
11744
  function ElseExpressionClause(state) {
@@ -12897,7 +12842,7 @@ ${input.slice(result.pos)}
12897
12842
  return result;
12898
12843
  }
12899
12844
  }
12900
- var CaseBlock$0 = $TS($S($E($C(Samedent, _)), OpenBrace, NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12845
+ var CaseBlock$0 = $TS($S($E($C(Nested, _)), OpenBrace, NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12901
12846
  var clauses = $3;
12902
12847
  return {
12903
12848
  type: "CaseBlock",
@@ -13114,11 +13059,9 @@ ${input.slice(result.pos)}
13114
13059
  return result;
13115
13060
  }
13116
13061
  }
13117
- var CaseExpressionList$0 = $TS($S(ForbidMultiLineImplicitObjectLiteral, $E($S($E(_), CaseExpression, InsertColon)), $Q($S(__, Comma, CaseExpression, InsertColon)), RestoreMultiLineImplicitObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4) {
13118
- var first = $2;
13119
- var rest = $3;
13120
- if (!first)
13121
- return $skip;
13062
+ var CaseExpressionList$0 = $TS($S($S($E(_), CaseExpression, InsertColon), $Q($S(__, Comma, CaseExpression, InsertColon))), function($skip, $loc, $0, $1, $2) {
13063
+ var first = $1;
13064
+ var rest = $2;
13122
13065
  const result = rest.map(([ws, _comma, exp, col]) => {
13123
13066
  exp = insertTrimmingSpace(exp, "");
13124
13067
  if (ws.length)
@@ -13311,7 +13254,7 @@ ${input.slice(result.pos)}
13311
13254
  return result;
13312
13255
  }
13313
13256
  }
13314
- var CatchClause$0 = $TS($S($C(Samedent, _), Catch, $E(CatchBind), $C(ThenClause, BracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4) {
13257
+ var CatchClause$0 = $TS($S($C(Nested, _), Catch, $E(CatchBind), $C(ThenClause, BracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4) {
13315
13258
  var block = $4;
13316
13259
  return {
13317
13260
  type: "CatchClause",
@@ -13365,7 +13308,7 @@ ${input.slice(result.pos)}
13365
13308
  return result;
13366
13309
  }
13367
13310
  }
13368
- var FinallyClause$0 = $S($C(Samedent, _), Finally, $C(ThenClause, BracedOrEmptyBlock));
13311
+ var FinallyClause$0 = $S($C(Nested, _), Finally, $C(ThenClause, BracedOrEmptyBlock));
13369
13312
  function FinallyClause(state) {
13370
13313
  let eventData;
13371
13314
  if (state.events) {
@@ -13989,110 +13932,6 @@ ${input.slice(result.pos)}
13989
13932
  return result;
13990
13933
  }
13991
13934
  }
13992
- var ForbidMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'ForbidMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
13993
- module.forbidMultiLineImplicitObjectLiteral.push(true);
13994
- });
13995
- function ForbidMultiLineImplicitObjectLiteral(state) {
13996
- let eventData;
13997
- if (state.events) {
13998
- const result = state.events.enter?.("ForbidMultiLineImplicitObjectLiteral", state);
13999
- if (result) {
14000
- if (result.cache)
14001
- return result.cache;
14002
- eventData = result.data;
14003
- }
14004
- }
14005
- if (state.tokenize) {
14006
- const result = $TOKEN("ForbidMultiLineImplicitObjectLiteral", state, ForbidMultiLineImplicitObjectLiteral$0(state));
14007
- if (state.events)
14008
- state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
14009
- return result;
14010
- } else {
14011
- const result = ForbidMultiLineImplicitObjectLiteral$0(state);
14012
- if (state.events)
14013
- state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
14014
- return result;
14015
- }
14016
- }
14017
- var AllowMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'AllowMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
14018
- module.forbidMultiLineImplicitObjectLiteral.push(false);
14019
- });
14020
- function AllowMultiLineImplicitObjectLiteral(state) {
14021
- let eventData;
14022
- if (state.events) {
14023
- const result = state.events.enter?.("AllowMultiLineImplicitObjectLiteral", state);
14024
- if (result) {
14025
- if (result.cache)
14026
- return result.cache;
14027
- eventData = result.data;
14028
- }
14029
- }
14030
- if (state.tokenize) {
14031
- const result = $TOKEN("AllowMultiLineImplicitObjectLiteral", state, AllowMultiLineImplicitObjectLiteral$0(state));
14032
- if (state.events)
14033
- state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
14034
- return result;
14035
- } else {
14036
- const result = AllowMultiLineImplicitObjectLiteral$0(state);
14037
- if (state.events)
14038
- state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
14039
- return result;
14040
- }
14041
- }
14042
- var RestoreMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'RestoreMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
14043
- module.forbidMultiLineImplicitObjectLiteral.pop();
14044
- });
14045
- function RestoreMultiLineImplicitObjectLiteral(state) {
14046
- let eventData;
14047
- if (state.events) {
14048
- const result = state.events.enter?.("RestoreMultiLineImplicitObjectLiteral", state);
14049
- if (result) {
14050
- if (result.cache)
14051
- return result.cache;
14052
- eventData = result.data;
14053
- }
14054
- }
14055
- if (state.tokenize) {
14056
- const result = $TOKEN("RestoreMultiLineImplicitObjectLiteral", state, RestoreMultiLineImplicitObjectLiteral$0(state));
14057
- if (state.events)
14058
- state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
14059
- return result;
14060
- } else {
14061
- const result = RestoreMultiLineImplicitObjectLiteral$0(state);
14062
- if (state.events)
14063
- state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
14064
- return result;
14065
- }
14066
- }
14067
- var MultiLineImplicitObjectLiteralAllowed$0 = $TV($EXPECT($L0, fail, 'MultiLineImplicitObjectLiteralAllowed ""'), function($skip, $loc, $0, $1) {
14068
- if (module.config.verbose) {
14069
- console.log("forbidMultiLineImplicitObjectLiteral:", module.forbidMultiLineImplicitObjectLiteral);
14070
- }
14071
- if (module.multiLineImplicitObjectLiteralForbidden)
14072
- return $skip;
14073
- });
14074
- function MultiLineImplicitObjectLiteralAllowed(state) {
14075
- let eventData;
14076
- if (state.events) {
14077
- const result = state.events.enter?.("MultiLineImplicitObjectLiteralAllowed", state);
14078
- if (result) {
14079
- if (result.cache)
14080
- return result.cache;
14081
- eventData = result.data;
14082
- }
14083
- }
14084
- if (state.tokenize) {
14085
- const result = $TOKEN("MultiLineImplicitObjectLiteralAllowed", state, MultiLineImplicitObjectLiteralAllowed$0(state));
14086
- if (state.events)
14087
- state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
14088
- return result;
14089
- } else {
14090
- const result = MultiLineImplicitObjectLiteralAllowed$0(state);
14091
- if (state.events)
14092
- state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
14093
- return result;
14094
- }
14095
- }
14096
13935
  var AllowNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'AllowNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
14097
13936
  module.forbidNewlineBinaryOp.push(false);
14098
13937
  });
@@ -14197,7 +14036,7 @@ ${input.slice(result.pos)}
14197
14036
  return result;
14198
14037
  }
14199
14038
  }
14200
- var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowMultiLineImplicitObjectLiteral, AllowClassImplicitCall, AllowNewlineBinaryOp);
14039
+ var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNewlineBinaryOp);
14201
14040
  function AllowAll(state) {
14202
14041
  let eventData;
14203
14042
  if (state.events) {
@@ -14220,7 +14059,7 @@ ${input.slice(result.pos)}
14220
14059
  return result;
14221
14060
  }
14222
14061
  }
14223
- var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreMultiLineImplicitObjectLiteral, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
14062
+ var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
14224
14063
  function RestoreAll(state) {
14225
14064
  let eventData;
14226
14065
  if (state.events) {
@@ -16823,7 +16662,7 @@ ${input.slice(result.pos)}
16823
16662
  }
16824
16663
  }
16825
16664
  var StatementDelimiter$0 = SemicolonDelimiter;
16826
- var StatementDelimiter$1 = $S($Y($S(Samedent, $C($EXPECT($L4, fail, 'StatementDelimiter "("'), $EXPECT($L114, fail, 'StatementDelimiter "["'), $EXPECT($L115, fail, 'StatementDelimiter "`"'), $EXPECT($L59, fail, 'StatementDelimiter "+"'), $EXPECT($L20, fail, 'StatementDelimiter "-"'), $EXPECT($L55, fail, 'StatementDelimiter "*"'), $EXPECT($L56, fail, 'StatementDelimiter "/"'), ObjectLiteral, Arrow, FatArrow, $S(Function, $E($S($E(_), Star)), $E(_), $EXPECT($L4, fail, 'StatementDelimiter "("'))))), InsertSemicolon);
16665
+ var StatementDelimiter$1 = $S($Y($S(Nested, $C($EXPECT($L4, fail, 'StatementDelimiter "("'), $EXPECT($L114, fail, 'StatementDelimiter "["'), $EXPECT($L115, fail, 'StatementDelimiter "`"'), $EXPECT($L59, fail, 'StatementDelimiter "+"'), $EXPECT($L20, fail, 'StatementDelimiter "-"'), $EXPECT($L55, fail, 'StatementDelimiter "*"'), $EXPECT($L56, fail, 'StatementDelimiter "/"'), ObjectLiteral, Arrow, FatArrow, $S(Function, $E($S($E(_), Star)), $E(_), $EXPECT($L4, fail, 'StatementDelimiter "("'))))), InsertSemicolon);
16827
16666
  var StatementDelimiter$2 = $Y(EOS);
16828
16667
  function StatementDelimiter(state) {
16829
16668
  let eventData;
@@ -19044,7 +18883,7 @@ ${input.slice(result.pos)}
19044
18883
  return result;
19045
18884
  }
19046
18885
  }
19047
- var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(Samedent, JSXTag))), function($skip, $loc, $0, $1, $2) {
18886
+ var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
19048
18887
  const jsx = $2.length === 0 ? $1 : {
19049
18888
  type: "JSXFragment",
19050
18889
  children: [
@@ -20564,7 +20403,7 @@ ${input.slice(result.pos)}
20564
20403
  return result;
20565
20404
  }
20566
20405
  }
20567
- var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), __, Equals, $C($S($E(_), Type), $S(__, Type)));
20406
+ var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), OptionalEquals, $C($S($E(_), Type), $S(__, Type)));
20568
20407
  var TypeDeclarationRest$1 = $S(Interface, $E(_), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock);
20569
20408
  var TypeDeclarationRest$2 = $S(Namespace, $E(_), IdentifierName, ModuleBlock);
20570
20409
  var TypeDeclarationRest$3 = FunctionSignature;
@@ -20590,6 +20429,32 @@ ${input.slice(result.pos)}
20590
20429
  return result;
20591
20430
  }
20592
20431
  }
20432
+ var OptionalEquals$0 = $S(__, Equals);
20433
+ var OptionalEquals$1 = $T($S($Y(IndentedFurther), InsertSpaceEquals), function(value) {
20434
+ return value[1];
20435
+ });
20436
+ function OptionalEquals(state) {
20437
+ let eventData;
20438
+ if (state.events) {
20439
+ const result = state.events.enter?.("OptionalEquals", state);
20440
+ if (result) {
20441
+ if (result.cache)
20442
+ return result.cache;
20443
+ eventData = result.data;
20444
+ }
20445
+ }
20446
+ if (state.tokenize) {
20447
+ const result = $TOKEN("OptionalEquals", state, OptionalEquals$0(state) || OptionalEquals$1(state));
20448
+ if (state.events)
20449
+ state.events.exit?.("OptionalEquals", state, result, eventData);
20450
+ return result;
20451
+ } else {
20452
+ const result = OptionalEquals$0(state) || OptionalEquals$1(state);
20453
+ if (state.events)
20454
+ state.events.exit?.("OptionalEquals", state, result, eventData);
20455
+ return result;
20456
+ }
20457
+ }
20593
20458
  var TypeLexicalDeclaration$0 = $S(__, LetOrConstOrVar, TypeDeclarationBinding, $Q($S(CommaDelimiter, __, TypeDeclarationBinding)));
20594
20459
  var TypeLexicalDeclaration$1 = $S(__, EnumDeclaration);
20595
20460
  var TypeLexicalDeclaration$2 = ClassSignature;
@@ -21737,10 +21602,10 @@ ${input.slice(result.pos)}
21737
21602
  return result;
21738
21603
  }
21739
21604
  }
21740
- var TypePrimary$0 = InterfaceBlock;
21741
- var TypePrimary$1 = $S($E(_), FunctionType);
21742
- var TypePrimary$2 = $S($E(_), InlineInterfaceLiteral);
21743
- var TypePrimary$3 = $S($E(_), TypeTuple);
21605
+ var TypePrimary$0 = $S($E(_), TypeTuple);
21606
+ var TypePrimary$1 = InterfaceBlock;
21607
+ var TypePrimary$2 = $S($E(_), FunctionType);
21608
+ var TypePrimary$3 = $S($E(_), InlineInterfaceLiteral);
21744
21609
  var TypePrimary$4 = $S($E(_), ImportType);
21745
21610
  var TypePrimary$5 = $TS($S($E(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
21746
21611
  var t = $2;
@@ -21853,25 +21718,34 @@ ${input.slice(result.pos)}
21853
21718
  return result;
21854
21719
  }
21855
21720
  }
21856
- var TypeElement$0 = $TS($S(__, IdentifierName, $E(_), DotDotDot, $S(__, $E($S(QuestionMark, $E(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
21721
+ var TypeElement$0 = $TS($S(__, $E($S(DotDotDot, __)), IdentifierName, $E($S($E(_), DotDotDot)), $S(__, $E($S(QuestionMark, $E(_))), Colon, __), Type), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
21857
21722
  var ws = $1;
21858
- var name = $2;
21859
- var space = $3;
21860
- var dots = $4;
21723
+ var dots1 = $2;
21724
+ var name = $3;
21725
+ var dots2 = $4;
21861
21726
  var colon = $5;
21862
21727
  var type = $6;
21863
- return [ws, dots, space, name, colon, type];
21728
+ let dots = dots1 || dots2 && [dots2[1], dots2[0]];
21729
+ if (dots1 && dots2) {
21730
+ dots = [dots, {
21731
+ type: "Error",
21732
+ message: "... both before and after identifier"
21733
+ }];
21734
+ }
21735
+ return [ws, dots, name, colon, type];
21864
21736
  });
21865
- var TypeElement$1 = $TS($S(Type, $E(_), DotDotDot), function($skip, $loc, $0, $1, $2, $3) {
21737
+ var TypeElement$1 = $S(__, DotDotDot, __, Type);
21738
+ var TypeElement$2 = $TS($S(Type, $E($S($E(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
21866
21739
  var type = $1;
21867
- var space = $2;
21868
- var dots = $3;
21740
+ var spaceDots = $2;
21741
+ if (!spaceDots)
21742
+ return type;
21743
+ const [space, dots] = spaceDots;
21869
21744
  const ws = getTrimmingSpace(type);
21870
21745
  if (!ws)
21871
21746
  return [dots, space, type];
21872
21747
  return [ws, dots, space, insertTrimmingSpace(type, "")];
21873
21748
  });
21874
- var TypeElement$2 = $S($E($S(__, DotDotDot)), $E($S(__, IdentifierName, __, $E($S(QuestionMark, $E(_))), Colon, __)), Type);
21875
21749
  function TypeElement(state) {
21876
21750
  let eventData;
21877
21751
  if (state.events) {
@@ -22974,6 +22848,31 @@ ${input.slice(result.pos)}
22974
22848
  return result;
22975
22849
  }
22976
22850
  }
22851
+ var InsertSpaceEquals$0 = $TV($EXPECT($L0, fail, 'InsertSpaceEquals ""'), function($skip, $loc, $0, $1) {
22852
+ return { $loc, token: " =" };
22853
+ });
22854
+ function InsertSpaceEquals(state) {
22855
+ let eventData;
22856
+ if (state.events) {
22857
+ const result = state.events.enter?.("InsertSpaceEquals", state);
22858
+ if (result) {
22859
+ if (result.cache)
22860
+ return result.cache;
22861
+ eventData = result.data;
22862
+ }
22863
+ }
22864
+ if (state.tokenize) {
22865
+ const result = $TOKEN("InsertSpaceEquals", state, InsertSpaceEquals$0(state));
22866
+ if (state.events)
22867
+ state.events.exit?.("InsertSpaceEquals", state, result, eventData);
22868
+ return result;
22869
+ } else {
22870
+ const result = InsertSpaceEquals$0(state);
22871
+ if (state.events)
22872
+ state.events.exit?.("InsertSpaceEquals", state, result, eventData);
22873
+ return result;
22874
+ }
22875
+ }
22977
22876
  var InsertConst$0 = $TV($EXPECT($L0, fail, 'InsertConst ""'), function($skip, $loc, $0, $1) {
22978
22877
  return { $loc, token: "const " };
22979
22878
  });
@@ -23586,7 +23485,6 @@ ${input.slice(result.pos)}
23586
23485
  module.forbidIndentedApplication = [false];
23587
23486
  module.forbidBracedApplication = [false];
23588
23487
  module.forbidTrailingMemberProperty = [false];
23589
- module.forbidMultiLineImplicitObjectLiteral = [false];
23590
23488
  module.forbidNewlineBinaryOp = [false];
23591
23489
  module.JSXTagStack = [];
23592
23490
  module.operators = /* @__PURE__ */ new Set();
@@ -23623,12 +23521,6 @@ ${input.slice(result.pos)}
23623
23521
  return s[s.length - 1];
23624
23522
  }
23625
23523
  },
23626
- multiLineImplicitObjectLiteralForbidden: {
23627
- get() {
23628
- const { forbidMultiLineImplicitObjectLiteral: s } = module;
23629
- return s[s.length - 1];
23630
- }
23631
- },
23632
23524
  newlineBinaryOpForbidden: {
23633
23525
  get() {
23634
23526
  const { forbidNewlineBinaryOp: s } = module;
@@ -23931,19 +23823,11 @@ ${input.slice(result.pos)}
23931
23823
  return result;
23932
23824
  }
23933
23825
  }
23934
- var Samedent$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23935
- var indent = $2;
23936
- const { level } = indent;
23937
- const currentIndentLevel = module.currentIndent.level;
23938
- if (level === currentIndentLevel) {
23939
- return $0;
23940
- }
23941
- return $skip;
23942
- });
23943
- function Samedent(state) {
23826
+ var PushIndent$0 = $Y($S(EOS, TrackIndented));
23827
+ function PushIndent(state) {
23944
23828
  let eventData;
23945
23829
  if (state.events) {
23946
- const result = state.events.enter?.("Samedent", state);
23830
+ const result = state.events.enter?.("PushIndent", state);
23947
23831
  if (result) {
23948
23832
  if (result.cache)
23949
23833
  return result.cache;
@@ -23951,30 +23835,27 @@ ${input.slice(result.pos)}
23951
23835
  }
23952
23836
  }
23953
23837
  if (state.tokenize) {
23954
- const result = $TOKEN("Samedent", state, Samedent$0(state));
23838
+ const result = $TOKEN("PushIndent", state, PushIndent$0(state));
23955
23839
  if (state.events)
23956
- state.events.exit?.("Samedent", state, result, eventData);
23840
+ state.events.exit?.("PushIndent", state, result, eventData);
23957
23841
  return result;
23958
23842
  } else {
23959
- const result = Samedent$0(state);
23843
+ const result = PushIndent$0(state);
23960
23844
  if (state.events)
23961
- state.events.exit?.("Samedent", state, result, eventData);
23845
+ state.events.exit?.("PushIndent", state, result, eventData);
23962
23846
  return result;
23963
23847
  }
23964
23848
  }
23965
- var IndentedFurther$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23966
- var indent = $2;
23967
- const { level } = indent;
23968
- const currentIndentLevel = module.currentIndent.level;
23969
- if (level > currentIndentLevel) {
23970
- return $0;
23849
+ var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
23850
+ if (module.config.verbose) {
23851
+ console.log("popping indent", module.indentLevels[module.indentLevels.length - 1], "->", module.indentLevels[module.indentLevels.length - 2]);
23971
23852
  }
23972
- return $skip;
23853
+ module.indentLevels.pop();
23973
23854
  });
23974
- function IndentedFurther(state) {
23855
+ function PopIndent(state) {
23975
23856
  let eventData;
23976
23857
  if (state.events) {
23977
- const result = state.events.enter?.("IndentedFurther", state);
23858
+ const result = state.events.enter?.("PopIndent", state);
23978
23859
  if (result) {
23979
23860
  if (result.cache)
23980
23861
  return result.cache;
@@ -23982,29 +23863,30 @@ ${input.slice(result.pos)}
23982
23863
  }
23983
23864
  }
23984
23865
  if (state.tokenize) {
23985
- const result = $TOKEN("IndentedFurther", state, IndentedFurther$0(state));
23866
+ const result = $TOKEN("PopIndent", state, PopIndent$0(state));
23986
23867
  if (state.events)
23987
- state.events.exit?.("IndentedFurther", state, result, eventData);
23868
+ state.events.exit?.("PopIndent", state, result, eventData);
23988
23869
  return result;
23989
23870
  } else {
23990
- const result = IndentedFurther$0(state);
23871
+ const result = PopIndent$0(state);
23991
23872
  if (state.events)
23992
- state.events.exit?.("IndentedFurther", state, result, eventData);
23873
+ state.events.exit?.("PopIndent", state, result, eventData);
23993
23874
  return result;
23994
23875
  }
23995
23876
  }
23996
- var NotDedented$0 = $TS($S($E($C(Samedent, IndentedFurther)), $E(_)), function($skip, $loc, $0, $1, $2) {
23997
- const ws = [];
23998
- if ($1)
23999
- ws.push(...$1);
24000
- if ($2)
24001
- ws.push(...$2);
24002
- return ws.flat(Infinity).filter(Boolean);
23877
+ var Nested$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23878
+ var indent = $2;
23879
+ if (indent.level === module.currentIndent.level)
23880
+ return $0;
23881
+ if (module.config.verbose) {
23882
+ console.log(`failing Nested: ${indent.level} does not match current indent level ${module.currentIndent.level}`);
23883
+ }
23884
+ return $skip;
24003
23885
  });
24004
- function NotDedented(state) {
23886
+ function Nested(state) {
24005
23887
  let eventData;
24006
23888
  if (state.events) {
24007
- const result = state.events.enter?.("NotDedented", state);
23889
+ const result = state.events.enter?.("Nested", state);
24008
23890
  if (result) {
24009
23891
  if (result.cache)
24010
23892
  return result.cache;
@@ -24012,24 +23894,27 @@ ${input.slice(result.pos)}
24012
23894
  }
24013
23895
  }
24014
23896
  if (state.tokenize) {
24015
- const result = $TOKEN("NotDedented", state, NotDedented$0(state));
23897
+ const result = $TOKEN("Nested", state, Nested$0(state));
24016
23898
  if (state.events)
24017
- state.events.exit?.("NotDedented", state, result, eventData);
23899
+ state.events.exit?.("Nested", state, result, eventData);
24018
23900
  return result;
24019
23901
  } else {
24020
- const result = NotDedented$0(state);
23902
+ const result = Nested$0(state);
24021
23903
  if (state.events)
24022
- state.events.exit?.("NotDedented", state, result, eventData);
23904
+ state.events.exit?.("Nested", state, result, eventData);
24023
23905
  return result;
24024
23906
  }
24025
23907
  }
24026
- var Dedented$0 = $T($S($N($C(Samedent, IndentedFurther)), EOS), function(value) {
24027
- return value[1];
23908
+ var IndentedFurther$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23909
+ var indent = $2;
23910
+ if (indent.level > module.currentIndent.level)
23911
+ return $0;
23912
+ return $skip;
24028
23913
  });
24029
- function Dedented(state) {
23914
+ function IndentedFurther(state) {
24030
23915
  let eventData;
24031
23916
  if (state.events) {
24032
- const result = state.events.enter?.("Dedented", state);
23917
+ const result = state.events.enter?.("IndentedFurther", state);
24033
23918
  if (result) {
24034
23919
  if (result.cache)
24035
23920
  return result.cache;
@@ -24037,22 +23922,27 @@ ${input.slice(result.pos)}
24037
23922
  }
24038
23923
  }
24039
23924
  if (state.tokenize) {
24040
- const result = $TOKEN("Dedented", state, Dedented$0(state));
23925
+ const result = $TOKEN("IndentedFurther", state, IndentedFurther$0(state));
24041
23926
  if (state.events)
24042
- state.events.exit?.("Dedented", state, result, eventData);
23927
+ state.events.exit?.("IndentedFurther", state, result, eventData);
24043
23928
  return result;
24044
23929
  } else {
24045
- const result = Dedented$0(state);
23930
+ const result = IndentedFurther$0(state);
24046
23931
  if (state.events)
24047
- state.events.exit?.("Dedented", state, result, eventData);
23932
+ state.events.exit?.("IndentedFurther", state, result, eventData);
24048
23933
  return result;
24049
23934
  }
24050
23935
  }
24051
- var PushIndent$0 = $Y($S(EOS, TrackIndented));
24052
- function PushIndent(state) {
23936
+ var IndentedAtLeast$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23937
+ var indent = $2;
23938
+ if (indent.level >= module.currentIndent.level)
23939
+ return $0;
23940
+ return $skip;
23941
+ });
23942
+ function IndentedAtLeast(state) {
24053
23943
  let eventData;
24054
23944
  if (state.events) {
24055
- const result = state.events.enter?.("PushIndent", state);
23945
+ const result = state.events.enter?.("IndentedAtLeast", state);
24056
23946
  if (result) {
24057
23947
  if (result.cache)
24058
23948
  return result.cache;
@@ -24060,27 +23950,29 @@ ${input.slice(result.pos)}
24060
23950
  }
24061
23951
  }
24062
23952
  if (state.tokenize) {
24063
- const result = $TOKEN("PushIndent", state, PushIndent$0(state));
23953
+ const result = $TOKEN("IndentedAtLeast", state, IndentedAtLeast$0(state));
24064
23954
  if (state.events)
24065
- state.events.exit?.("PushIndent", state, result, eventData);
23955
+ state.events.exit?.("IndentedAtLeast", state, result, eventData);
24066
23956
  return result;
24067
23957
  } else {
24068
- const result = PushIndent$0(state);
23958
+ const result = IndentedAtLeast$0(state);
24069
23959
  if (state.events)
24070
- state.events.exit?.("PushIndent", state, result, eventData);
23960
+ state.events.exit?.("IndentedAtLeast", state, result, eventData);
24071
23961
  return result;
24072
23962
  }
24073
23963
  }
24074
- var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
24075
- if (module.config.verbose) {
24076
- console.log("popping indent", module.indentLevels[module.indentLevels.length - 1], "->", module.indentLevels[module.indentLevels.length - 2]);
24077
- }
24078
- module.indentLevels.pop();
23964
+ var NotDedented$0 = $TS($S($E(IndentedAtLeast), $E(_)), function($skip, $loc, $0, $1, $2) {
23965
+ const ws = [];
23966
+ if ($1)
23967
+ ws.push(...$1);
23968
+ if ($2)
23969
+ ws.push(...$2);
23970
+ return ws.flat(Infinity).filter(Boolean);
24079
23971
  });
24080
- function PopIndent(state) {
23972
+ function NotDedented(state) {
24081
23973
  let eventData;
24082
23974
  if (state.events) {
24083
- const result = state.events.enter?.("PopIndent", state);
23975
+ const result = state.events.enter?.("NotDedented", state);
24084
23976
  if (result) {
24085
23977
  if (result.cache)
24086
23978
  return result.cache;
@@ -24088,37 +23980,24 @@ ${input.slice(result.pos)}
24088
23980
  }
24089
23981
  }
24090
23982
  if (state.tokenize) {
24091
- const result = $TOKEN("PopIndent", state, PopIndent$0(state));
23983
+ const result = $TOKEN("NotDedented", state, NotDedented$0(state));
24092
23984
  if (state.events)
24093
- state.events.exit?.("PopIndent", state, result, eventData);
23985
+ state.events.exit?.("NotDedented", state, result, eventData);
24094
23986
  return result;
24095
23987
  } else {
24096
- const result = PopIndent$0(state);
23988
+ const result = NotDedented$0(state);
24097
23989
  if (state.events)
24098
- state.events.exit?.("PopIndent", state, result, eventData);
23990
+ state.events.exit?.("NotDedented", state, result, eventData);
24099
23991
  return result;
24100
23992
  }
24101
23993
  }
24102
- var Nested$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
24103
- var eos = $1;
24104
- var indent = $2;
24105
- const { level } = indent;
24106
- const currentIndent = module.currentIndent;
24107
- if (module.config.verbose) {
24108
- console.log("Indented", level, currentIndent);
24109
- }
24110
- if (level !== currentIndent.level) {
24111
- if (module.config.verbose) {
24112
- console.log("skipped nested");
24113
- }
24114
- return $skip;
24115
- }
24116
- return $0;
23994
+ var Dedented$0 = $T($S($N(IndentedAtLeast), EOS), function(value) {
23995
+ return value[1];
24117
23996
  });
24118
- function Nested(state) {
23997
+ function Dedented(state) {
24119
23998
  let eventData;
24120
23999
  if (state.events) {
24121
- const result = state.events.enter?.("Nested", state);
24000
+ const result = state.events.enter?.("Dedented", state);
24122
24001
  if (result) {
24123
24002
  if (result.cache)
24124
24003
  return result.cache;
@@ -24126,14 +24005,14 @@ ${input.slice(result.pos)}
24126
24005
  }
24127
24006
  }
24128
24007
  if (state.tokenize) {
24129
- const result = $TOKEN("Nested", state, Nested$0(state));
24008
+ const result = $TOKEN("Dedented", state, Dedented$0(state));
24130
24009
  if (state.events)
24131
- state.events.exit?.("Nested", state, result, eventData);
24010
+ state.events.exit?.("Dedented", state, result, eventData);
24132
24011
  return result;
24133
24012
  } else {
24134
- const result = Nested$0(state);
24013
+ const result = Dedented$0(state);
24135
24014
  if (state.events)
24136
- state.events.exit?.("Nested", state, result, eventData);
24015
+ state.events.exit?.("Dedented", state, result, eventData);
24137
24016
  return result;
24138
24017
  }
24139
24018
  }
@@ -24601,7 +24480,7 @@ var parse;
24601
24480
  var uncacheable;
24602
24481
  ({ parse } = import_parser.default);
24603
24482
  ({ SourceMap: SourceMap2 } = util_exports);
24604
- uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowBracedApplication", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowNewlineBinaryOp", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedApplicationAllowed", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "ConditionFragment", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExpressionWithObjectApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidBracedApplication", "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", "NonPipelineAssignmentExpression", "NonPipelineExtendedExpression", "NonPipelinePostfixedExpression", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PatternExpressionList", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreBracedApplication", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RestoreNewlineBinaryOp", "RHS", "Samedent", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineBinaryOpRHS", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
24483
+ uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowBracedApplication", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowNewlineBinaryOp", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedApplicationAllowed", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "ConditionFragment", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExpressionWithObjectApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidBracedApplication", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidNewlineBinaryOp", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedAtLeast", "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", "NonPipelineArgumentPart", "NonPipelineArgumentList", "NonPipelineAssignmentExpression", "NonPipelineExtendedExpression", "NonPipelinePostfixedExpression", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PatternExpressionList", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreBracedApplication", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RestoreNewlineBinaryOp", "RHS", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineBinaryOpRHS", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
24605
24484
  var compile = function(src, options) {
24606
24485
  var ast, code, events, filename, ref, result, sm;
24607
24486
  if (!options) {