@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.js CHANGED
@@ -2064,10 +2064,11 @@ var require_lib = __commonJS({
2064
2064
  });
2065
2065
  }
2066
2066
  function processProgram(root, config, m, ReservedWord) {
2067
+ assert.equal(m.forbidBracedApplication.length, 1, "forbidBracedApplication");
2067
2068
  assert.equal(m.forbidClassImplicitCall.length, 1, "forbidClassImplicitCall");
2068
2069
  assert.equal(m.forbidIndentedApplication.length, 1, "forbidIndentedApplication");
2070
+ assert.equal(m.forbidNewlineBinaryOp.length, 1, "forbidNewlineBinaryOp");
2069
2071
  assert.equal(m.forbidTrailingMemberProperty.length, 1, "forbidTrailingMemberProperty");
2070
- assert.equal(m.forbidMultiLineImplicitObjectLiteral.length, 1, "forbidMultiLineImplicitObjectLiteral");
2071
2072
  assert.equal(m.JSXTagStack.length, 0, "JSXTagStack should be empty");
2072
2073
  addParentPointers(root);
2073
2074
  const { expressions: statements } = root;
@@ -3191,10 +3192,8 @@ ${input.slice(result.pos)}
3191
3192
  InlineObjectLiteral,
3192
3193
  ImplicitInlineObjectPropertyDelimiter,
3193
3194
  ObjectPropertyDelimiter,
3194
- PropertyDefinitionList,
3195
3195
  PropertyDefinition,
3196
3196
  NamedProperty,
3197
- ImplicitNamedProperty,
3198
3197
  SnugNamedProperty,
3199
3198
  PropertyName,
3200
3199
  ComputedPropertyName,
@@ -3300,10 +3299,6 @@ ${input.slice(result.pos)}
3300
3299
  AllowTrailingMemberProperty,
3301
3300
  RestoreTrailingMemberProperty,
3302
3301
  TrailingMemberPropertyAllowed,
3303
- ForbidMultiLineImplicitObjectLiteral,
3304
- AllowMultiLineImplicitObjectLiteral,
3305
- RestoreMultiLineImplicitObjectLiteral,
3306
- MultiLineImplicitObjectLiteralAllowed,
3307
3302
  AllowNewlineBinaryOp,
3308
3303
  ForbidNewlineBinaryOp,
3309
3304
  RestoreNewlineBinaryOp,
@@ -3537,6 +3532,7 @@ ${input.slice(result.pos)}
3537
3532
  NestedJSXChildExpression,
3538
3533
  TypeDeclaration,
3539
3534
  TypeDeclarationRest,
3535
+ OptionalEquals,
3540
3536
  TypeLexicalDeclaration,
3541
3537
  TypeDeclarationBinding,
3542
3538
  InterfaceExtendsClause,
@@ -3625,6 +3621,7 @@ ${input.slice(result.pos)}
3625
3621
  InsertOpenBracket,
3626
3622
  InsertCloseBracket,
3627
3623
  InsertComma,
3624
+ InsertSpaceEquals,
3628
3625
  InsertConst,
3629
3626
  InsertLet,
3630
3627
  InsertReadonly,
@@ -3652,13 +3649,13 @@ ${input.slice(result.pos)}
3652
3649
  Init,
3653
3650
  Indent,
3654
3651
  TrackIndented,
3655
- Samedent,
3656
- IndentedFurther,
3657
- NotDedented,
3658
- Dedented,
3659
3652
  PushIndent,
3660
3653
  PopIndent,
3661
- Nested
3654
+ Nested,
3655
+ IndentedFurther,
3656
+ IndentedAtLeast,
3657
+ NotDedented,
3658
+ Dedented
3662
3659
  });
3663
3660
  var $L0 = $L("");
3664
3661
  var $L1 = $L("{");
@@ -4502,7 +4499,7 @@ ${input.slice(result.pos)}
4502
4499
  return result;
4503
4500
  }
4504
4501
  }
4505
- 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) {
4502
+ 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) {
4506
4503
  return $1.concat($2);
4507
4504
  });
4508
4505
  function TrailingMemberExpressions(state) {
@@ -4553,7 +4550,7 @@ ${input.slice(result.pos)}
4553
4550
  return result;
4554
4551
  }
4555
4552
  }
4556
- 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)));
4553
+ 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)));
4557
4554
  function TrailingCallExpressions(state) {
4558
4555
  let eventData;
4559
4556
  if (state.events) {
@@ -4601,7 +4598,7 @@ ${input.slice(result.pos)}
4601
4598
  return result;
4602
4599
  }
4603
4600
  }
4604
- var CommaDelimiter$0 = $S($E($C(Samedent, IndentedFurther)), $Q(_), Comma);
4601
+ var CommaDelimiter$0 = $S(NotDedented, Comma);
4605
4602
  function CommaDelimiter(state) {
4606
4603
  let eventData;
4607
4604
  if (state.events) {
@@ -8757,7 +8754,7 @@ ${input.slice(result.pos)}
8757
8754
  var s = $3;
8758
8755
  var ws = $4;
8759
8756
  var c = $5;
8760
- if (!s.children.length)
8757
+ if (!s.expressions.length)
8761
8758
  return $skip;
8762
8759
  return {
8763
8760
  type: "BlockStatement",
@@ -8832,16 +8829,16 @@ ${input.slice(result.pos)}
8832
8829
  return result;
8833
8830
  }
8834
8831
  }
8835
- 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) {
8836
- var stmts = $1;
8837
- var last = $2;
8838
- const children = [...stmts];
8832
+ 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) {
8833
+ var stmts = $2;
8834
+ var last = $3;
8835
+ const expressions = [...stmts];
8839
8836
  if (last)
8840
- children.push(last);
8837
+ expressions.push(last);
8841
8838
  return {
8842
8839
  type: "BlockStatement",
8843
- expressions: children,
8844
- children,
8840
+ expressions,
8841
+ children: [expressions],
8845
8842
  bare: true
8846
8843
  };
8847
8844
  });
@@ -9297,9 +9294,7 @@ ${input.slice(result.pos)}
9297
9294
  } else {
9298
9295
  children = [open, content, ...ws, close];
9299
9296
  }
9300
- const names = children.flatMap((c) => {
9301
- return c.names || [];
9302
- });
9297
+ const names = children.flatMap((c) => c?.names || []);
9303
9298
  return {
9304
9299
  type: "ArrayExpression",
9305
9300
  children,
@@ -9415,17 +9410,17 @@ ${input.slice(result.pos)}
9415
9410
  }
9416
9411
  }
9417
9412
  var ArrayLiteralContent$0 = RangeExpression;
