@danielx/civet 0.4.19-pre.6 → 0.4.19-pre.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -489,6 +489,8 @@ var Civet = (() => {
489
489
  FunctionExpression,
490
490
  ThinArrowFunction,
491
491
  Arrow,
492
+ ExplicitBlock,
493
+ ImplicitNestedBlock,
492
494
  Block,
493
495
  ThenClause,
494
496
  BracedOrEmptyBlock,
@@ -814,38 +816,38 @@ var Civet = (() => {
814
816
  Reset,
815
817
  Init,
816
818
  Indent,
817
- TrackIndent,
819
+ TrackIndented,
818
820
  Samedent,
819
821
  IndentedFurther,
820
822
  PushIndent,
821
823
  PopIndent,
822
824
  Nested
823
825
  });
824
- var $L0 = $L("");
825
- var $L1 = $L("++");
826
- var $L2 = $L("--");
827
- var $L3 = $L("=>");
828
- var $L4 = $L("<");
829
- var $L5 = $L("extends");
830
- var $L6 = $L("this");
831
- var $L7 = $L("#");
832
- var $L8 = $L(".");
833
- var $L9 = $L("super");
834
- var $L10 = $L("import");
835
- var $L11 = $L("!");
836
- var $L12 = $L("::");
837
- var $L13 = $L("super[");
838
- var $L14 = $L("import.meta");
839
- var $L15 = $L(")");
840
- var $L16 = $L("->");
841
- var $L17 = $L("null");
842
- var $L18 = $L("true");
843
- var $L19 = $L("false");
844
- var $L20 = $L("yes");
845
- var $L21 = $L("on");
846
- var $L22 = $L("no");
847
- var $L23 = $L("off");
848
- var $L24 = $L(",");
826
+ var $L0 = $L(",");
827
+ var $L1 = $L("");
828
+ var $L2 = $L("++");
829
+ var $L3 = $L("--");
830
+ var $L4 = $L("=>");
831
+ var $L5 = $L("<");
832
+ var $L6 = $L("extends");
833
+ var $L7 = $L("this");
834
+ var $L8 = $L("#");
835
+ var $L9 = $L(".");
836
+ var $L10 = $L("super");
837
+ var $L11 = $L("import");
838
+ var $L12 = $L("!");
839
+ var $L13 = $L("::");
840
+ var $L14 = $L("super[");
841
+ var $L15 = $L("import.meta");
842
+ var $L16 = $L(")");
843
+ var $L17 = $L("->");
844
+ var $L18 = $L("null");
845
+ var $L19 = $L("true");
846
+ var $L20 = $L("false");
847
+ var $L21 = $L("yes");
848
+ var $L22 = $L("on");
849
+ var $L23 = $L("no");
850
+ var $L24 = $L("off");
849
851
  var $L25 = $L("]");
850
852
  var $L26 = $L("}");
851
853
  var $L27 = $L("**=");
@@ -1099,11 +1101,7 @@ var Civet = (() => {
1099
1101
  return Arguments$0(state) || Arguments$1(state);
1100
1102
  }
1101
1103
  }
1102
- var ArgumentsWithTrailingCallExpressions$0 = $TS($S(TrackIndent, $C($S(Arguments, $Q($S($Y(EOS), Samedent, $N(Backtick), CallExpressionRest)), PopIndent), PopIndent)), function($skip, $loc, $0, $1, $2) {
1103
- if (!$2)
1104
- return $skip;
1105
- return $2;
1106
- });
1104
+ var ArgumentsWithTrailingCallExpressions$0 = $S(Arguments, $Q($S(Samedent, $N(Backtick), CallExpressionRest)));
1107
1105
  function ArgumentsWithTrailingCallExpressions(state) {
1108
1106
  if (state.verbose)
1109
1107
  console.log("ENTER:", "ArgumentsWithTrailingCallExpressions");
@@ -1113,9 +1111,7 @@ var Civet = (() => {
1113
1111
  return ArgumentsWithTrailingCallExpressions$0(state);
1114
1112
  }
1115
1113
  }
1116
- var ArgumentList$0 = $T($S($Y(EOS), NestedArgumentList), function(value) {
1117
- return value[1];
1118
- });
1114
+ var ArgumentList$0 = NestedArgumentList;
1119
1115
  var ArgumentList$1 = InlineArgumentExpressions;
1120
1116
  function ArgumentList(state) {
1121
1117
  if (state.tokenize) {
@@ -1149,7 +1145,7 @@ var Civet = (() => {
1149
1145
  return NestedArgument$0(state);
1150
1146
  }
1151
1147
  }
1152
- var InlineArgumentExpressions$0 = $TS($S(ArgumentPart, $Q($S(__, Comma, $Q(TrailingComment), ArgumentPart))), function($skip, $loc, $0, $1, $2) {
1148
+ var InlineArgumentExpressions$0 = $TS($S($Q(TrailingComment), ArgumentPart, $Q($S(__, Comma, $Q(TrailingComment), $C(NestedObjectLiteral, ArgumentList)))), function($skip, $loc, $0, $1, $2, $3) {
1153
1149
  if ($2.length == 0)
1154
1150
  return $1;
1155
1151
  return $0;
@@ -1178,28 +1174,28 @@ var Civet = (() => {
1178
1174
  }
1179
1175
  }
1180
1176
  var ImplicitApplication$0 = $S(ApplicationStart, ArgumentList, InsertCloseParen);
1177
+ var ImplicitApplication$1 = $S(IndentedApplicationAllowed, InsertOpenParen, NestedObjectLiteral, $Q($S(__, $EXPECT($L0, fail, 'ImplicitApplication ","'), NestedObjectLiteral)), InsertCloseParen);
1181
1178
  function ImplicitApplication(state) {
1182
- if (state.verbose)
1183
- console.log("ENTER:", "ImplicitApplication");
1184
1179
  if (state.tokenize) {
1185
- return $TOKEN("ImplicitApplication", state, ImplicitApplication$0(state));
1180
+ return $TOKEN("ImplicitApplication", state, ImplicitApplication$0(state) || ImplicitApplication$1(state));
1186
1181
  } else {
1187
- return ImplicitApplication$0(state);
1182
+ return ImplicitApplication$0(state) || ImplicitApplication$1(state);
1188
1183
  }
1189
1184
  }
1190
1185
  var ApplicationStart$0 = $TS($S($N(EOS), _, $N(AdditionalReservedWords)), function($skip, $loc, $0, $1, $2, $3) {
1191
1186
  var spacing = $2;
1192
1187
  return module.insertTrimmingSpace(spacing, "(");
1193
1188
  });
1194
- var ApplicationStart$1 = $S(IndentedApplicationAllowed, $Y($S(EOS, NestedPropertyDefinitions)), InsertOpenParen);
1195
1189
  function ApplicationStart(state) {
1190
+ if (state.verbose)
1191
+ console.log("ENTER:", "ApplicationStart");
1196
1192
  if (state.tokenize) {
1197
- return $TOKEN("ApplicationStart", state, ApplicationStart$0(state) || ApplicationStart$1(state));
1193
+ return $TOKEN("ApplicationStart", state, ApplicationStart$0(state));
1198
1194
  } else {
1199
- return ApplicationStart$0(state) || ApplicationStart$1(state);
1195
+ return ApplicationStart$0(state);
1200
1196
  }
1201
1197
  }
1202
- var IndentedApplicationAllowed$0 = $TV($EXPECT($L0, fail, 'IndentedApplicationAllowed ""'), function($skip, $loc, $0, $1) {
1198
+ var IndentedApplicationAllowed$0 = $TV($EXPECT($L1, fail, 'IndentedApplicationAllowed ""'), function($skip, $loc, $0, $1) {
1203
1199
  if (module.suppressIndentedApplication)
1204
1200
  return $skip;
1205
1201
  return;
@@ -1324,7 +1320,7 @@ var Civet = (() => {
1324
1320
  return UpdateExpression$0(state) || UpdateExpression$1(state);
1325
1321
  }
1326
1322
  }
1327
- var UpdateExpressionSymbol$0 = $TV($C($EXPECT($L1, fail, 'UpdateExpressionSymbol "++"'), $EXPECT($L2, fail, 'UpdateExpressionSymbol "--"')), function($skip, $loc, $0, $1) {
1323
+ var UpdateExpressionSymbol$0 = $TV($C($EXPECT($L2, fail, 'UpdateExpressionSymbol "++"'), $EXPECT($L3, fail, 'UpdateExpressionSymbol "--"')), function($skip, $loc, $0, $1) {
1328
1324
  return { $loc, token: $1 };
1329
1325
  });
1330
1326
  function UpdateExpressionSymbol(state) {
@@ -1486,7 +1482,7 @@ var Civet = (() => {
1486
1482
  return ArrowFunctionTail$0(state) || ArrowFunctionTail$1(state);
1487
1483
  }
1488
1484
  }
1489
- var FatArrow$0 = $TS($S(__, $EXPECT($L3, fail, 'FatArrow "=>"')), function($skip, $loc, $0, $1, $2) {
1485
+ var FatArrow$0 = $TS($S(__, $EXPECT($L4, fail, 'FatArrow "=>"')), function($skip, $loc, $0, $1, $2) {
1490
1486
  var ws = $1;
1491
1487
  if (!ws.length)
1492
1488
  return " =>";
@@ -1501,14 +1497,8 @@ var Civet = (() => {
1501
1497
  return FatArrow$0(state);
1502
1498
  }
1503
1499
  }
1504
- var FatArrowBody$0 = $T($S(__, OpenBrace, EOS, NestedBlockStatements, __, CloseBrace), function(value) {
1505
- var exps = value[3];
1506
- return { "type": "BlockStatement", "expressions": exps, "children": value };
1507
- });
1508
- var FatArrowBody$1 = $T($S(InsertOpenBrace, EOS, NestedBlockStatements, InsertNewline, InsertIndent, InsertCloseBrace), function(value) {
1509
- var exps = value[2];
1510
- return { "type": "BlockStatement", "expressions": exps, "children": value };
1511
- });
1500
+ var FatArrowBody$0 = ExplicitBlock;
1501
+ var FatArrowBody$1 = ImplicitNestedBlock;
1512
1502
  var FatArrowBody$2 = AssignmentExpression;
1513
1503
  var FatArrowBody$3 = EmptyBlock;
1514
1504
  function FatArrowBody(state) {
@@ -1636,10 +1626,10 @@ var Civet = (() => {
1636
1626
  return ClassHeritage$0(state);
1637
1627
  }
1638
1628
  }
1639
- var ExtendsToken$0 = $TV($EXPECT($L4, fail, 'ExtendsToken "<"'), function($skip, $loc, $0, $1) {
1629
+ var ExtendsToken$0 = $TV($EXPECT($L5, fail, 'ExtendsToken "<"'), function($skip, $loc, $0, $1) {
1640
1630
  return { $loc, token: "extends" };
1641
1631
  });
1642
- var ExtendsToken$1 = $TV($EXPECT($L5, fail, 'ExtendsToken "extends"'), function($skip, $loc, $0, $1) {
1632
+ var ExtendsToken$1 = $TV($EXPECT($L6, fail, 'ExtendsToken "extends"'), function($skip, $loc, $0, $1) {
1643
1633
  return { $loc, token: $1 };
1644
1634
  });
1645
1635
  function ExtendsToken(state) {
@@ -1649,8 +1639,8 @@ var Civet = (() => {
1649
1639
  return ExtendsToken$0(state) || ExtendsToken$1(state);
1650
1640
  }
1651
1641
  }
1652
- var ClassBody$0 = $S(__, OpenBrace, $E($S(EOS, NestedClassElements)), __, CloseBrace);
1653
- var ClassBody$1 = $S(InsertOpenBrace, EOS, NestedClassElements, InsertNewline, InsertIndent, InsertCloseBrace);
1642
+ var ClassBody$0 = $S(__, OpenBrace, $E(NestedClassElements), __, CloseBrace);
1643
+ var ClassBody$1 = $S(InsertOpenBrace, NestedClassElements, InsertNewline, InsertIndent, InsertCloseBrace);
1654
1644
  function ClassBody(state) {
1655
1645
  if (state.tokenize) {
1656
1646
  return $TOKEN("ClassBody", state, ClassBody$0(state) || ClassBody$1(state));
@@ -1721,10 +1711,10 @@ var Civet = (() => {
1721
1711
  return FieldDefinition$0(state) || FieldDefinition$1(state) || FieldDefinition$2(state);
1722
1712
  }
1723
1713
  }
1724
- var This$0 = $TV($EXPECT($L6, fail, 'This "this"'), function($skip, $loc, $0, $1) {
1714
+ var This$0 = $TV($EXPECT($L7, fail, 'This "this"'), function($skip, $loc, $0, $1) {
1725
1715
  return { $loc, token: $1 };
1726
1716
  });
1727
- var This$1 = $TS($S(At, $S($E($EXPECT($L7, fail, 'This "#"')), IdentifierName)), function($skip, $loc, $0, $1, $2) {
1717
+ var This$1 = $TS($S(At, $S($E($EXPECT($L8, fail, 'This "#"')), IdentifierName)), function($skip, $loc, $0, $1, $2) {
1728
1718
  $1.token = "this.";
1729
1719
  return $0;
1730
1720
  });
@@ -1739,7 +1729,7 @@ var Civet = (() => {
1739
1729
  return This$0(state) || This$1(state) || This$2(state);
1740
1730
  }
1741
1731
  }
1742
- var LeftHandSideExpression$0 = $TS($S($Q($S(New, $N($EXPECT($L8, fail, 'LeftHandSideExpression "."')), __)), CallExpression), function($skip, $loc, $0, $1, $2) {
1732
+ var LeftHandSideExpression$0 = $TS($S($Q($S(New, $N($EXPECT($L9, fail, 'LeftHandSideExpression "."')), __)), CallExpression), function($skip, $loc, $0, $1, $2) {
1743
1733
  if ($1.length)
1744
1734
  return $0;
1745
1735
  return $2;
@@ -1753,8 +1743,8 @@ var Civet = (() => {
1753
1743
  return LeftHandSideExpression$0(state);
1754
1744
  }
1755
1745
  }
1756
- var CallExpression$0 = $S($EXPECT($L9, fail, 'CallExpression "super"'), ArgumentsWithTrailingCallExpressions);
1757
- var CallExpression$1 = $S($EXPECT($L10, fail, 'CallExpression "import"'), __, OpenParen, ExtendedExpression, __, CloseParen);
1746
+ var CallExpression$0 = $S($EXPECT($L10, fail, 'CallExpression "super"'), ArgumentsWithTrailingCallExpressions);
1747
+ var CallExpression$1 = $S($EXPECT($L11, fail, 'CallExpression "import"'), __, OpenParen, ExtendedExpression, __, CloseParen);
1758
1748
  var CallExpression$2 = $TS($S(MemberExpression, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2) {
1759
1749
  if ($2.length)
1760
1750
  return $0;
@@ -1787,7 +1777,7 @@ var Civet = (() => {
1787
1777
  return OptionalShorthand$0(state);
1788
1778
  }
1789
1779
  }
1790
- var NonNullAssertion$0 = $T($EXPECT($L11, fail, 'NonNullAssertion "!"'), function(value) {
1780
+ var NonNullAssertion$0 = $T($EXPECT($L12, fail, 'NonNullAssertion "!"'), function(value) {
1791
1781
  return { "ts": true, "children": value };
1792
1782
  });
1793
1783
  function NonNullAssertion(state) {
@@ -1837,7 +1827,7 @@ var Civet = (() => {
1837
1827
  $2.children.unshift($1[1]);
1838
1828
  return $2;
1839
1829
  });
1840
- var MemberExpressionRest$2 = $TS($S($E($S($Y(EOS), IndentedFurther)), $EXPECT($L12, fail, 'MemberExpressionRest "::"'), $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
1830
+ var MemberExpressionRest$2 = $TS($S($E($S($Y(EOS), IndentedFurther)), $EXPECT($L13, fail, 'MemberExpressionRest "::"'), $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
1841
1831
  var id = $3;
1842
1832
  if (id)
1843
1833
  return [".prototype.", id];
@@ -1911,7 +1901,7 @@ var Civet = (() => {
1911
1901
  return PropertyAccess$0(state);
1912
1902
  }
1913
1903
  }
1914
- var SuperProperty$0 = $S($EXPECT($L13, fail, 'SuperProperty "super["'), ExtendedExpression, __, CloseBracket);
1904
+ var SuperProperty$0 = $S($EXPECT($L14, fail, 'SuperProperty "super["'), ExtendedExpression, __, CloseBracket);
1915
1905
  function SuperProperty(state) {
1916
1906
  if (state.verbose)
1917
1907
  console.log("ENTER:", "SuperProperty");
@@ -1922,7 +1912,7 @@ var Civet = (() => {
1922
1912
  }
1923
1913
  }
1924
1914
  var MetaProperty$0 = $S(New, Dot, Target);
1925
- var MetaProperty$1 = $TV($EXPECT($L14, fail, 'MetaProperty "import.meta"'), function($skip, $loc, $0, $1) {
1915
+ var MetaProperty$1 = $TV($EXPECT($L15, fail, 'MetaProperty "import.meta"'), function($skip, $loc, $0, $1) {
1926
1916
  return { $loc, token: $1 };
1927
1917
  });
1928
1918
  function MetaProperty(state) {
@@ -1933,7 +1923,7 @@ var Civet = (() => {
1933
1923
  }
1934
1924
  }
1935
1925
  var Parameters$0 = NonEmptyParameters;
1936
- var Parameters$1 = $TV($EXPECT($L0, fail, 'Parameters ""'), function($skip, $loc, $0, $1) {
1926
+ var Parameters$1 = $TV($EXPECT($L1, fail, 'Parameters ""'), function($skip, $loc, $0, $1) {
1937
1927
  return {
1938
1928
  type: "Parameters",
1939
1929
  children: [{ $loc, token: "()" }],
@@ -1990,7 +1980,7 @@ var Civet = (() => {
1990
1980
  }
1991
1981
  }
1992
1982
  var ParameterElementDelimiter$0 = $S($Q(_), Comma);
1993
- var ParameterElementDelimiter$1 = $Y($S(__, $EXPECT($L15, fail, 'ParameterElementDelimiter ")"')));
1983
+ var ParameterElementDelimiter$1 = $Y($S(__, $EXPECT($L16, fail, 'ParameterElementDelimiter ")"')));
1994
1984
  var ParameterElementDelimiter$2 = $TV($Y(EOS), function($skip, $loc, $0, $1) {
1995
1985
  return { $loc, token: "," };
1996
1986
  });
@@ -2046,9 +2036,7 @@ var Civet = (() => {
2046
2036
  return ObjectBindingPattern$0(state);
2047
2037
  }
2048
2038
  }
2049
- var ObjectBindingPatternContent$0 = $T($S($Y(EOS), NestedBindingProperties), function(value) {
2050
- return value[1];
2051
- });
2039
+ var ObjectBindingPatternContent$0 = NestedBindingProperties;
2052
2040
  var ObjectBindingPatternContent$1 = $TS($S($Q(BindingProperty), $E($S(__, BindingRestProperty))), function($skip, $loc, $0, $1, $2) {
2053
2041
  var props = $1;
2054
2042
  var rest = $2;
@@ -2087,9 +2075,7 @@ var Civet = (() => {
2087
2075
  return ArrayBindingPattern$0(state);
2088
2076
  }
2089
2077
  }
2090
- var ArrayBindingPatternContent$0 = $T($S($Y(EOS), NestedBindingElements), function(value) {
2091
- return value[1];
2092
- });
2078
+ var ArrayBindingPatternContent$0 = NestedBindingElements;
2093
2079
  var ArrayBindingPatternContent$1 = $TS($S($Q($C(BindingElement, Elision)), $E($S(__, BindingRestElement))), function($skip, $loc, $0, $1, $2) {
2094
2080
  var props = $1;
2095
2081
  var rest = $2;
@@ -2392,7 +2378,7 @@ var Civet = (() => {
2392
2378
  return ThinArrowFunction$0(state);
2393
2379
  }
2394
2380
  }
2395
- var Arrow$0 = $TV($EXPECT($L16, fail, 'Arrow "->"'), function($skip, $loc, $0, $1) {
2381
+ var Arrow$0 = $TV($EXPECT($L17, fail, 'Arrow "->"'), function($skip, $loc, $0, $1) {
2396
2382
  return { $loc, token: $1 };
2397
2383
  });
2398
2384
  function Arrow(state) {
@@ -2404,16 +2390,52 @@ var Civet = (() => {
2404
2390
  return Arrow$0(state);
2405
2391
  }
2406
2392
  }
2407
- var Block$0 = $T($S(__, OpenBrace, EOS, NestedBlockStatements, __, CloseBrace), function(value) {
2408
- var exps = value[3];
2409
- return { "type": "BlockStatement", "expressions": exps, "children": value };
2393
+ var ExplicitBlock$0 = $TS($S(__, OpenBrace, NestedBlockStatements, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
2394
+ var block = $3;
2395
+ block.bare = false;
2396
+ block.children.unshift($1, $2);
2397
+ block.children.push($4, $5);
2398
+ return block;
2410
2399
  });
2411
- var Block$1 = $T($S(InsertOpenBrace, EOS, NestedBlockStatements, InsertNewline, InsertIndent, InsertCloseBrace), function(value) {
2412
- var exps = value[2];
2413
- return { "type": "BlockStatement", "expressions": exps, "children": value };
2400
+ function ExplicitBlock(state) {
2401
+ if (state.verbose)
2402
+ console.log("ENTER:", "ExplicitBlock");
2403
+ if (state.tokenize) {
2404
+ return $TOKEN("ExplicitBlock", state, ExplicitBlock$0(state));
2405
+ } else {
2406
+ return ExplicitBlock$0(state);
2407
+ }
2408
+ }
2409
+ var ImplicitNestedBlock$0 = $TS($S(InsertOpenBrace, NestedBlockStatements, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
2410
+ var block = $2;
2411
+ block.bare = false;
2412
+ block.children.unshift($1);
2413
+ block.children.push($3, $4, $5);
2414
+ return block;
2414
2415
  });
2416
+ function ImplicitNestedBlock(state) {
2417
+ if (state.verbose)
2418
+ console.log("ENTER:", "ImplicitNestedBlock");
2419
+ if (state.tokenize) {
2420
+ return $TOKEN("ImplicitNestedBlock", state, ImplicitNestedBlock$0(state));
2421
+ } else {
2422
+ return ImplicitNestedBlock$0(state);
2423
+ }
2424
+ }
2425
+ var Block$0 = ExplicitBlock;
2426
+ var Block$1 = ImplicitNestedBlock;
2415
2427
  var Block$2 = ThenClause;
2416
- var Block$3 = $S($Q(TrailingComment), Statement);
2428
+ var Block$3 = $TS($S($Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2) {
2429
+ var ws = $1;
2430
+ var s = $2;
2431
+ const expressions = [$0];
2432
+ return {
2433
+ type: "BlockStatement",
2434
+ expressions,
2435
+ children: [expressions],
2436
+ bare: true
2437
+ };
2438
+ });
2417
2439
  function Block(state) {
2418
2440
  if (state.tokenize) {
2419
2441
  return $TOKEN("Block", state, Block$0(state) || Block$1(state) || Block$2(state) || Block$3(state));
@@ -2421,8 +2443,16 @@ var Civet = (() => {
2421
2443
  return Block$0(state) || Block$1(state) || Block$2(state) || Block$3(state);
2422
2444
  }
2423
2445
  }
2424
- var ThenClause$0 = $T($S(Then, $Q(TrailingComment), Statement), function(value) {
2425
- return [value[1], value[2]];
2446
+ var ThenClause$0 = $TS($S(Then, $Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2, $3) {
2447
+ var ws = $2;
2448
+ var s = $3;
2449
+ const expressions = [[ws, s]];
2450
+ return {
2451
+ type: "BlockStatement",
2452
+ expressions,
2453
+ children: [expressions],
2454
+ bare: true
2455
+ };
2426
2456
  });
2427
2457
  function ThenClause(state) {
2428
2458
  if (state.verbose)
@@ -2443,7 +2473,7 @@ var Civet = (() => {
2443
2473
  }
2444
2474
  }
2445
2475
  var EmptyBlock$0 = $T($S(InsertOpenBrace, InsertCloseBrace), function(value) {
2446
- return { "type": "BlockStatement", "expressions": [], "children": value };
2476
+ return { "type": "BlockStatement", "expressions": [], "children": value, "bare": false };
2447
2477
  });
2448
2478
  function EmptyBlock(state) {
2449
2479
  if (state.verbose)
@@ -2454,14 +2484,14 @@ var Civet = (() => {
2454
2484
  return EmptyBlock$0(state);
2455
2485
  }
2456
2486
  }
2457
- var BracedBlock$0 = $T($S($Q(TrailingComment), OpenBrace, BracedContent, __, CloseBrace), function(value) {
2458
- var exps = value[2];
2459
- return { "type": "BlockStatement", "expressions": exps, "children": value };
2460
- });
2461
- var BracedBlock$1 = $T($S(InsertOpenBrace, EOS, NestedBlockStatements, InsertNewline, InsertIndent, InsertCloseBrace), function(value) {
2462
- var exps = value[2];
2463
- return { "type": "BlockStatement", "expressions": exps, "children": value };
2487
+ var BracedBlock$0 = $TS($S($Q(TrailingComment), OpenBrace, BracedContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
2488
+ var block = $3;
2489
+ block.bare = false;
2490
+ block.children.unshift($1, $2);
2491
+ block.children.push($4, $5);
2492
+ return block;
2464
2493
  });
2494
+ var BracedBlock$1 = ImplicitNestedBlock;
2465
2495
  var BracedBlock$2 = $TS($S(InsertOpenBrace, $Y(EOS), ObjectLiteral, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
2466
2496
  var s = $3;
2467
2497
  $0.splice(1, 1);
@@ -2471,8 +2501,8 @@ var Civet = (() => {
2471
2501
  children: $0
2472
2502
  };
2473
2503
  });
2474
- var BracedBlock$3 = $TS($S(InsertOpenBrace, $N(EOS), __, Statement, InsertSpace, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2475
- var s = $4;
2504
+ var BracedBlock$3 = $TS($S(InsertOpenBrace, $N(EOS), $S(__, Statement), InsertSpace, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
2505
+ var s = $3;
2476
2506
  $0.splice(1, 1);
2477
2507
  return {
2478
2508
  type: "BlockStatement",
@@ -2487,10 +2517,16 @@ var Civet = (() => {
2487
2517
  return BracedBlock$0(state) || BracedBlock$1(state) || BracedBlock$2(state) || BracedBlock$3(state);
2488
2518
  }
2489
2519
  }
2490
- var BracedContent$0 = $T($S($Y(EOS), NestedBlockStatements), function(value) {
2491
- return value[1];
2520
+ var BracedContent$0 = NestedBlockStatements;
2521
+ var BracedContent$1 = $TS($S($Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2) {
2522
+ const expressions = [["", $2]];
2523
+ return {
2524
+ type: "BlockStatement",
2525
+ expressions,
2526
+ children: [$1, expressions],
2527
+ bare: true
2528
+ };
2492
2529
  });
2493
- var BracedContent$1 = $S($Q(TrailingComment), Statement);
2494
2530
  function BracedContent(state) {
2495
2531
  if (state.tokenize) {
2496
2532
  return $TOKEN("BracedContent", state, BracedContent$0(state) || BracedContent$1(state));
@@ -2502,7 +2538,16 @@ var Civet = (() => {
2502
2538
  var statements = $2;
2503
2539
  if (!statements.length)
2504
2540
  return $skip;
2505
- return statements;
2541
+ const first = statements[0];
2542
+ const ws = first[0];
2543
+ const indent = ws.pop();
2544
+ first[0] = indent;
2545
+ return {
2546
+ type: "BlockStatement",
2547
+ expressions: statements,
2548
+ children: [ws, statements],
2549
+ bare: true
2550
+ };
2506
2551
  });
2507
2552
  function NestedBlockStatements(state) {
2508
2553
  if (state.verbose)
@@ -2550,7 +2595,7 @@ var Civet = (() => {
2550
2595
  return LiteralContent$0(state) || LiteralContent$1(state) || LiteralContent$2(state) || LiteralContent$3(state);
2551
2596
  }
2552
2597
  }
2553
- var NullLiteral$0 = $TV($EXPECT($L17, fail, 'NullLiteral "null"'), function($skip, $loc, $0, $1) {
2598
+ var NullLiteral$0 = $TV($EXPECT($L18, fail, 'NullLiteral "null"'), function($skip, $loc, $0, $1) {
2554
2599
  return { $loc, token: $1 };
2555
2600
  });
2556
2601
  function NullLiteral(state) {
@@ -2565,7 +2610,7 @@ var Civet = (() => {
2565
2610
  var BooleanLiteral$0 = $T($S(CoffeeBooleansEnabled, CoffeeScriptBooleanLiteral), function(value) {
2566
2611
  return value[1];
2567
2612
  });
2568
- var BooleanLiteral$1 = $TS($S($C($EXPECT($L18, fail, 'BooleanLiteral "true"'), $EXPECT($L19, fail, 'BooleanLiteral "false"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2613
+ var BooleanLiteral$1 = $TS($S($C($EXPECT($L19, fail, 'BooleanLiteral "true"'), $EXPECT($L20, fail, 'BooleanLiteral "false"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2569
2614
  return { $loc, token: $1 };
2570
2615
  });
2571
2616
  function BooleanLiteral(state) {
@@ -2575,10 +2620,10 @@ var Civet = (() => {
2575
2620
  return BooleanLiteral$0(state) || BooleanLiteral$1(state);
2576
2621
  }
2577
2622
  }
2578
- var CoffeeScriptBooleanLiteral$0 = $TS($S($C($EXPECT($L20, fail, 'CoffeeScriptBooleanLiteral "yes"'), $EXPECT($L21, fail, 'CoffeeScriptBooleanLiteral "on"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2623
+ var CoffeeScriptBooleanLiteral$0 = $TS($S($C($EXPECT($L21, fail, 'CoffeeScriptBooleanLiteral "yes"'), $EXPECT($L22, fail, 'CoffeeScriptBooleanLiteral "on"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2579
2624
  return { $loc, token: "true" };
2580
2625
  });
2581
- var CoffeeScriptBooleanLiteral$1 = $TS($S($C($EXPECT($L22, fail, 'CoffeeScriptBooleanLiteral "no"'), $EXPECT($L23, fail, 'CoffeeScriptBooleanLiteral "off"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2626
+ var CoffeeScriptBooleanLiteral$1 = $TS($S($C($EXPECT($L23, fail, 'CoffeeScriptBooleanLiteral "no"'), $EXPECT($L24, fail, 'CoffeeScriptBooleanLiteral "off"')), NonIdContinue), function($skip, $loc, $0, $1, $2) {
2582
2627
  return { $loc, token: "false" };
2583
2628
  });
2584
2629
  function CoffeeScriptBooleanLiteral(state) {
@@ -2588,7 +2633,7 @@ var Civet = (() => {
2588
2633
  return CoffeeScriptBooleanLiteral$0(state) || CoffeeScriptBooleanLiteral$1(state);
2589
2634
  }
2590
2635
  }
2591
- var Comma$0 = $TV($EXPECT($L24, fail, 'Comma ","'), function($skip, $loc, $0, $1) {
2636
+ var Comma$0 = $TV($EXPECT($L0, fail, 'Comma ","'), function($skip, $loc, $0, $1) {
2592
2637
  return { $loc, token: $1 };
2593
2638
  });
2594
2639
  function Comma(state) {
@@ -2886,9 +2931,7 @@ var Civet = (() => {
2886
2931
  return BracedObjectLiteral$0(state);
2887
2932
  }
2888
2933
  }
2889
- var BracedObjectLiteralContent$0 = $T($S($Y(EOS), NestedPropertyDefinitions), function(value) {
2890
- return value[1];
2891
- });
2934
+ var BracedObjectLiteralContent$0 = NestedPropertyDefinitions;
2892
2935
  var BracedObjectLiteralContent$1 = $TS($S(__, PropertyDefinitionList, $E($S(__, Comma))), function($skip, $loc, $0, $1, $2, $3) {
2893
2936
  if ($1.length) {
2894
2937
  $2.splice(0, 0, ...$1);
@@ -2905,12 +2948,12 @@ var Civet = (() => {
2905
2948
  return BracedObjectLiteralContent$0(state) || BracedObjectLiteralContent$1(state);
2906
2949
  }
2907
2950
  }
2908
- var NestedObjectLiteral$0 = $TS($S(InsertOpenBrace, $Y(EOS), NestedPropertyDefinitions, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
2909
- $3.unshift($1);
2910
- $3.push($4, $5, $6);
2951
+ var NestedObjectLiteral$0 = $TS($S(InsertOpenBrace, NestedPropertyDefinitions, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
2952
+ $2.unshift($1);
2953
+ $2.push($3, $4, $5);
2911
2954
  return {
2912
2955
  type: "ObjectExpression",
2913
- children: $3
2956
+ children: $2
2914
2957
  };
2915
2958
  });
2916
2959
  function NestedObjectLiteral(state) {
@@ -3132,7 +3175,7 @@ var Civet = (() => {
3132
3175
  return ClassElementName$0(state) || ClassElementName$1(state);
3133
3176
  }
3134
3177
  }
3135
- var PrivateIdentifier$0 = $TV($TEXT($S($EXPECT($L7, fail, 'PrivateIdentifier "#"'), IdentifierName)), function($skip, $loc, $0, $1) {
3178
+ var PrivateIdentifier$0 = $TV($TEXT($S($EXPECT($L8, fail, 'PrivateIdentifier "#"'), IdentifierName)), function($skip, $loc, $0, $1) {
3136
3179
  return {
3137
3180
  type: "Identifier",
3138
3181
  name: $0,
@@ -3213,7 +3256,7 @@ var Civet = (() => {
3213
3256
  var BinaryOpSymbol$6 = $EXPECT($L50, fail, 'BinaryOpSymbol "<="');
3214
3257
  var BinaryOpSymbol$7 = $EXPECT($L51, fail, 'BinaryOpSymbol ">="');
3215
3258
  var BinaryOpSymbol$8 = $EXPECT($L52, fail, 'BinaryOpSymbol "<<"');
3216
- var BinaryOpSymbol$9 = $EXPECT($L4, fail, 'BinaryOpSymbol "<"');
3259
+ var BinaryOpSymbol$9 = $EXPECT($L5, fail, 'BinaryOpSymbol "<"');
3217
3260
  var BinaryOpSymbol$10 = $EXPECT($L53, fail, 'BinaryOpSymbol ">>>"');
3218
3261
  var BinaryOpSymbol$11 = $EXPECT($L54, fail, 'BinaryOpSymbol ">>"');
3219
3262
  var BinaryOpSymbol$12 = $EXPECT($L55, fail, 'BinaryOpSymbol ">"');
@@ -3357,9 +3400,8 @@ var Civet = (() => {
3357
3400
  return EmptyStatement$0(state);
3358
3401
  }
3359
3402
  }
3360
- var BlockStatement$0 = $T($S(__, OpenBrace, EOS, NestedBlockStatements, __, CloseBrace, $N($S(__, $EXPECT($L43, fail, 'BlockStatement "="')))), function(value) {
3361
- var exps = value[3];
3362
- return { "type": "BlockStatement", "children": value, "expressions": exps };
3403
+ var BlockStatement$0 = $T($S(ExplicitBlock, $N($S(__, $EXPECT($L43, fail, 'BlockStatement "="')))), function(value) {
3404
+ return value[0];
3363
3405
  });
3364
3406
  function BlockStatement(state) {
3365
3407
  if (state.verbose)
@@ -3461,8 +3503,8 @@ var Civet = (() => {
3461
3503
  return UnlessExpression$0(state);
3462
3504
  }
3463
3505
  }
3464
- var ExpressionBlock$0 = $TS($S(InsertOpenParen, EOS, NestedBlockExpressions, InsertNewline, InsertIndent, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
3465
- var exps = $3;
3506
+ var ExpressionBlock$0 = $TS($S(InsertOpenParen, NestedBlockExpressions, InsertNewline, InsertIndent, InsertCloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
3507
+ var exps = $2;
3466
3508
  exps[exps.length - 1].pop();
3467
3509
  return {
3468
3510
  type: "BlockExpressions",
@@ -3654,7 +3696,7 @@ var Civet = (() => {
3654
3696
  });
3655
3697
  var ForStatementControl$1 = $TS($S(CoffeeForLoopsEnabled, CoffeeForStatementParameters, $E(WhenCondition)), function($skip, $loc, $0, $1, $2, $3) {
3656
3698
  if ($3) {
3657
- const indent = "".padStart((module.currentIndent + 1) * 2);
3699
+ const indent = module.currentIndent.token + " ";
3658
3700
  module.insertTrimmingSpace($3, "");
3659
3701
  $2.blockPrefix.push([indent, {
3660
3702
  type: "IfStatement",
@@ -3692,7 +3734,7 @@ var Civet = (() => {
3692
3734
  var step = $8;
3693
3735
  var close = $9;
3694
3736
  let blockPrefix = [];
3695
- const indent = "".padStart((module.currentIndent + 1) * 2);
3737
+ const indent = module.currentIndent.token + " ";
3696
3738
  if (kind.token === "from") {
3697
3739
  if (step) {
3698
3740
  throw new Error("Can't use 'by' with 'from' in CoffeeScript for loops");
@@ -3705,7 +3747,7 @@ var Civet = (() => {
3705
3747
  module.insertTrimmingSpace(declaration, "");
3706
3748
  module.insertTrimmingSpace(exp, "");
3707
3749
  if (declaration.own) {
3708
- const indent2 = "".padStart((module.currentIndent + 1) * 2);
3750
+ const indent2 = module.currentIndent.token + " ";
3709
3751
  const hasPropRef = module.getHasPropRef();
3710
3752
  blockPrefix.push([indent2, "if (!", hasPropRef, ".call(", exp, ", ", declaration, ")) continue\n"]);
3711
3753
  }
@@ -4019,18 +4061,16 @@ var Civet = (() => {
4019
4061
  return SwitchExpression$0(state);
4020
4062
  }
4021
4063
  }
4022
- var CaseBlock$0 = $TS($S(__, OpenBrace, $Y(EOS), NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
4023
- var clauses = $4;
4024
- $0.splice(2, 1);
4064
+ var CaseBlock$0 = $TS($S(__, OpenBrace, NestedCaseClauses, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
4065
+ var clauses = $3;
4025
4066
  return {
4026
4067
  type: "CaseBlock",
4027
4068
  clauses,
4028
4069
  children: $0
4029
4070
  };
4030
4071
  });
4031
- var CaseBlock$1 = $TS($S($Y(EOS), InsertOpenBrace, NestedCaseClauses, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
4032
- var clauses = $3;
4033
- $0.shift();
4072
+ var CaseBlock$1 = $TS($S(InsertOpenBrace, NestedCaseClauses, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
4073
+ var clauses = $2;
4034
4074
  return {
4035
4075
  type: "CaseBlock",
4036
4076
  clauses,
@@ -4077,21 +4117,37 @@ var Civet = (() => {
4077
4117
  var expressions = value[2];
4078
4118
  return { "type": "CaseClause", "cases": cases, "expressions": expressions, "children": value };
4079
4119
  });
4080
- var CaseClause$1 = $T($S(When, CaseExpressionList, $C(ThenClause, NestedBlockStatements), InsertBreak), function(value) {
4081
- var cases = value[1];
4082
- var expressions = value[2];
4083
- return { "type": "WhenClause", "cases": cases, "expressions": expressions, "children": value };
4120
+ var CaseClause$1 = $TS($S(When, CaseExpressionList, $C(ThenClause, NestedBlockStatements), InsertBreak), function($skip, $loc, $0, $1, $2, $3, $4) {
4121
+ var cases = $2;
4122
+ var expressions = $3;
4123
+ if (expressions.expressions) {
4124
+ expressions = expressions.expressions;
4125
+ }
4126
+ return {
4127
+ type: "WhenClause",
4128
+ cases,
4129
+ expressions,
4130
+ children: $0
4131
+ };
4084
4132
  });
4085
- var CaseClause$2 = $T($S(Default, ImpliedColon, $C(NestedBlockStatements, NoExpressions)), function(value) {
4086
- var exps = value[2];
4087
- return { "type": "DefaultClause", "expressions": exps, "children": value };
4133
+ var CaseClause$2 = $TS($S(Default, ImpliedColon, $C(NestedBlockStatements, NoExpressions)), function($skip, $loc, $0, $1, $2, $3) {
4134
+ var expressions = $3;
4135
+ if (expressions.expressions)
4136
+ expressions = expressions.expressions;
4137
+ return {
4138
+ type: "DefaultClause",
4139
+ expressions,
4140
+ children: $0
4141
+ };
4088
4142
  });
4089
4143
  var CaseClause$3 = $TS($S(Else, ImpliedColon, $C(NestedBlockStatements, $S($Q(TrailingComment), Statement))), function($skip, $loc, $0, $1, $2, $3) {
4090
- var exps = $3;
4144
+ var expressions = $3;
4091
4145
  $1.token = "default";
4146
+ if (expressions.expressions)
4147
+ expressions = expressions.expressions;
4092
4148
  return {
4093
4149
  type: "DefaultClause",
4094
- expressions: exps,
4150
+ expressions,
4095
4151
  children: $0
4096
4152
  };
4097
4153
  });
@@ -4121,7 +4177,7 @@ var Civet = (() => {
4121
4177
  return CaseExpressionList$0(state);
4122
4178
  }
4123
4179
  }
4124
- var NoExpressions$0 = $T($EXPECT($L0, fail, 'NoExpressions ""'), function(value) {
4180
+ var NoExpressions$0 = $T($EXPECT($L1, fail, 'NoExpressions ""'), function(value) {
4125
4181
  return [];
4126
4182
  });
4127
4183
  function NoExpressions(state) {
@@ -4134,7 +4190,7 @@ var Civet = (() => {
4134
4190
  }
4135
4191
  }
4136
4192
  var ImpliedColon$0 = $S(__, Colon);
4137
- var ImpliedColon$1 = $TV($EXPECT($L0, fail, 'ImpliedColon ""'), function($skip, $loc, $0, $1) {
4193
+ var ImpliedColon$1 = $TV($EXPECT($L1, fail, 'ImpliedColon ""'), function($skip, $loc, $0, $1) {
4138
4194
  return { $loc, token: ":" };
4139
4195
  });
4140
4196
  function ImpliedColon(state) {
@@ -4243,7 +4299,7 @@ var Civet = (() => {
4243
4299
  return ExpressionWithIndentedApplicationSuppressed$0(state);
4244
4300
  }
4245
4301
  }
4246
- var SuppressIndentedApplication$0 = $TV($EXPECT($L0, fail, 'SuppressIndentedApplication ""'), function($skip, $loc, $0, $1) {
4302
+ var SuppressIndentedApplication$0 = $TV($EXPECT($L1, fail, 'SuppressIndentedApplication ""'), function($skip, $loc, $0, $1) {
4247
4303
  module.suppressIndentedApplication = true;
4248
4304
  });
4249
4305
  function SuppressIndentedApplication(state) {
@@ -4353,7 +4409,7 @@ var Civet = (() => {
4353
4409
  return ImportDeclaration$0(state) || ImportDeclaration$1(state) || ImportDeclaration$2(state) || ImportDeclaration$3(state);
4354
4410
  }
4355
4411
  }
4356
- var ImpliedImport$0 = $TV($EXPECT($L0, fail, 'ImpliedImport ""'), function($skip, $loc, $0, $1) {
4412
+ var ImpliedImport$0 = $TV($EXPECT($L1, fail, 'ImpliedImport ""'), function($skip, $loc, $0, $1) {
4357
4413
  return { $loc, token: "import " };
4358
4414
  });
4359
4415
  function ImpliedImport(state) {
@@ -5211,7 +5267,7 @@ var Civet = (() => {
5211
5267
  return NonIdContinue$0(state);
5212
5268
  }
5213
5269
  }
5214
- var Loc$0 = $TV($EXPECT($L0, fail, 'Loc ""'), function($skip, $loc, $0, $1) {
5270
+ var Loc$0 = $TV($EXPECT($L1, fail, 'Loc ""'), function($skip, $loc, $0, $1) {
5215
5271
  return { $loc, token: "" };
5216
5272
  });
5217
5273
  function Loc(state) {
@@ -5367,7 +5423,7 @@ var Civet = (() => {
5367
5423
  return CloseBracket$0(state);
5368
5424
  }
5369
5425
  }
5370
- var CloseParen$0 = $TV($EXPECT($L15, fail, 'CloseParen ")"'), function($skip, $loc, $0, $1) {
5426
+ var CloseParen$0 = $TV($EXPECT($L16, fail, 'CloseParen ")"'), function($skip, $loc, $0, $1) {
5371
5427
  return { $loc, token: $1 };
5372
5428
  });
5373
5429
  function CloseParen(state) {
@@ -5451,7 +5507,7 @@ var Civet = (() => {
5451
5507
  return Do$0(state);
5452
5508
  }
5453
5509
  }
5454
- var Dot$0 = $TV($EXPECT($L8, fail, 'Dot "."'), function($skip, $loc, $0, $1) {
5510
+ var Dot$0 = $TV($EXPECT($L9, fail, 'Dot "."'), function($skip, $loc, $0, $1) {
5455
5511
  return { $loc, token: $1 };
5456
5512
  });
5457
5513
  function Dot(state) {
@@ -5595,7 +5651,7 @@ var Civet = (() => {
5595
5651
  return If$0(state);
5596
5652
  }
5597
5653
  }
5598
- var Import$0 = $TS($S($EXPECT($L10, fail, 'Import "import"'), $Y($EXPECT($R36, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
5654
+ var Import$0 = $TS($S($EXPECT($L11, fail, 'Import "import"'), $Y($EXPECT($R36, fail, "Import /\\s/"))), function($skip, $loc, $0, $1, $2) {
5599
5655
  return { $loc, token: $1 };
5600
5656
  });
5601
5657
  function Import(state) {
@@ -6006,7 +6062,7 @@ var Civet = (() => {
6006
6062
  return JSXElement$0(state) || JSXElement$1(state);
6007
6063
  }
6008
6064
  }
6009
- var JSXSelfClosingElement$0 = $S($EXPECT($L4, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L140, fail, 'JSXSelfClosingElement "/>"'));
6065
+ var JSXSelfClosingElement$0 = $S($EXPECT($L5, fail, 'JSXSelfClosingElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L140, fail, 'JSXSelfClosingElement "/>"'));
6010
6066
  function JSXSelfClosingElement(state) {
6011
6067
  if (state.verbose)
6012
6068
  console.log("ENTER:", "JSXSelfClosingElement");
@@ -6016,7 +6072,7 @@ var Civet = (() => {
6016
6072
  return JSXSelfClosingElement$0(state);
6017
6073
  }
6018
6074
  }
6019
- var JSXOpeningElement$0 = $S($EXPECT($L4, fail, 'JSXOpeningElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L55, fail, 'JSXOpeningElement ">"'));
6075
+ var JSXOpeningElement$0 = $S($EXPECT($L5, fail, 'JSXOpeningElement "<"'), $TEXT(JSXElementName), $E(JSXAttributes), __, $EXPECT($L55, fail, 'JSXOpeningElement ">"'));
6020
6076
  function JSXOpeningElement(state) {
6021
6077
  if (state.verbose)
6022
6078
  console.log("ENTER:", "JSXOpeningElement");
@@ -6220,9 +6276,9 @@ var Civet = (() => {
6220
6276
  return Namespace$0(state);
6221
6277
  }
6222
6278
  }
6223
- var InterfaceBlock$0 = $S(__, OpenBrace, EOS, NestedInterfaceProperties, __, CloseBrace);
6279
+ var InterfaceBlock$0 = $S(__, OpenBrace, NestedInterfaceProperties, __, CloseBrace);
6224
6280
  var InterfaceBlock$1 = $S(__, OpenBrace, $Q($S(__, InterfaceProperty)), __, CloseBrace);
6225
- var InterfaceBlock$2 = $S(InsertOpenBrace, EOS, NestedInterfaceProperties, InsertNewline, InsertIndent, InsertCloseBrace);
6281
+ var InterfaceBlock$2 = $S(InsertOpenBrace, NestedInterfaceProperties, InsertNewline, InsertIndent, InsertCloseBrace);
6226
6282
  function InterfaceBlock(state) {
6227
6283
  if (state.tokenize) {
6228
6284
  return $TOKEN("InterfaceBlock", state, InterfaceBlock$0(state) || InterfaceBlock$1(state) || InterfaceBlock$2(state));
@@ -6275,9 +6331,9 @@ var Civet = (() => {
6275
6331
  return InterfacePropertyDelimiter$0(state) || InterfacePropertyDelimiter$1(state) || InterfacePropertyDelimiter$2(state);
6276
6332
  }
6277
6333
  }
6278
- var NamespaceBlock$0 = $S(__, OpenBrace, EOS, NestedTypeDeclarations, __, CloseBrace);
6334
+ var NamespaceBlock$0 = $S(__, OpenBrace, NestedTypeDeclarations, __, CloseBrace);
6279
6335
  var NamespaceBlock$1 = $S(__, OpenBrace, $Q($S(__, TypeDeclaration, InterfacePropertyDelimiter)), __, CloseBrace);
6280
- var NamespaceBlock$2 = $S(InsertOpenBrace, EOS, NestedTypeDeclarations, InsertNewline, InsertIndent, InsertCloseBrace);
6336
+ var NamespaceBlock$2 = $S(InsertOpenBrace, NestedTypeDeclarations, InsertNewline, InsertIndent, InsertCloseBrace);
6281
6337
  function NamespaceBlock(state) {
6282
6338
  if (state.tokenize) {
6283
6339
  return $TOKEN("NamespaceBlock", state, NamespaceBlock$0(state) || NamespaceBlock$1(state) || NamespaceBlock$2(state));
@@ -6501,7 +6557,7 @@ var Civet = (() => {
6501
6557
  return NestedType$0(state);
6502
6558
  }
6503
6559
  }
6504
- var TypeConditional$0 = $TS($S(TypeBinary, $E($S(__, $EXPECT($L5, fail, 'TypeConditional "extends"'), Type, $E($S(__, QuestionMark, Type, __, Colon, Type))))), function($skip, $loc, $0, $1, $2) {
6560
+ var TypeConditional$0 = $TS($S(TypeBinary, $E($S(__, $EXPECT($L6, fail, 'TypeConditional "extends"'), Type, $E($S(__, QuestionMark, Type, __, Colon, Type))))), function($skip, $loc, $0, $1, $2) {
6505
6561
  if ($2)
6506
6562
  return $0;
6507
6563
  return $1;
@@ -6542,7 +6598,7 @@ var Civet = (() => {
6542
6598
  return TypeBinaryOp$0(state) || TypeBinaryOp$1(state);
6543
6599
  }
6544
6600
  }
6545
- var FunctionType$0 = $S(Parameters, __, $EXPECT($L3, fail, 'FunctionType "=>"'), Type);
6601
+ var FunctionType$0 = $S(Parameters, __, $EXPECT($L4, fail, 'FunctionType "=>"'), Type);
6546
6602
  function FunctionType(state) {
6547
6603
  if (state.verbose)
6548
6604
  console.log("ENTER:", "FunctionType");
@@ -6552,7 +6608,7 @@ var Civet = (() => {
6552
6608
  return FunctionType$0(state);
6553
6609
  }
6554
6610
  }
6555
- var TypeArguments$0 = $S(__, $EXPECT($L4, fail, 'TypeArguments "<"'), __, Type, $Q($S(__, Comma, __, Type)), $E($S(__, Comma)), __, $EXPECT($L55, fail, 'TypeArguments ">"'));
6611
+ var TypeArguments$0 = $S(__, $EXPECT($L5, fail, 'TypeArguments "<"'), __, Type, $Q($S(__, Comma, __, Type)), $E($S(__, Comma)), __, $EXPECT($L55, fail, 'TypeArguments ">"'));
6556
6612
  function TypeArguments(state) {
6557
6613
  if (state.verbose)
6558
6614
  console.log("ENTER:", "TypeArguments");
@@ -6562,7 +6618,7 @@ var Civet = (() => {
6562
6618
  return TypeArguments$0(state);
6563
6619
  }
6564
6620
  }
6565
- var TypeParameters$0 = $TS($S(__, $EXPECT($L4, fail, 'TypeParameters "<"'), __, Type, $Q($S(__, Comma, __, Type)), $E($S(__, Comma)), __, $EXPECT($L55, fail, 'TypeParameters ">"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
6621
+ var TypeParameters$0 = $TS($S(__, $EXPECT($L5, fail, 'TypeParameters "<"'), __, Type, $Q($S(__, Comma, __, Type)), $E($S(__, Comma)), __, $EXPECT($L55, fail, 'TypeParameters ">"')), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
6566
6622
  return { ts: true, children: $0 };
6567
6623
  });
6568
6624
  function TypeParameters(state) {
@@ -6584,7 +6640,7 @@ var Civet = (() => {
6584
6640
  return TypeParameter$0(state);
6585
6641
  }
6586
6642
  }
6587
- var TypeConstraint$0 = $S(__, $EXPECT($L5, fail, 'TypeConstraint "extends"'), Type);
6643
+ var TypeConstraint$0 = $S(__, $EXPECT($L6, fail, 'TypeConstraint "extends"'), Type);
6588
6644
  function TypeConstraint(state) {
6589
6645
  if (state.verbose)
6590
6646
  console.log("ENTER:", "TypeConstraint");
@@ -6710,7 +6766,7 @@ var Civet = (() => {
6710
6766
  return EOL$0(state);
6711
6767
  }
6712
6768
  }
6713
- var Debugger$0 = $TV($EXPECT($L0, fail, 'Debugger ""'), function($skip, $loc, $0, $1) {
6769
+ var Debugger$0 = $TV($EXPECT($L1, fail, 'Debugger ""'), function($skip, $loc, $0, $1) {
6714
6770
  debugger;
6715
6771
  });
6716
6772
  function Debugger(state) {
@@ -6722,7 +6778,7 @@ var Civet = (() => {
6722
6778
  return Debugger$0(state);
6723
6779
  }
6724
6780
  }
6725
- var InsertOpenParen$0 = $TV($EXPECT($L0, fail, 'InsertOpenParen ""'), function($skip, $loc, $0, $1) {
6781
+ var InsertOpenParen$0 = $TV($EXPECT($L1, fail, 'InsertOpenParen ""'), function($skip, $loc, $0, $1) {
6726
6782
  return { $loc, token: "(" };
6727
6783
  });
6728
6784
  function InsertOpenParen(state) {
@@ -6734,7 +6790,7 @@ var Civet = (() => {
6734
6790
  return InsertOpenParen$0(state);
6735
6791
  }
6736
6792
  }
6737
- var InsertCloseParen$0 = $TV($EXPECT($L0, fail, 'InsertCloseParen ""'), function($skip, $loc, $0, $1) {
6793
+ var InsertCloseParen$0 = $TV($EXPECT($L1, fail, 'InsertCloseParen ""'), function($skip, $loc, $0, $1) {
6738
6794
  return { $loc, token: ")" };
6739
6795
  });
6740
6796
  function InsertCloseParen(state) {
@@ -6746,7 +6802,7 @@ var Civet = (() => {
6746
6802
  return InsertCloseParen$0(state);
6747
6803
  }
6748
6804
  }
6749
- var InsertOpenBrace$0 = $TV($EXPECT($L0, fail, 'InsertOpenBrace ""'), function($skip, $loc, $0, $1) {
6805
+ var InsertOpenBrace$0 = $TV($EXPECT($L1, fail, 'InsertOpenBrace ""'), function($skip, $loc, $0, $1) {
6750
6806
  return [{ $loc, token: " " }, { $loc, token: "{" }];
6751
6807
  });
6752
6808
  function InsertOpenBrace(state) {
@@ -6758,7 +6814,7 @@ var Civet = (() => {
6758
6814
  return InsertOpenBrace$0(state);
6759
6815
  }
6760
6816
  }
6761
- var InsertCloseBrace$0 = $TV($EXPECT($L0, fail, 'InsertCloseBrace ""'), function($skip, $loc, $0, $1) {
6817
+ var InsertCloseBrace$0 = $TV($EXPECT($L1, fail, 'InsertCloseBrace ""'), function($skip, $loc, $0, $1) {
6762
6818
  return { $loc, token: "}" };
6763
6819
  });
6764
6820
  function InsertCloseBrace(state) {
@@ -6770,7 +6826,7 @@ var Civet = (() => {
6770
6826
  return InsertCloseBrace$0(state);
6771
6827
  }
6772
6828
  }
6773
- var InsertConst$0 = $TV($EXPECT($L0, fail, 'InsertConst ""'), function($skip, $loc, $0, $1) {
6829
+ var InsertConst$0 = $TV($EXPECT($L1, fail, 'InsertConst ""'), function($skip, $loc, $0, $1) {
6774
6830
  return { $loc, token: "const " };
6775
6831
  });
6776
6832
  function InsertConst(state) {
@@ -6782,7 +6838,7 @@ var Civet = (() => {
6782
6838
  return InsertConst$0(state);
6783
6839
  }
6784
6840
  }
6785
- var InsertReadonly$0 = $TV($EXPECT($L0, fail, 'InsertReadonly ""'), function($skip, $loc, $0, $1) {
6841
+ var InsertReadonly$0 = $TV($EXPECT($L1, fail, 'InsertReadonly ""'), function($skip, $loc, $0, $1) {
6786
6842
  return { ts: true, children: [{ $loc, token: "readonly " }] };
6787
6843
  });
6788
6844
  function InsertReadonly(state) {
@@ -6794,7 +6850,7 @@ var Civet = (() => {
6794
6850
  return InsertReadonly$0(state);
6795
6851
  }
6796
6852
  }
6797
- var InsertNewline$0 = $TV($EXPECT($L0, fail, 'InsertNewline ""'), function($skip, $loc, $0, $1) {
6853
+ var InsertNewline$0 = $TV($EXPECT($L1, fail, 'InsertNewline ""'), function($skip, $loc, $0, $1) {
6798
6854
  return "\n";
6799
6855
  });
6800
6856
  function InsertNewline(state) {
@@ -6806,8 +6862,8 @@ var Civet = (() => {
6806
6862
  return InsertNewline$0(state);
6807
6863
  }
6808
6864
  }
6809
- var InsertIndent$0 = $TV($EXPECT($L0, fail, 'InsertIndent ""'), function($skip, $loc, $0, $1) {
6810
- return "".padStart(module.currentIndent * 2);
6865
+ var InsertIndent$0 = $TV($EXPECT($L1, fail, 'InsertIndent ""'), function($skip, $loc, $0, $1) {
6866
+ return module.currentIndent.token;
6811
6867
  });
6812
6868
  function InsertIndent(state) {
6813
6869
  if (state.verbose)
@@ -6818,7 +6874,7 @@ var Civet = (() => {
6818
6874
  return InsertIndent$0(state);
6819
6875
  }
6820
6876
  }
6821
- var InsertSpace$0 = $TV($EXPECT($L0, fail, 'InsertSpace ""'), function($skip, $loc, $0, $1) {
6877
+ var InsertSpace$0 = $TV($EXPECT($L1, fail, 'InsertSpace ""'), function($skip, $loc, $0, $1) {
6822
6878
  return { $loc, token: " " };
6823
6879
  });
6824
6880
  function InsertSpace(state) {
@@ -6830,7 +6886,7 @@ var Civet = (() => {
6830
6886
  return InsertSpace$0(state);
6831
6887
  }
6832
6888
  }
6833
- var InsertDot$0 = $TV($EXPECT($L0, fail, 'InsertDot ""'), function($skip, $loc, $0, $1) {
6889
+ var InsertDot$0 = $TV($EXPECT($L1, fail, 'InsertDot ""'), function($skip, $loc, $0, $1) {
6834
6890
  return { $loc, token: "." };
6835
6891
  });
6836
6892
  function InsertDot(state) {
@@ -6842,7 +6898,7 @@ var Civet = (() => {
6842
6898
  return InsertDot$0(state);
6843
6899
  }
6844
6900
  }
6845
- var InsertBreak$0 = $TV($EXPECT($L0, fail, 'InsertBreak ""'), function($skip, $loc, $0, $1) {
6901
+ var InsertBreak$0 = $TV($EXPECT($L1, fail, 'InsertBreak ""'), function($skip, $loc, $0, $1) {
6846
6902
  return { $loc, token: ";break;" };
6847
6903
  });
6848
6904
  function InsertBreak(state) {
@@ -6854,7 +6910,7 @@ var Civet = (() => {
6854
6910
  return InsertBreak$0(state);
6855
6911
  }
6856
6912
  }
6857
- var CoffeeBinaryExistentialEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeBinaryExistentialEnabled ""'), function($skip, $loc, $0, $1) {
6913
+ var CoffeeBinaryExistentialEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeBinaryExistentialEnabled ""'), function($skip, $loc, $0, $1) {
6858
6914
  if (module.config.coffeeBinaryExistential)
6859
6915
  return;
6860
6916
  return $skip;
@@ -6868,7 +6924,7 @@ var Civet = (() => {
6868
6924
  return CoffeeBinaryExistentialEnabled$0(state);
6869
6925
  }
6870
6926
  }
6871
- var CoffeeBooleansEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeBooleansEnabled ""'), function($skip, $loc, $0, $1) {
6927
+ var CoffeeBooleansEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeBooleansEnabled ""'), function($skip, $loc, $0, $1) {
6872
6928
  if (module.config.coffeeBooleans)
6873
6929
  return;
6874
6930
  return $skip;
@@ -6882,7 +6938,7 @@ var Civet = (() => {
6882
6938
  return CoffeeBooleansEnabled$0(state);
6883
6939
  }
6884
6940
  }
6885
- var CoffeeClassesEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeClassesEnabled ""'), function($skip, $loc, $0, $1) {
6941
+ var CoffeeClassesEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeClassesEnabled ""'), function($skip, $loc, $0, $1) {
6886
6942
  if (module.config.coffeeClasses)
6887
6943
  return;
6888
6944
  return $skip;
@@ -6896,7 +6952,7 @@ var Civet = (() => {
6896
6952
  return CoffeeClassesEnabled$0(state);
6897
6953
  }
6898
6954
  }
6899
- var CoffeeCommentEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeCommentEnabled ""'), function($skip, $loc, $0, $1) {
6955
+ var CoffeeCommentEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeCommentEnabled ""'), function($skip, $loc, $0, $1) {
6900
6956
  if (module.config.coffeeComment)
6901
6957
  return;
6902
6958
  return $skip;
@@ -6910,7 +6966,7 @@ var Civet = (() => {
6910
6966
  return CoffeeCommentEnabled$0(state);
6911
6967
  }
6912
6968
  }
6913
- var CoffeeDoEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeDoEnabled ""'), function($skip, $loc, $0, $1) {
6969
+ var CoffeeDoEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeDoEnabled ""'), function($skip, $loc, $0, $1) {
6914
6970
  if (module.config.coffeeDo)
6915
6971
  return;
6916
6972
  return $skip;
@@ -6924,7 +6980,7 @@ var Civet = (() => {
6924
6980
  return CoffeeDoEnabled$0(state);
6925
6981
  }
6926
6982
  }
6927
- var CoffeeForLoopsEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeForLoopsEnabled ""'), function($skip, $loc, $0, $1) {
6983
+ var CoffeeForLoopsEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeForLoopsEnabled ""'), function($skip, $loc, $0, $1) {
6928
6984
  if (module.config.coffeeForLoops)
6929
6985
  return;
6930
6986
  return $skip;
@@ -6938,7 +6994,7 @@ var Civet = (() => {
6938
6994
  return CoffeeForLoopsEnabled$0(state);
6939
6995
  }
6940
6996
  }
6941
- var CoffeeInterpolationEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeInterpolationEnabled ""'), function($skip, $loc, $0, $1) {
6997
+ var CoffeeInterpolationEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeInterpolationEnabled ""'), function($skip, $loc, $0, $1) {
6942
6998
  if (module.config.coffeeInterpolation)
6943
6999
  return;
6944
7000
  return $skip;
@@ -6952,7 +7008,7 @@ var Civet = (() => {
6952
7008
  return CoffeeInterpolationEnabled$0(state);
6953
7009
  }
6954
7010
  }
6955
- var CoffeeIsntEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeIsntEnabled ""'), function($skip, $loc, $0, $1) {
7011
+ var CoffeeIsntEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeIsntEnabled ""'), function($skip, $loc, $0, $1) {
6956
7012
  if (module.config.coffeeIsnt)
6957
7013
  return;
6958
7014
  return $skip;
@@ -6966,7 +7022,7 @@ var Civet = (() => {
6966
7022
  return CoffeeIsntEnabled$0(state);
6967
7023
  }
6968
7024
  }
6969
- var CoffeeLineContinuationEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeLineContinuationEnabled ""'), function($skip, $loc, $0, $1) {
7025
+ var CoffeeLineContinuationEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeLineContinuationEnabled ""'), function($skip, $loc, $0, $1) {
6970
7026
  if (module.config.coffeeLineContinuation)
6971
7027
  return;
6972
7028
  return $skip;
@@ -6980,7 +7036,7 @@ var Civet = (() => {
6980
7036
  return CoffeeLineContinuationEnabled$0(state);
6981
7037
  }
6982
7038
  }
6983
- var CoffeeNotEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeNotEnabled ""'), function($skip, $loc, $0, $1) {
7039
+ var CoffeeNotEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeNotEnabled ""'), function($skip, $loc, $0, $1) {
6984
7040
  if (module.config.coffeeNot)
6985
7041
  return;
6986
7042
  return $skip;
@@ -6994,7 +7050,7 @@ var Civet = (() => {
6994
7050
  return CoffeeNotEnabled$0(state);
6995
7051
  }
6996
7052
  }
6997
- var CoffeeOfEnabled$0 = $TV($EXPECT($L0, fail, 'CoffeeOfEnabled ""'), function($skip, $loc, $0, $1) {
7053
+ var CoffeeOfEnabled$0 = $TV($EXPECT($L1, fail, 'CoffeeOfEnabled ""'), function($skip, $loc, $0, $1) {
6998
7054
  if (module.config.coffeeOf)
6999
7055
  return;
7000
7056
  return $skip;
@@ -7008,9 +7064,21 @@ var Civet = (() => {
7008
7064
  return CoffeeOfEnabled$0(state);
7009
7065
  }
7010
7066
  }
7011
- var Reset$0 = $TV($EXPECT($L0, fail, 'Reset ""'), function($skip, $loc, $0, $1) {
7012
- module.currentIndent = 0;
7013
- module.indentLevels = [0];
7067
+ var Reset$0 = $TV($EXPECT($L1, fail, 'Reset ""'), function($skip, $loc, $0, $1) {
7068
+ module.indentLevels = [{
7069
+ level: 0,
7070
+ token: ""
7071
+ }];
7072
+ if (!module._init) {
7073
+ module._init = true;
7074
+ Object.defineProperties(module, {
7075
+ currentIndent: {
7076
+ get() {
7077
+ return module.indentLevels[module.indentLevels.length - 1];
7078
+ }
7079
+ }
7080
+ });
7081
+ }
7014
7082
  module.verbose = false;
7015
7083
  module.config = {
7016
7084
  autoVar: false,
@@ -7045,7 +7113,7 @@ var Civet = (() => {
7045
7113
  ts: true,
7046
7114
  children: [" as any"]
7047
7115
  };
7048
- module.prelude.push(["", "const ", indexOfRef, typeSuffix, " = [].indexOf", asAny, "\n"]);
7116
+ module.prelude.push(["", ["const ", indexOfRef, typeSuffix, " = [].indexOf", asAny, "\n"]]);
7049
7117
  return indexOfRef;
7050
7118
  };
7051
7119
  module.getHasPropRef = function() {
@@ -7063,7 +7131,7 @@ var Civet = (() => {
7063
7131
  ts: true,
7064
7132
  children: [" as any"]
7065
7133
  };
7066
- module.prelude.push(["", "const ", hasPropRef, typeSuffix, " = {}.hasOwnProperty", asAny, "\n"]);
7134
+ module.prelude.push(["", ["const ", hasPropRef, typeSuffix, " = {}.hasOwnProperty", asAny, "\n"]]);
7067
7135
  return hasPropRef;
7068
7136
  };
7069
7137
  Object.defineProperty(module.config, "coffeeCompat", {
@@ -7112,7 +7180,7 @@ var Civet = (() => {
7112
7180
  return Reset$0(state);
7113
7181
  }
7114
7182
  }
7115
- var Init$0 = $TS($S($E(Shebang), $Q(DirectivePrologue), $EXPECT($L0, fail, 'Init ""')), function($skip, $loc, $0, $1, $2, $3) {
7183
+ var Init$0 = $TS($S($E(Shebang), $Q(DirectivePrologue), $EXPECT($L1, fail, 'Init ""')), function($skip, $loc, $0, $1, $2, $3) {
7116
7184
  var directives = $2;
7117
7185
  directives.forEach((directive) => {
7118
7186
  if (directive.type === "CivetPrologue") {
@@ -7622,7 +7690,9 @@ var Civet = (() => {
7622
7690
  scopes.pop();
7623
7691
  });
7624
7692
  if (varIds.length) {
7625
- const indent = statements[0][0];
7693
+ let indent = statements[0][0];
7694
+ if (Array.isArray(indent))
7695
+ indent = indent[indent.length - 1];
7626
7696
  statements.unshift([indent, "var ", varIds.join(", "), "\n"]);
7627
7697
  }
7628
7698
  }
@@ -7641,7 +7711,7 @@ var Civet = (() => {
7641
7711
  const level = $1.length;
7642
7712
  return {
7643
7713
  $loc,
7644
- token: "".padStart(level * 2),
7714
+ token: $1.join(""),
7645
7715
  level
7646
7716
  };
7647
7717
  });
@@ -7654,23 +7724,28 @@ var Civet = (() => {
7654
7724
  return Indent$0(state);
7655
7725
  }
7656
7726
  }
7657
- var TrackIndent$0 = $TV($EXPECT($L0, fail, 'TrackIndent ""'), function($skip, $loc, $0, $1) {
7658
- module.indentLevels.push(module.currentIndent);
7727
+ var TrackIndented$0 = $TV(Indent, function($skip, $loc, $0, $1) {
7728
+ var indent = $0;
7729
+ const { level } = indent;
7730
+ if (level <= module.currentIndent.level) {
7731
+ return $skip;
7732
+ }
7733
+ module.indentLevels.push(indent);
7659
7734
  });
7660
- function TrackIndent(state) {
7735
+ function TrackIndented(state) {
7661
7736
  if (state.verbose)
7662
- console.log("ENTER:", "TrackIndent");
7737
+ console.log("ENTER:", "TrackIndented");
7663
7738
  if (state.tokenize) {
7664
- return $TOKEN("TrackIndent", state, TrackIndent$0(state));
7739
+ return $TOKEN("TrackIndented", state, TrackIndented$0(state));
7665
7740
  } else {
7666
- return TrackIndent$0(state);
7741
+ return TrackIndented$0(state);
7667
7742
  }
7668
7743
  }
7669
- var Samedent$0 = $TS($S($E(EOS), Indent), function($skip, $loc, $0, $1, $2) {
7744
+ var Samedent$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
7670
7745
  var indent = $2;
7671
7746
  const { level } = indent;
7672
- const currentIndent = module.indentLevels[module.indentLevels.length - 1];
7673
- if (level === currentIndent) {
7747
+ const currentIndentLevel = module.currentIndent.level;
7748
+ if (level === currentIndentLevel) {
7674
7749
  return $0;
7675
7750
  }
7676
7751
  return $skip;
@@ -7684,11 +7759,11 @@ var Civet = (() => {
7684
7759
  return Samedent$0(state);
7685
7760
  }
7686
7761
  }
7687
- var IndentedFurther$0 = $TS($S($E(EOS), Indent), function($skip, $loc, $0, $1, $2) {
7762
+ var IndentedFurther$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
7688
7763
  var indent = $2;
7689
7764
  const { level } = indent;
7690
- const currentIndent = module.indentLevels[module.indentLevels.length - 1];
7691
- if (level > currentIndent) {
7765
+ const currentIndentLevel = module.currentIndent.level;
7766
+ if (level > currentIndentLevel) {
7692
7767
  return $0;
7693
7768
  }
7694
7769
  return $skip;
@@ -7702,13 +7777,7 @@ var Civet = (() => {
7702
7777
  return IndentedFurther$0(state);
7703
7778
  }
7704
7779
  }
7705
- var PushIndent$0 = $TV($EXPECT($L0, fail, 'PushIndent ""'), function($skip, $loc, $0, $1) {
7706
- module.currentIndent++;
7707
- if (module.verbose) {
7708
- console.log("pushing indent", module.currentIndent);
7709
- }
7710
- module.indentLevels.push(module.currentIndent);
7711
- });
7780
+ var PushIndent$0 = $Y($S(EOS, TrackIndented));
7712
7781
  function PushIndent(state) {
7713
7782
  if (state.verbose)
7714
7783
  console.log("ENTER:", "PushIndent");
@@ -7718,12 +7787,11 @@ var Civet = (() => {
7718
7787
  return PushIndent$0(state);
7719
7788
  }
7720
7789
  }
7721
- var PopIndent$0 = $TV($EXPECT($L0, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
7790
+ var PopIndent$0 = $TV($EXPECT($L1, fail, 'PopIndent ""'), function($skip, $loc, $0, $1) {
7722
7791
  if (module.verbose) {
7723
7792
  console.log("popping indent", module.indentLevels[module.indentLevels.length - 1], "->", module.indentLevels[module.indentLevels.length - 2]);
7724
7793
  }
7725
7794
  module.indentLevels.pop();
7726
- module.currentIndent = module.indentLevels[module.indentLevels.length - 1];
7727
7795
  });
7728
7796
  function PopIndent(state) {
7729
7797
  if (state.verbose)
@@ -7734,16 +7802,15 @@ var Civet = (() => {
7734
7802
  return PopIndent$0(state);
7735
7803
  }
7736
7804
  }
7737
- var Nested$0 = $TS($S($E(EOS), Indent), function($skip, $loc, $0, $1, $2) {
7805
+ var Nested$0 = $TS($S(EOS, Indent), function($skip, $loc, $0, $1, $2) {
7738
7806
  var eos = $1;
7739
7807
  var indent = $2;
7740
7808
  const { level } = indent;
7741
- const currentIndent = module.indentLevels[module.indentLevels.length - 1];
7809
+ const currentIndent = module.currentIndent;
7742
7810
  if (module.verbose) {
7743
- console.log("global indent", module.currentIndent);
7744
7811
  console.log("Indented", level, currentIndent);
7745
7812
  }
7746
- if (level !== currentIndent) {
7813
+ if (level !== currentIndent.level) {
7747
7814
  if (module.verbose) {
7748
7815
  console.log("skipped nested");
7749
7816
  }