9418
- var ArrayLiteralContent$1 = $S(NestedImplicitObjectLiteral, $Q($S(__, Comma, NestedImplicitObjectLiteral)));
9419
- var ArrayLiteralContent$2 = NestedElementList;
9420
- var ArrayLiteralContent$3 = $TS($S(ElementListWithIndentedApplicationForbidden, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
9413
+ var ArrayLiteralContent$1 = $S(NestedElementList, $Y($S(__, CloseBracket)));
9414
+ var ArrayLiteralContent$2 = $TS($S(ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter, $E(NestedElementList), $Y($S(__, CloseBracket))), function($skip, $loc, $0, $1, $2, $3, $4) {
9421
9415
  var list = $1;
9422
- var comma = $2;
9416
+ var delimiter = $2;
9423
9417
  var nested = $3;
9424
- if (nested) {
9425
- return [...list, comma, ...nested];
9426
- } else {
9418
+ if (!nested)
9427
9419
  return list;
9428
- }
9420
+ return [...list, delimiter, ...nested];
9421
+ });
9422
+ var ArrayLiteralContent$3 = $TV($Q($S(__, ElementListWithIndentedApplicationForbidden, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
9423
+ return $1.flat();
9429
9424
  });
9430
9425
  function ArrayLiteralContent(state) {
9431
9426
  let eventData;
@@ -9573,9 +9568,9 @@ ${input.slice(result.pos)}
9573
9568
  return result;
9574
9569
  }
9575
9570
  }
9576
- var ElementList$0 = $TS($S(ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2) {
9577
- var first = $1;
9578
- var rest = $2;
9571
+ var ElementList$0 = $TS($S($N(EOS), ArrayElementExpression, $Q(ElementListRest)), function($skip, $loc, $0, $1, $2, $3) {
9572
+ var first = $2;
9573
+ var rest = $3;
9579
9574
  if (rest.length) {
9580
9575
  return [{
9581
9576
  ...first,
@@ -9612,7 +9607,7 @@ ${input.slice(result.pos)}
9612
9607
  return result;
9613
9608
  }
9614
9609
  }
9615
- var ElementListRest$0 = $S($S(__, Comma), ArrayElementExpression);
9610
+ var ElementListRest$0 = $S($S($E(_), Comma, $N(EOS)), ArrayElementExpression);
9616
9611
  function ElementListRest(state) {
9617
9612
  let eventData;
9618
9613
  if (state.events) {
@@ -9727,26 +9722,16 @@ ${input.slice(result.pos)}
9727
9722
  return result;
9728
9723
  }
9729
9724
  }
9730
- var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S($E(BracedObjectLiteralContent), __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
9725
+ var BracedObjectLiteral$0 = $TS($S(OpenBrace, AllowAll, $E($S(BracedObjectLiteralContent, __, CloseBrace)), RestoreAll), function($skip, $loc, $0, $1, $2, $3, $4) {
9731
9726
  var open = $1;
9732
9727
  if (!$3)
9733
9728
  return $skip;
9734
9729
  const [properties, ...close] = $3;
9735
- if (properties) {
9736
- const children = [open, ...properties, close];
9737
- return {
9738
- type: "ObjectExpression",
9739
- children,
9740
- names: children.flatMap((c) => {
9741
- return c.names || [];
9742
- }),
9743
- properties
9744
- };
9745
- }
9746
9730
  return {
9747
9731
  type: "ObjectExpression",
9748
- children: [open, close],
9749
- names: []
9732
+ children: [open, properties, close],
9733
+ names: properties.flatMap((c) => c.names || []),
9734
+ properties
9750
9735
  };
9751
9736
  });
9752
9737
  function BracedObjectLiteral(state) {
@@ -9771,8 +9756,33 @@ ${input.slice(result.pos)}
9771
9756
  return result;
9772
9757
  }
9773
9758
  }
9774
- var BracedObjectLiteralContent$0 = NestedPropertyDefinitions;
9775
- var BracedObjectLiteralContent$1 = PropertyDefinitionList;
9759
+ var BracedObjectLiteralContent$0 = $TS($S($Q($S(PropertyDefinition, ObjectPropertyDelimiter)), $E(NestedPropertyDefinitions)), function($skip, $loc, $0, $1, $2) {
9760
+ var line = $1;
9761
+ var nested = $2;
9762
+ line = line.flatMap(([prop, delim]) => {
9763
+ prop = Array.isArray(prop) ? prop : [prop];
9764
+ let last = prop[prop.length - 1];
9765
+ last = {
9766
+ ...last,
9767
+ delim,
9768
+ children: [...last.children, delim]
9769
+ };
9770
+ return [...prop.slice(0, prop.length - 1), last];
9771
+ });
9772
+ return line.concat(nested || []);
9773
+ });
9774
+ var BracedObjectLiteralContent$1 = $TV($P($S(__, PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
9775
+ return $0.flatMap(([ws, prop, delim]) => {
9776
+ prop = Array.isArray(prop) ? prop : [prop];
9777
+ let last = prop[prop.length - 1];
9778
+ last = {
9779
+ ...last,
9780
+ delim,
9781
+ children: [ws, ...last.children.slice(1), delim]
9782
+ };
9783
+ return [...prop.slice(0, prop.length - 1), last];
9784
+ });
9785
+ });
9776
9786
  function BracedObjectLiteralContent(state) {
9777
9787
  let eventData;
9778
9788
  if (state.events) {
@@ -9796,9 +9806,11 @@ ${input.slice(result.pos)}
9796
9806
  }
9797
9807
  }
9798
9808
  var NestedImplicitObjectLiteral$0 = $TS($S(InsertOpenBrace, NestedImplicitPropertyDefinitions, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9809
+ var properties = $2;
9799
9810
  return {
9800
9811
  type: "ObjectExpression",
9801
- children: [$1, ...$2, $3, $4, $5]
9812
+ properties,
9813
+ children: $0
9802
9814
  };
9803
9815
  });
9804
9816
  function NestedImplicitObjectLiteral(state) {
@@ -9851,7 +9863,7 @@ ${input.slice(result.pos)}
9851
9863
  return result;
9852
9864
  }
9853
9865
  }
9854
- var NestedImplicitPropertyDefinition$0 = $TS($S(Nested, ImplicitNamedProperty, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
9866
+ var NestedImplicitPropertyDefinition$0 = $TS($S(Nested, NamedProperty, ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3) {
9855
9867
  var ws = $1;
9856
9868
  var prop = $2;
9857
9869
  var delimiter = $3;
@@ -9954,7 +9966,7 @@ ${input.slice(result.pos)}
9954
9966
  return result;
9955
9967
  }
9956
9968
  }
9957
- 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) {
9969
+ 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) {
9958
9970
  var open = $1;
9959
9971
  var first = $2;
9960
9972
  var rest = $3;
@@ -9988,7 +10000,7 @@ ${input.slice(result.pos)}
9988
10000
  }
9989
10001
  }
9990
10002
  var ImplicitInlineObjectPropertyDelimiter$0 = $S($E(_), Comma, $C(NotDedented, $E(_)));
9991
- var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(Samedent, ImplicitNamedProperty)), InsertComma, $C(Samedent, $E(_))), function(value) {
10003
+ var ImplicitInlineObjectPropertyDelimiter$1 = $T($S($Y($S(Nested, NamedProperty)), InsertComma, $C(Nested, $E(_))), function(value) {
9992
10004
  return [value[1], value[2]];
9993
10005
  });
9994
10006
  function ImplicitInlineObjectPropertyDelimiter(state) {
@@ -10040,41 +10052,7 @@ ${input.slice(result.pos)}
10040
10052
  return result;
10041
10053
  }
10042
10054
  }
10043
- var PropertyDefinitionList$0 = $TV($P($S(PropertyDefinition, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
10044
- return $0.flatMap(([prop, delim]) => {
10045
- prop = Array.isArray(prop) ? prop : [prop];
10046
- let last = prop[prop.length - 1];
10047
- last = {
10048
- ...last,
10049
- delim,
10050
- children: [...last.children, delim]
10051
- };
10052
- return [...prop.slice(0, prop.length - 1), last];
10053
- });
10054
- });
10055
- function PropertyDefinitionList(state) {
10056
- let eventData;
10057
- if (state.events) {
10058
- const result = state.events.enter?.("PropertyDefinitionList", state);
10059
- if (result) {
10060
- if (result.cache)
10061
- return result.cache;
10062
- eventData = result.data;
10063
- }
10064
- }
10065
- if (state.tokenize) {
10066
- const result = $TOKEN("PropertyDefinitionList", state, PropertyDefinitionList$0(state));
10067
- if (state.events)
10068
- state.events.exit?.("PropertyDefinitionList", state, result, eventData);
10069
- return result;
10070
- } else {
10071
- const result = PropertyDefinitionList$0(state);
10072
- if (state.events)
10073
- state.events.exit?.("PropertyDefinitionList", state, result, eventData);
10074
- return result;
10075
- }
10076
- }
10077
- var PropertyDefinition$0 = $TS($S(__, AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
10055
+ var PropertyDefinition$0 = $TS($S($E(_), AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
10078
10056
  var ws = $1;
10079
10057
  var at = $2;
10080
10058
  var id = $3;
@@ -10087,7 +10065,7 @@ ${input.slice(result.pos)}
10087
10065
  value
10088
10066
  };
10089
10067
  });
10090
- var PropertyDefinition$1 = $TS($S(__, NamedProperty), function($skip, $loc, $0, $1, $2) {
10068
+ var PropertyDefinition$1 = $TS($S($E(_), NamedProperty), function($skip, $loc, $0, $1, $2) {
10091
10069
  var ws = $1;
10092
10070
  var prop = $2;
10093
10071
  return {
@@ -10095,7 +10073,7 @@ ${input.slice(result.pos)}
10095
10073
  children: [ws, ...prop.children]
10096
10074
  };
10097
10075
  });
10098
- var PropertyDefinition$2 = $TS($S(__, $TEXT($EXPECT($R6, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
10076
+ var PropertyDefinition$2 = $TS($S($E(_), $TEXT($EXPECT($R6, fail, "PropertyDefinition /[!+-]/")), PropertyName), function($skip, $loc, $0, $1, $2, $3) {
10099
10077
  var ws = $1;
10100
10078
  var toggle = $2;
10101
10079
  var id = $3;
@@ -10108,7 +10086,7 @@ ${input.slice(result.pos)}
10108
10086
  value
10109
10087
  };
10110
10088
  });
10111
- var PropertyDefinition$3 = $TS($S(__, MethodDefinition), function($skip, $loc, $0, $1, $2) {
10089
+ var PropertyDefinition$3 = $TS($S($E(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
10112
10090
  var ws = $1;
10113
10091
  var def = $2;
10114
10092
  if (!def.block || def.block.empty)
@@ -10118,7 +10096,7 @@ ${input.slice(result.pos)}
10118
10096
  children: [ws, ...def.children]
10119
10097
  };
10120
10098
  });
10121
- var PropertyDefinition$4 = $TS($S(__, DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
10099
+ var PropertyDefinition$4 = $TS($S($E(_), DotDotDot, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
10122
10100
  var ws = $1;
10123
10101
  var dots = $2;
10124
10102
  var exp = $3;
@@ -10130,9 +10108,9 @@ ${input.slice(result.pos)}
10130
10108
  value: exp
10131
10109
  };
10132
10110
  });
10133
- var PropertyDefinition$5 = $TS($S(__, CallExpression), function($skip, $loc, $0, $1, $2) {
10111
+ var PropertyDefinition$5 = $TS($S($E(_), $N(EOS), CallExpression), function($skip, $loc, $0, $1, $2, $3) {
10134
10112
  var ws = $1;
10135
- var value = $2;
10113
+ var value = $3;
10136
10114
  switch (value.type) {
10137
10115
  case "Identifier":
10138
10116
  return { ...value, children: [ws, ...value.children] };
@@ -10253,41 +10231,8 @@ ${input.slice(result.pos)}
10253
10231
  return result;
10254
10232
  }
10255
10233
  }
10256
- var ImplicitNamedProperty$0 = $TS($S(PropertyName, $E(_), Colon, $C(MultiLineImplicitObjectLiteralAllowed, $N(EOS)), ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
10257
- var name = $1;
10258
- var exp = $5;
10259
- return {
10260
- type: "Property",
10261
- children: $0,
10262
- name,
10263
- names: exp.names || [],
10264
- value: exp
10265
- };
10266
- });
10267
- function ImplicitNamedProperty(state) {
10268
- let eventData;
10269
- if (state.events) {
10270
- const result = state.events.enter?.("ImplicitNamedProperty", state);
10271
- if (result) {
10272
- if (result.cache)
10273
- return result.cache;
10274
- eventData = result.data;
10275
- }
10276
- }
10277
- if (state.tokenize) {
10278
- const result = $TOKEN("ImplicitNamedProperty", state, ImplicitNamedProperty$0(state));
10279
- if (state.events)
10280
- state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
10281
- return result;
10282
- } else {
10283
- const result = ImplicitNamedProperty$0(state);
10284
- if (state.events)
10285
- state.events.exit?.("ImplicitNamedProperty", state, result, eventData);
10286
- return result;
10287
- }
10288
- }
10289
- var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, $C(MultiLineImplicitObjectLiteralAllowed, $N(EOS)), ExtendedExpression), function($skip, $loc, $0, $1, $2, $3, $4) {
10290
- var exp = $4;
10234
+ var SnugNamedProperty$0 = $TS($S(PropertyName, Colon, ExtendedExpression), function($skip, $loc, $0, $1, $2, $3) {
10235
+ var exp = $3;
10291
10236
  return {
10292
10237
  type: "Property",
10293
10238
  children: $0,
@@ -10863,7 +10808,7 @@ ${input.slice(result.pos)}
10863
10808
  ws.push(...$2);
10864
10809
  return [ws, $3];
10865
10810
  });
10866
- var NotDedentedBinaryOp$1 = $TS($S(Samedent, $E(_), $N(Identifier), BinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
10811
+ var NotDedentedBinaryOp$1 = $TS($S(Nested, $E(_), $N(Identifier), BinaryOp), function($skip, $loc, $0, $1, $2, $3, $4) {
10867
10812
  const ws = [...$1];
10868
10813
  if ($2)
10869
10814
  ws.push(...$2);
@@ -11651,7 +11596,7 @@ ${input.slice(result.pos)}
11651
11596
  return result;
11652
11597
  }
11653
11598
  }
11654
- var ElseClause$0 = $S(Samedent, Else, Block);
11599
+ var ElseClause$0 = $S(Nested, Else, Block);
11655
11600
  var ElseClause$1 = $S($E(_), Else, Block);
11656
11601
  function ElseClause(state) {
11657
11602
  let eventData;
@@ -11795,7 +11740,7 @@ ${input.slice(result.pos)}
11795
11740
  return result;
11796
11741
  }
11797
11742
  }
11798
- var ElseExpressionClause$0 = $TS($S($C($S(Samedent, Else), $S($E(_), Else)), ElseExpressionBlock), function($skip, $loc, $0, $1, $2) {
11743
+ var ElseExpressionClause$0 = $TS($S($C($S(Nested, Else), $S($E(_), Else)), ElseExpressionBlock), function($skip, $loc, $0, $1, $2) {
11799
11744
  return [...$1, $2];
11800
11745
  });
11801
11746
  function ElseExpressionClause(state) {
@@ -12899,7 +12844,7 @@ ${input.slice(result.pos)}
12899
12844
  return result;
12900
12845
  }
12901
12846
  }
12902
- var CaseBlock$0 = $TS($S($E($C(Samedent, _)), OpenBrace, NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12847
+ var CaseBlock$0 = $TS($S($E($C(Nested, _)), OpenBrace, NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12903
12848
  var clauses = $3;
12904
12849
  return {
12905
12850
  type: "CaseBlock",
@@ -13116,11 +13061,9 @@ ${input.slice(result.pos)}
13116
13061
  return result;
13117
13062
  }
13118
13063
  }
13119
- 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) {
13120
- var first = $2;
13121
- var rest = $3;
13122
- if (!first)
13123
- return $skip;
13064
+ var CaseExpressionList$0 = $TS($S($S($E(_), CaseExpression, InsertColon), $Q($S(__, Comma, CaseExpression, InsertColon))), function($skip, $loc, $0, $1, $2) {
13065
+ var first = $1;
13066
+ var rest = $2;
13124
13067
  const result = rest.map(([ws, _comma, exp, col]) => {
13125
13068
  exp = insertTrimmingSpace(exp, "");
13126
13069
  if (ws.length)
@@ -13313,7 +13256,7 @@ ${input.slice(result.pos)}
13313
13256
  return result;
13314
13257
  }
13315
13258
  }
13316
- var CatchClause$0 = $TS($S($C(Samedent, _), Catch, $E(CatchBind), $C(ThenClause, BracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4) {
13259
+ var CatchClause$0 = $TS($S($C(Nested, _), Catch, $E(CatchBind), $C(ThenClause, BracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4) {
13317
13260
  var block = $4;
13318
13261
  return {
13319
13262
  type: "CatchClause",
@@ -13367,7 +13310,7 @@ ${input.slice(result.pos)}
13367
13310
  return result;
13368
13311
  }
13369
13312
  }
13370
- var FinallyClause$0 = $S($C(Samedent, _), Finally, $C(ThenClause, BracedOrEmptyBlock));
13313
+ var FinallyClause$0 = $S($C(Nested, _), Finally, $C(ThenClause, BracedOrEmptyBlock));
13371
13314
  function FinallyClause(state) {
13372
13315
  let eventData;
13373
13316
  if (state.events) {
@@ -13991,110 +13934,6 @@ ${input.slice(result.pos)}
13991
13934
  return result;
13992
13935
  }
13993
13936
  }
13994
- var ForbidMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'ForbidMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
13995
- module2.forbidMultiLineImplicitObjectLiteral.push(true);
13996
- });
13997
- function ForbidMultiLineImplicitObjectLiteral(state) {
13998
- let eventData;
13999
- if (state.events) {
14000
- const result = state.events.enter?.("ForbidMultiLineImplicitObjectLiteral", state);
14001
- if (result) {
14002
- if (result.cache)
14003
- return result.cache;
14004
- eventData = result.data;
14005
- }
14006
- }
14007
- if (state.tokenize) {
14008
- const result = $TOKEN("ForbidMultiLineImplicitObjectLiteral", state, ForbidMultiLineImplicitObjectLiteral$0(state));
14009
- if (state.events)
14010
- state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
14011
- return result;
14012
- } else {
14013
- const result = ForbidMultiLineImplicitObjectLiteral$0(state);
14014
- if (state.events)
14015
- state.events.exit?.("ForbidMultiLineImplicitObjectLiteral", state, result, eventData);
14016
- return result;
14017
- }
14018
- }
14019
- var AllowMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'AllowMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
14020
- module2.forbidMultiLineImplicitObjectLiteral.push(false);
14021
- });
14022
- function AllowMultiLineImplicitObjectLiteral(state) {
14023
- let eventData;
14024
- if (state.events) {
14025
- const result = state.events.enter?.("AllowMultiLineImplicitObjectLiteral", state);
14026
- if (result) {
14027
- if (result.cache)
14028
- return result.cache;
14029
- eventData = result.data;
14030
- }
14031
- }
14032
- if (state.tokenize) {
14033
- const result = $TOKEN("AllowMultiLineImplicitObjectLiteral", state, AllowMultiLineImplicitObjectLiteral$0(state));
14034
- if (state.events)
14035
- state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
14036
- return result;
14037
- } else {
14038
- const result = AllowMultiLineImplicitObjectLiteral$0(state);
14039
- if (state.events)
14040
- state.events.exit?.("AllowMultiLineImplicitObjectLiteral", state, result, eventData);
14041
- return result;
14042
- }
14043
- }
14044
- var RestoreMultiLineImplicitObjectLiteral$0 = $TV($EXPECT($L0, fail, 'RestoreMultiLineImplicitObjectLiteral ""'), function($skip, $loc, $0, $1) {
14045
- module2.forbidMultiLineImplicitObjectLiteral.pop();
14046
- });
14047
- function RestoreMultiLineImplicitObjectLiteral(state) {
14048
- let eventData;
14049
- if (state.events) {
14050
- const result = state.events.enter?.("RestoreMultiLineImplicitObjectLiteral", state);
14051
- if (result) {
14052
- if (result.cache)
14053
- return result.cache;
14054
- eventData = result.data;
14055
- }
14056
- }
14057
- if (state.tokenize) {
14058
- const result = $TOKEN("RestoreMultiLineImplicitObjectLiteral", state, RestoreMultiLineImplicitObjectLiteral$0(state));
14059
- if (state.events)
14060
- state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
14061
- return result;
14062
- } else {
14063
- const result = RestoreMultiLineImplicitObjectLiteral$0(state);
14064
- if (state.events)
14065
- state.events.exit?.("RestoreMultiLineImplicitObjectLiteral", state, result, eventData);
14066
- return result;
14067
- }
14068
- }
14069
- var MultiLineImplicitObjectLiteralAllowed$0 = $TV($EXPECT($L0, fail, 'MultiLineImplicitObjectLiteralAllowed ""'), function($skip, $loc, $0, $1) {
14070
- if (module2.config.verbose) {
14071
- console.log("forbidMultiLineImplicitObjectLiteral:", module2.forbidMultiLineImplicitObjectLiteral);
14072
- }
14073
- if (module2.multiLineImplicitObjectLiteralForbidden)
14074
- return $skip;
14075
- });
14076
- function MultiLineImplicitObjectLiteralAllowed(state) {
14077
- let eventData;
14078
- if (state.events) {
14079
- const result = state.events.enter?.("MultiLineImplicitObjectLiteralAllowed", state);
14080
- if (result) {
14081
- if (result.cache)
14082
- return result.cache;
14083
- eventData = result.data;
14084
- }
14085
- }
14086
- if (state.tokenize) {
14087
- const result = $TOKEN("MultiLineImplicitObjectLiteralAllowed", state, MultiLineImplicitObjectLiteralAllowed$0(state));
14088
- if (state.events)
14089
- state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
14090
- return result;
14091
- } else {
14092
- const result = MultiLineImplicitObjectLiteralAllowed$0(state);
14093
- if (state.events)
14094
- state.events.exit?.("MultiLineImplicitObjectLiteralAllowed", state, result, eventData);
14095
- return result;
14096
- }
14097
- }
14098
13937
  var AllowNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'AllowNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
14099
13938
  module2.forbidNewlineBinaryOp.push(false);
14100
13939
  });
@@ -14199,7 +14038,7 @@ ${input.slice(result.pos)}
14199
14038
  return result;
14200
14039
  }
14201
14040
  }
14202
- var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowMultiLineImplicitObjectLiteral, AllowClassImplicitCall, AllowNewlineBinaryOp);
14041
+ var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNewlineBinaryOp);
14203
14042
  function AllowAll(state) {
14204
14043
  let eventData;
14205
14044
  if (state.events) {
@@ -14222,7 +14061,7 @@ ${input.slice(result.pos)}
14222
14061
  return result;
14223
14062
  }
14224
14063
  }
14225
- var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreMultiLineImplicitObjectLiteral, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
14064
+ var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
14226
14065
  function RestoreAll(state) {
14227
14066
  let eventData;
14228
14067
  if (state.events) {
@@ -16825,7 +16664,7 @@ ${input.slice(result.pos)}
16825
16664
  }
16826
16665
  }
16827
16666
  var StatementDelimiter$0 = SemicolonDelimiter;
16828
- 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);
16667
+ 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);
16829
16668
  var StatementDelimiter$2 = $Y(EOS);
16830
16669
  function StatementDelimiter(state) {
16831
16670
  let eventData;
@@ -19046,7 +18885,7 @@ ${input.slice(result.pos)}
19046
18885
  return result;
19047
18886
  }
19048
18887
  }
19049
- var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(Samedent, JSXTag))), function($skip, $loc, $0, $1, $2) {
18888
+ var JSXImplicitFragment$0 = $TS($S(JSXTag, $Q($S(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
19050
18889
  const jsx = $2.length === 0 ? $1 : {
19051
18890
  type: "JSXFragment",
19052
18891
  children: [
@@ -20566,7 +20405,7 @@ ${input.slice(result.pos)}
20566
20405
  return result;
20567
20406
  }
20568
20407
  }
20569
- var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), __, Equals, $C($S($E(_), Type), $S(__, Type)));
20408
+ var TypeDeclarationRest$0 = $S(TypeKeyword, $E(_), IdentifierName, $E(TypeParameters), OptionalEquals, $C($S($E(_), Type), $S(__, Type)));
20570
20409
  var TypeDeclarationRest$1 = $S(Interface, $E(_), IdentifierName, $E(TypeParameters), $E(InterfaceExtendsClause), InterfaceBlock);
20571
20410
  var TypeDeclarationRest$2 = $S(Namespace, $E(_), IdentifierName, ModuleBlock);
20572
20411
  var TypeDeclarationRest$3 = FunctionSignature;
@@ -20592,6 +20431,32 @@ ${input.slice(result.pos)}
20592
20431
  return result;
20593
20432
  }
20594
20433
  }
20434
+ var OptionalEquals$0 = $S(__, Equals);
20435
+ var OptionalEquals$1 = $T($S($Y(IndentedFurther), InsertSpaceEquals), function(value) {
20436
+ return value[1];
20437
+ });
20438
+ function OptionalEquals(state) {
20439
+ let eventData;
20440
+ if (state.events) {
20441
+ const result = state.events.enter?.("OptionalEquals", state);
20442
+ if (result) {
20443
+ if (result.cache)
20444
+ return result.cache;
20445
+ eventData = result.data;
20446
+ }
20447
+ }
20448
+ if (state.tokenize) {
20449
+ const result = $TOKEN("OptionalEquals", state, OptionalEquals$0(state) || OptionalEquals$1(state));
20450
+ if (state.events)
20451
+ state.events.exit?.("OptionalEquals", state, result, eventData);
20452
+ return result;
20453
+ } else {
20454
+ const result = OptionalEquals$0(state) || OptionalEquals$1(state);
20455
+ if (state.events)
20456
+ state.events.exit?.("OptionalEquals", state, result, eventData);
20457
+ return result;
20458
+ }
20459
+ }
20595
20460
  var TypeLexicalDeclaration$0 = $S(__, LetOrConstOrVar, TypeDeclarationBinding, $Q($S(CommaDelimiter, __, TypeDeclarationBinding)));
20596
20461
  var TypeLexicalDeclaration$1 = $S(__, EnumDeclaration);
20597
20462
  var TypeLexicalDeclaration$2 = ClassSignature;
@@ -21739,10 +21604,10 @@ ${input.slice(result.pos)}
21739
21604
  return result;
21740
21605
  }
21741
21606
  }
21742
- var TypePrimary$0 = InterfaceBlock;
21743
- var TypePrimary$1 = $S($E(_), FunctionType);
21744
- var TypePrimary$2 = $S($E(_), InlineInterfaceLiteral);
21745
- var TypePrimary$3 = $S($E(_), TypeTuple);
21607
+ var TypePrimary$0 = $S($E(_), TypeTuple);
21608
+ var TypePrimary$1 = InterfaceBlock;
21609
+ var TypePrimary$2 = $S($E(_), FunctionType);
21610
+ var TypePrimary$3 = $S($E(_), InlineInterfaceLiteral);
21746
21611
  var TypePrimary$4 = $S($E(_), ImportType);
21747
21612
  var TypePrimary$5 = $TS($S($E(_), TypeLiteral), function($skip, $loc, $0, $1, $2) {
21748
21613
  var t = $2;
@@ -21855,25 +21720,34 @@ ${input.slice(result.pos)}
21855
21720
  return result;
21856
21721
  }
21857
21722
  }
21858
- 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) {
21723
+ 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) {
21859
21724
  var ws = $1;
21860
- var name = $2;
21861
- var space = $3;
21862
- var dots = $4;
21725
+ var dots1 = $2;
21726
+ var name = $3;
21727
+ var dots2 = $4;
21863
21728
  var colon = $5;
21864
21729
  var type = $6;
21865
- return [ws, dots, space, name, colon, type];
21730
+ let dots = dots1 || dots2 && [dots2[1], dots2[0]];
21731
+ if (dots1 && dots2) {
21732
+ dots = [dots, {
21733
+ type: "Error",
21734
+ message: "... both before and after identifier"
21735
+ }];
21736
+ }
21737
+ return [ws, dots, name, colon, type];
21866
21738
  });
21867
- var TypeElement$1 = $TS($S(Type, $E(_), DotDotDot), function($skip, $loc, $0, $1, $2, $3) {
21739
+ var TypeElement$1 = $S(__, DotDotDot, __, Type);
21740
+ var TypeElement$2 = $TS($S(Type, $E($S($E(_), DotDotDot))), function($skip, $loc, $0, $1, $2) {
21868
21741
  var type = $1;
21869
- var space = $2;
21870
- var dots = $3;
21742
+ var spaceDots = $2;
21743
+ if (!spaceDots)
21744
+ return type;
21745
+ const [space, dots] = spaceDots;
21871
21746
  const ws = getTrimmingSpace(type);
21872
21747
  if (!ws)
21873
21748
  return [dots, space, type];
21874
21749
  return [ws, dots, space, insertTrimmingSpace(type, "")];
21875
21750
  });
21876
- var TypeElement$2 = $S($E($S(__, DotDotDot)), $E($S(__, IdentifierName, __, $E($S(QuestionMark, $E(_))), Colon, __)), Type);
21877
21751
  function TypeElement(state) {
21878
21752
  let eventData;
21879
21753
  if (state.events) {
@@ -22976,6 +22850,31 @@ ${input.slice(result.pos)}
22976
22850
  return result;
22977
22851
  }
22978
22852
  }
22853
+ var InsertSpaceEquals$0 = $TV($EXPECT($L0, fail, 'InsertSpaceEquals ""'), function($skip, $loc, $0, $1) {
22854
+ return { $loc, token: " =" };
22855
+ });
22856
+ function InsertSpaceEquals(state) {
22857
+ let eventData;
22858
+ if (state.events) {
22859
+ const result = state.events.enter?.("InsertSpaceEquals", state);
22860
+ if (result) {
22861
+ if (result.cache)
22862
+ return result.cache;
22863
+ eventData = result.data;
22864
+ }
22865
+ }
22866
+ if (state.tokenize) {
22867
+ const result = $TOKEN("InsertSpaceEquals", state, InsertSpaceEquals$0(state));
22868
+ if (state.events)
22869
+ state.events.exit?.("InsertSpaceEquals", state, result, eventData);
22870
+ return result;
22871
+ } else {
22872
+ const result = InsertSpaceEquals$0(state);
22873
+ if (state.events)
22874
+ state.events.exit?.("InsertSpaceEquals", state, result, eventData);
22875
+ return result;
22876
+ }
22877
+ }
22979
22878
  var InsertConst$0 = $TV($EXPECT($L0, fail, 'InsertConst ""'), function($skip, $loc, $0, $1) {
22980
22879
  return { $loc, token: "const " };
22981
22880
  });
@@ -23588,7 +23487,6 @@ ${input.slice(result.pos)}
23588
23487
  module2.forbidIndentedApplication = [false];
23589
23488
  module2.forbidBracedApplication = [false];
23590
23489
  module2.forbidTrailingMemberProperty = [false];
23591
- module2.forbidMultiLineImplicitObjectLiteral = [false];
23592
23490
  module2.forbidNewlineBinaryOp = [false];
23593
23491
  module2.JSXTagStack = [];
23594
23492
  module2.operators = /* @__PURE__ */ new Set();
@@ -23625,12 +23523,6 @@ ${input.slice(result.pos)}
23625
23523
  return s[s.length - 1];
23626
23524
  }
23627
23525
  },
23628
- multiLineImplicitObjectLiteralForbidden: {
23629
- get() {
23630
- const { forbidMultiLineImplicitObjectLiteral: s } = module2;
23631
- return s[s.length - 1];
23632
- }
23633
- },
23634
23526
  newlineBinaryOpForbidden: {
23635
23527
  get() {
23636
23528
  const { forbidNewlineBinaryOp: s } = module2;
@@ -23933,19 +23825,11 @@ ${input.slice(result.pos)}
23933
23825
  return result;
23934
23826
  }
23935
23827
  }
23936
- var Samedent$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23937
- var indent = $2;
23938
- const { level } = indent;
23939
- const currentIndentLevel = module2.currentIndent.level;
23940
- if (level === currentIndentLevel) {
23941
- return $0;
23942
- }
23943
- return $skip;
23944
- });
23945
- function Samedent(state) {
23828
+ var PushIndent$0 = $Y($S(EOS, TrackIndented));
23829
+ function PushIndent(state) {
23946
23830
  let eventData;
23947
23831
  if (state.events) {
23948
- const result = state.events.enter?.("Samedent", state);
23832
+ const result = state.events.enter?.("PushIndent", state);
23949
23833
  if (result) {
23950
23834
  if (result.cache)
23951
23835
  return result.cache;
@@ -23953,30 +23837,27 @@ ${input.slice(result.pos)}
23953
23837
  }
23954
23838
  }
23955
23839
  if (state.tokenize) {
23956
- const result = $TOKEN("Samedent", state, Samedent$0(state));
23840
+ const result = $TOKEN("PushIndent", state, PushIndent$0(state));
23957
23841
  if (state.events)
23958
- state.events.exit?.("Samedent", state, result, eventData);
23842
+ state.events.exit?.("PushIndent", state, result, eventData);
23959
23843
  return result;
23960
23844
  } else {
23961
- const result = Samedent$0(state);
23845
+ const result = PushIndent$0(state);
23962
23846
  if (state.events)
23963
- state.events.exit?.("Samedent", state, result, eventData);
23847
+ state.events.exit?.("PushIndent", state, result, eventData);
23964
23848
  return result;
23965
23849
  }
23966
23850
  }
23967
- var IndentedFurther$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23968
- var indent = $2;
23969
- const { level } = indent;
23970
- const currentIndentLevel = module2.currentIndent.level;
23971
- if (level > currentIndentLevel) {
23972
- return $0;
23851
+ var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
23852
+ if (module2.config.verbose) {
23853
+ console.log("popping indent", module2.indentLevels[module2.indentLevels.length - 1], "->", module2.indentLevels[module2.indentLevels.length - 2]);
23973
23854
  }
23974
- return $skip;
23855
+ module2.indentLevels.pop();
23975
23856
  });
23976
- function IndentedFurther(state) {
23857
+ function PopIndent(state) {
23977
23858
  let eventData;
23978
23859
  if (state.events) {
23979
- const result = state.events.enter?.("IndentedFurther", state);
23860
+ const result = state.events.enter?.("PopIndent", state);
23980
23861
  if (result) {
23981
23862
  if (result.cache)
23982
23863
  return result.cache;
@@ -23984,29 +23865,30 @@ ${input.slice(result.pos)}
23984
23865
  }
23985
23866
  }
23986
23867
  if (state.tokenize) {
23987
- const result = $TOKEN("IndentedFurther", state, IndentedFurther$0(state));
23868
+ const result = $TOKEN("PopIndent", state, PopIndent$0(state));
23988
23869
  if (state.events)
23989
- state.events.exit?.("IndentedFurther", state, result, eventData);
23870
+ state.events.exit?.("PopIndent", state, result, eventData);
23990
23871
  return result;
23991
23872
  } else {
23992
- const result = IndentedFurther$0(state);
23873
+ const result = PopIndent$0(state);
23993
23874
  if (state.events)
23994
- state.events.exit?.("IndentedFurther", state, result, eventData);
23875
+ state.events.exit?.("PopIndent", state, result, eventData);
23995
23876
  return result;
23996
23877
  }
23997
23878
  }
23998
- var NotDedented$0 = $TS($S($E($C(Samedent, IndentedFurther)), $E(_)), function($skip, $loc, $0, $1, $2) {
23999
- const ws = [];
24000
- if ($1)
24001
- ws.push(...$1);
24002
- if ($2)
24003
- ws.push(...$2);
24004
- return ws.flat(Infinity).filter(Boolean);
23879
+ var Nested$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23880
+ var indent = $2;
23881
+ if (indent.level === module2.currentIndent.level)
23882
+ return $0;
23883
+ if (module2.config.verbose) {
23884
+ console.log(`failing Nested: ${indent.level} does not match current indent level ${module2.currentIndent.level}`);
23885
+ }
23886
+ return $skip;
24005
23887
  });
24006
- function NotDedented(state) {
23888
+ function Nested(state) {
24007
23889
  let eventData;
24008
23890
  if (state.events) {
24009
- const result = state.events.enter?.("NotDedented", state);
23891
+ const result = state.events.enter?.("Nested", state);
24010
23892
  if (result) {
24011
23893
  if (result.cache)
24012
23894
  return result.cache;
@@ -24014,24 +23896,27 @@ ${input.slice(result.pos)}
24014
23896
  }
24015
23897
  }
24016
23898
  if (state.tokenize) {
24017
- const result = $TOKEN("NotDedented", state, NotDedented$0(state));
23899
+ const result = $TOKEN("Nested", state, Nested$0(state));
24018
23900
  if (state.events)
24019
- state.events.exit?.("NotDedented", state, result, eventData);
23901
+ state.events.exit?.("Nested", state, result, eventData);
24020
23902
  return result;
24021
23903
  } else {
24022
- const result = NotDedented$0(state);
23904
+ const result = Nested$0(state);
24023
23905
  if (state.events)
24024
- state.events.exit?.("NotDedented", state, result, eventData);
23906
+ state.events.exit?.("Nested", state, result, eventData);
24025
23907
  return result;
24026
23908
  }
24027
23909
  }
24028
- var Dedented$0 = $T($S($N($C(Samedent, IndentedFurther)), EOS), function(value) {
24029
- return value[1];
23910
+ var IndentedFurther$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23911
+ var indent = $2;
23912
+ if (indent.level > module2.currentIndent.level)
23913
+ return $0;
23914
+ return $skip;
24030
23915
  });
24031
- function Dedented(state) {
23916
+ function IndentedFurther(state) {
24032
23917
  let eventData;
24033
23918
  if (state.events) {
24034
- const result = state.events.enter?.("Dedented", state);
23919
+ const result = state.events.enter?.("IndentedFurther", state);
24035
23920
  if (result) {
24036
23921
  if (result.cache)
24037
23922
  return result.cache;
@@ -24039,22 +23924,27 @@ ${input.slice(result.pos)}
24039
23924
  }
24040
23925
  }
24041
23926
  if (state.tokenize) {
24042
- const result = $TOKEN("Dedented", state, Dedented$0(state));
23927
+ const result = $TOKEN("IndentedFurther", state, IndentedFurther$0(state));
24043
23928
  if (state.events)
24044
- state.events.exit?.("Dedented", state, result, eventData);
23929
+ state.events.exit?.("IndentedFurther", state, result, eventData);
24045
23930
  return result;
24046
23931
  } else {
24047
- const result = Dedented$0(state);
23932
+ const result = IndentedFurther$0(state);
24048
23933
  if (state.events)
24049
- state.events.exit?.("Dedented", state, result, eventData);
23934
+ state.events.exit?.("IndentedFurther", state, result, eventData);
24050
23935
  return result;
24051
23936
  }
24052
23937
  }
24053
- var PushIndent$0 = $Y($S(EOS, TrackIndented));
24054
- function PushIndent(state) {
23938
+ var IndentedAtLeast$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
23939
+ var indent = $2;
23940
+ if (indent.level >= module2.currentIndent.level)
23941
+ return $0;
23942
+ return $skip;
23943
+ });
23944
+ function IndentedAtLeast(state) {
24055
23945
  let eventData;
24056
23946
  if (state.events) {
24057
- const result = state.events.enter?.("PushIndent", state);
23947
+ const result = state.events.enter?.("IndentedAtLeast", state);
24058
23948
  if (result) {
24059
23949
  if (result.cache)
24060
23950
  return result.cache;
@@ -24062,27 +23952,29 @@ ${input.slice(result.pos)}
24062
23952
  }
24063
23953
  }
24064
23954
  if (state.tokenize) {
24065
- const result = $TOKEN("PushIndent", state, PushIndent$0(state));
23955
+ const result = $TOKEN("IndentedAtLeast", state, IndentedAtLeast$0(state));
24066
23956
  if (state.events)
24067
- state.events.exit?.("PushIndent", state, result, eventData);
23957
+ state.events.exit?.("IndentedAtLeast", state, result, eventData);
24068
23958
  return result;
24069
23959
  } else {
24070
- const result = PushIndent$0(state);
23960
+ const result = IndentedAtLeast$0(state);
24071
23961
  if (state.events)
24072
- state.events.exit?.("PushIndent", state, result, eventData);
23962
+ state.events.exit?.("IndentedAtLeast", state, result, eventData);
24073
23963
  return result;
24074
23964
  }
24075
23965
  }
24076
- var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
24077
- if (module2.config.verbose) {
24078
- console.log("popping indent", module2.indentLevels[module2.indentLevels.length - 1], "->", module2.indentLevels[module2.indentLevels.length - 2]);
24079
- }
24080
- module2.indentLevels.pop();
23966
+ var NotDedented$0 = $TS($S($E(IndentedAtLeast), $E(_)), function($skip, $loc, $0, $1, $2) {
23967
+ const ws = [];
23968
+ if ($1)
23969
+ ws.push(...$1);
23970
+ if ($2)
23971
+ ws.push(...$2);
23972
+ return ws.flat(Infinity).filter(Boolean);
24081
23973
  });
24082
- function PopIndent(state) {
23974
+ function NotDedented(state) {
24083
23975
  let eventData;
24084
23976
  if (state.events) {
24085
- const result = state.events.enter?.("PopIndent", state);
23977
+ const result = state.events.enter?.("NotDedented", state);
24086
23978
  if (result) {
24087
23979
  if (result.cache)
24088
23980
  return result.cache;
@@ -24090,37 +23982,24 @@ ${input.slice(result.pos)}
24090
23982
  }
24091
23983
  }
24092
23984
  if (state.tokenize) {
24093
- const result = $TOKEN("PopIndent", state, PopIndent$0(state));
23985
+ const result = $TOKEN("NotDedented", state, NotDedented$0(state));
24094
23986
  if (state.events)
24095
- state.events.exit?.("PopIndent", state, result, eventData);
23987
+ state.events.exit?.("NotDedented", state, result, eventData);
24096
23988
  return result;
24097
23989
  } else {
24098
- const result = PopIndent$0(state);
23990
+ const result = NotDedented$0(state);
24099
23991
  if (state.events)
24100
- state.events.exit?.("PopIndent", state, result, eventData);
23992
+ state.events.exit?.("NotDedented", state, result, eventData);
24101
23993
  return result;
24102
23994
  }
24103
23995
  }
24104
- var Nested$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
24105
- var eos = $1;
24106
- var indent = $2;
24107
- const { level } = indent;
24108
- const currentIndent = module2.currentIndent;
24109
- if (module2.config.verbose) {
24110
- console.log("Indented", level, currentIndent);
24111
- }
24112
- if (level !== currentIndent.level) {
24113
- if (module2.config.verbose) {
24114
- console.log("skipped nested");
24115
- }
24116
- return $skip;
24117
- }
24118
- return $0;
23996
+ var Dedented$0 = $T($S($N(IndentedAtLeast), EOS), function(value) {
23997
+ return value[1];
24119
23998
  });
24120
- function Nested(state) {
23999
+ function Dedented(state) {
24121
24000
  let eventData;
24122
24001
  if (state.events) {
24123
- const result = state.events.enter?.("Nested", state);
24002
+ const result = state.events.enter?.("Dedented", state);
24124
24003
  if (result) {
24125
24004
  if (result.cache)
24126
24005
  return result.cache;
@@ -24128,14 +24007,14 @@ ${input.slice(result.pos)}
24128
24007
  }
24129
24008
  }
24130
24009
  if (state.tokenize) {
24131
- const result = $TOKEN("Nested", state, Nested$0(state));
24010
+ const result = $TOKEN("Dedented", state, Dedented$0(state));
24132
24011
  if (state.events)
24133
- state.events.exit?.("Nested", state, result, eventData);
24012
+ state.events.exit?.("Dedented", state, result, eventData);
24134
24013
  return result;
24135
24014
  } else {
24136
- const result = Nested$0(state);
24015
+ const result = Dedented$0(state);
24137
24016
  if (state.events)
24138
- state.events.exit?.("Nested", state, result, eventData);
24017
+ state.events.exit?.("Dedented", state, result, eventData);
24139
24018
  return result;
24140
24019
  }
24141
24020
  }
@@ -24613,7 +24492,7 @@ var parse;
24613
24492
  var uncacheable;
24614
24493
  ({ parse } = import_parser.default);
24615
24494
  ({ SourceMap: SourceMap2 } = util_exports);
24616
- 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"]);
24495
+ 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"]);
24617
24496
  var compile = function(src, options) {
24618
24497
  var ast, code, events, filename, ref, result, sm;
24619
24498
  if (!options) {