@danielx/civet 0.8.5 → 0.8.6

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/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ This changelog is generated automatically by [`build/changelog.civet`](build/cha
4
4
  For each version of Civet, it lists and links to all incorporated PRs,
5
5
  as well as a full diff and commit list.
6
6
 
7
+ ## 0.8.6 (2024-10-21, [diff](https://github.com/DanielXMoore/Civet/compare/v0.8.5...v0.8.6), [commits](https://github.com/DanielXMoore/Civet/commits/v0.8.6))
8
+ * Fix CLI with complex `NODE_OPTIONS`, LSP cleanup [[#1482](https://github.com/DanielXMoore/Civet/pull/1482)]
9
+ * `if` conditions continued by binary op on next line [[#1483](https://github.com/DanielXMoore/Civet/pull/1483)]
10
+ * `from ... import/export` (reversed `import`/`export`) [[#1484](https://github.com/DanielXMoore/Civet/pull/1484)]
11
+
7
12
  ## 0.8.5 (2024-10-21, [diff](https://github.com/DanielXMoore/Civet/compare/v0.8.4...v0.8.5), [commits](https://github.com/DanielXMoore/Civet/commits/v0.8.5))
8
13
  * Reverse slices and inequality slices with implicit parts [[#1478](https://github.com/DanielXMoore/Civet/pull/1478)]
9
14
  * Indented types after binary type operators [[#1479](https://github.com/DanielXMoore/Civet/pull/1479)]
package/dist/browser.js CHANGED
@@ -7757,6 +7757,8 @@ ${js}`
7757
7757
  NamedImports,
7758
7758
  OperatorNamedImports,
7759
7759
  FromClause,
7760
+ ImpliedFromClause,
7761
+ ImpliedFrom,
7760
7762
  ImportAssertion,
7761
7763
  TypeAndImportSpecifier,
7762
7764
  ImportSpecifier,
@@ -8441,7 +8443,7 @@ ${js}`
8441
8443
  var $R29 = (0, import_lib4.$R)(new RegExp("[:.]", "suy"));
8442
8444
  var $R30 = (0, import_lib4.$R)(new RegExp("(?=for|if|loop|unless|until|while)", "suy"));
8443
8445
  var $R31 = (0, import_lib4.$R)(new RegExp("(?=loop|comptime|do|for|until|while)", "suy"));
8444
- var $R32 = (0, import_lib4.$R)(new RegExp('[^;"\\s]+', "suy"));
8446
+ var $R32 = (0, import_lib4.$R)(new RegExp('[^;"\\s=>]+', "suy"));
8445
8447
  var $R33 = (0, import_lib4.$R)(new RegExp("(?=[0-9.])", "suy"));
8446
8448
  var $R34 = (0, import_lib4.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy"));
8447
8449
  var $R35 = (0, import_lib4.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy"));
@@ -9950,14 +9952,22 @@ ${js}`
9950
9952
  var CallExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, NamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9951
9953
  return dynamizeImportDeclarationExpression($0);
9952
9954
  });
9953
- var CallExpression$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9955
+ var CallExpression$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(FromClause, __, Import, _, NamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9956
+ var from = $1;
9957
+ var fws = $2;
9958
+ var i = $3;
9959
+ var iws = $4;
9960
+ var imports = $5;
9961
+ return dynamizeImportDeclarationExpression([i, iws, imports, fws, from]);
9962
+ });
9963
+ var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9954
9964
  var rest = $3;
9955
9965
  return processCallMemberExpression({
9956
9966
  type: "CallExpression",
9957
9967
  children: [$1, ...$2, ...rest.flat()]
9958
9968
  });
9959
9969
  });
9960
- var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression, AllowedTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9970
+ var CallExpression$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression, AllowedTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9961
9971
  var member = $1;
9962
9972
  var trailing = $2;
9963
9973
  var rest = $3;
@@ -9970,7 +9980,7 @@ ${js}`
9970
9980
  }
9971
9981
  return member;
9972
9982
  });
9973
- var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2, CallExpression$3];
9983
+ var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2, CallExpression$3, CallExpression$4];
9974
9984
  function CallExpression(ctx, state2) {
9975
9985
  return (0, import_lib4.$EVENT_C)(ctx, state2, "CallExpression", CallExpression$$);
9976
9986
  }
@@ -14000,9 +14010,12 @@ ${js}`
14000
14010
  function ForBinding(ctx, state2) {
14001
14011
  return (0, import_lib4.$EVENT)(ctx, state2, "ForBinding", ForBinding$0);
14002
14012
  }
14003
- var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, (0, import_lib4.$C)(EmptyCondition, Condition), CaseBlock), function($skip, $loc, $0, $1, $2, $3) {
14004
- var condition = $2;
14005
- var caseBlock = $3;
14013
+ var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, ForbidNewlineBinaryOp, (0, import_lib4.$E)((0, import_lib4.$C)(EmptyCondition, Condition)), RestoreNewlineBinaryOp, CaseBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14014
+ var s = $1;
14015
+ var condition = $3;
14016
+ var caseBlock = $5;
14017
+ if (!condition)
14018
+ return $skip;
14006
14019
  if (condition.type === "EmptyCondition") {
14007
14020
  caseBlock.clauses.forEach(({ cases }) => {
14008
14021
  if (cases) {
@@ -14022,7 +14035,8 @@ ${js}`
14022
14035
  }
14023
14036
  return {
14024
14037
  type: "SwitchStatement",
14025
- children: $0,
14038
+ children: [s, condition, caseBlock],
14039
+ // omit NewlineBinaryOp control
14026
14040
  condition,
14027
14041
  caseBlock
14028
14042
  };
@@ -14390,8 +14404,8 @@ ${js}`
14390
14404
  function SingleLineExpressionWithIndentedApplicationForbidden(ctx, state2) {
14391
14405
  return (0, import_lib4.$EVENT)(ctx, state2, "SingleLineExpressionWithIndentedApplicationForbidden", SingleLineExpressionWithIndentedApplicationForbidden$0);
14392
14406
  }
14393
- var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidNewlineBinaryOp, (0, import_lib4.$E)(Expression), RestoreNewlineBinaryOp, RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14394
- var exp = $4;
14407
+ var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForbidBracedApplication, ForbidIndentedApplication, (0, import_lib4.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14408
+ var exp = $3;
14395
14409
  if (exp)
14396
14410
  return exp;
14397
14411
  return $skip;
@@ -14780,36 +14794,41 @@ ${js}`
14780
14794
  children: [imp, $0.slice(1)]
14781
14795
  };
14782
14796
  });
14783
- var ImportDeclaration$1 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, TypeKeyword, __, ImportClause, __, FromClause), function(value) {
14784
- var imports = value[4];
14785
- var from = value[6];
14786
- return { "type": "ImportDeclaration", "ts": true, "children": value, "imports": imports, "from": from };
14787
- });
14788
- var ImportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, __, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
14789
- var behavior = $4;
14790
- var imports = $6;
14791
- var from = $8;
14797
+ var ImportDeclaration$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$S)(Import, __), ImpliedImport), Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14798
+ var i = $1;
14799
+ var behavior = $3;
14800
+ var ws1 = $4;
14801
+ var imports = $5;
14802
+ var ws2 = $6;
14803
+ var from = $7;
14792
14804
  imports.specifiers.forEach((spec) => {
14793
14805
  state.operators.set(spec.binding.name, spec.behavior ?? behavior);
14794
14806
  });
14795
14807
  return {
14796
14808
  type: "ImportDeclaration",
14797
- children: [$1, $2, trimFirstSpace($5), imports, $7, from],
14798
- // omit $3 = Operator and $4 = OperatorBehavior
14809
+ children: [i, trimFirstSpace(ws1), imports, ws2, from],
14810
+ // omit $2 = Operator and $3 = OperatorBehavior
14799
14811
  imports,
14800
14812
  from
14801
14813
  };
14802
14814
  });
14803
- var ImportDeclaration$3 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ImportClause, __, FromClause), function(value) {
14804
- var imports = value[2];
14805
- var from = value[4];
14806
- return { "type": "ImportDeclaration", "children": value, "imports": imports, "from": from };
14815
+ var ImportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, __, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
14816
+ var t = $3;
14817
+ var imports = $4;
14818
+ var from = $6;
14819
+ return {
14820
+ type: "ImportDeclaration",
14821
+ children: $0,
14822
+ imports,
14823
+ from,
14824
+ ts: !!t
14825
+ };
14807
14826
  });
14808
- var ImportDeclaration$4 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ModuleSpecifier), function(value) {
14827
+ var ImportDeclaration$3 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ModuleSpecifier), function(value) {
14809
14828
  var module = value[2];
14810
14829
  return { "type": "ImportDeclaration", "children": value, "module": module };
14811
14830
  });
14812
- var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14831
+ var ImportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14813
14832
  var i = $1;
14814
14833
  var t = $2;
14815
14834
  var imports = $3;
@@ -14822,22 +14841,40 @@ ${js}`
14822
14841
  const children = [i, t, imports, w, from];
14823
14842
  return { type: "ImportDeclaration", ts: !!t, children, imports, from };
14824
14843
  });
14825
- var ImportDeclaration$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14826
- var i = $1;
14827
- var behavior = $3;
14828
- var imports = $5;
14829
- var from = $7;
14844
+ var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Import, __, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
14845
+ var from = $1;
14846
+ var fws = $2;
14847
+ var i = $3;
14848
+ var iws = $4;
14849
+ var behavior = $6;
14850
+ var ows = $7;
14851
+ var imports = $8;
14830
14852
  imports.specifiers.forEach((spec) => {
14831
14853
  state.operators.set(spec.binding.name, spec.behavior ?? behavior);
14832
14854
  });
14833
14855
  return {
14834
14856
  type: "ImportDeclaration",
14835
- children: [$1, trimFirstSpace($4), imports, $6, from],
14836
- // omit $2 = Operator and $3 = OperatorBehavior
14857
+ children: [i, iws, trimFirstSpace(ows), imports, fws, from],
14858
+ // omit Operator and OperatorBehavior
14837
14859
  imports,
14838
14860
  from
14839
14861
  };
14840
14862
  });
14863
+ var ImportDeclaration$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Import, __, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
14864
+ var from = $1;
14865
+ var fws = $2;
14866
+ var i = $3;
14867
+ var iws = $4;
14868
+ var t = $5;
14869
+ var imports = $6;
14870
+ return {
14871
+ type: "ImportDeclaration",
14872
+ children: [i, iws, t, imports, fws, from],
14873
+ imports,
14874
+ from,
14875
+ ts: !!t
14876
+ };
14877
+ });
14841
14878
  var ImportDeclaration$$ = [ImportDeclaration$0, ImportDeclaration$1, ImportDeclaration$2, ImportDeclaration$3, ImportDeclaration$4, ImportDeclaration$5, ImportDeclaration$6];
14842
14879
  function ImportDeclaration(ctx, state2) {
14843
14880
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportDeclaration", ImportDeclaration$$);
@@ -14922,6 +14959,21 @@ ${js}`
14922
14959
  function FromClause(ctx, state2) {
14923
14960
  return (0, import_lib4.$EVENT)(ctx, state2, "FromClause", FromClause$0);
14924
14961
  }
14962
+ var ImpliedFromClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$S)(From, __), ImpliedFrom), ModuleSpecifier), function($skip, $loc, $0, $1, $2) {
14963
+ var module = $2;
14964
+ if (!Array.isArray(module))
14965
+ return $0;
14966
+ return [$1, ...module];
14967
+ });
14968
+ function ImpliedFromClause(ctx, state2) {
14969
+ return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFromClause", ImpliedFromClause$0);
14970
+ }
14971
+ var ImpliedFrom$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'ImpliedFrom ""'), function($skip, $loc, $0, $1) {
14972
+ return { $loc, token: "from " };
14973
+ });
14974
+ function ImpliedFrom(ctx, state2) {
14975
+ return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
14976
+ }
14925
14977
  var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L124, 'ImportAssertion "with"'), (0, import_lib4.$EXPECT)($L125, 'ImportAssertion "assert"')), NonIdContinue, (0, import_lib4.$E)(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14926
14978
  var keyword = $2;
14927
14979
  var object = $5;
@@ -15054,7 +15106,7 @@ ${js}`
15054
15106
  function UnprocessedModuleSpecifier(ctx, state2) {
15055
15107
  return (0, import_lib4.$EVENT_C)(ctx, state2, "UnprocessedModuleSpecifier", UnprocessedModuleSpecifier$$);
15056
15108
  }
15057
- var UnquotedSpecifier$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($R32, 'UnquotedSpecifier /[^;"\\s]+/'), function($skip, $loc, $0, $1) {
15109
+ var UnquotedSpecifier$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($R32, 'UnquotedSpecifier /[^;"\\s=>]+/'), function($skip, $loc, $0, $1) {
15058
15110
  var spec = $0;
15059
15111
  return { $loc, token: `"${spec}"` };
15060
15112
  });
@@ -15107,13 +15159,26 @@ ${js}`
15107
15159
  return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
15108
15160
  });
15109
15161
  var ExportDeclaration$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(Export, __, ExportFromClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15110
- return { type: "ExportDeclaration", ts: $3.ts, children: $0 };
15162
+ var exports = $3;
15163
+ return { type: "ExportDeclaration", ts: exports.ts, children: $0 };
15164
+ });
15165
+ var ExportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Export, __, ExportFromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15166
+ var from = $1;
15167
+ var fws = $2;
15168
+ var e = $3;
15169
+ var ews = $4;
15170
+ var exports = $5;
15171
+ return {
15172
+ type: "ExportDeclaration",
15173
+ ts: exports.ts,
15174
+ children: [e, ews, exports, " ", from, trimFirstSpace(fws)]
15175
+ };
15111
15176
  });
15112
- var ExportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(Decorators), Export, __, (0, import_lib4.$C)(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
15177
+ var ExportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(Decorators), Export, __, (0, import_lib4.$C)(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
15113
15178
  var declaration = $4;
15114
15179
  return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
15115
15180
  });
15116
- var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3, ExportDeclaration$4];
15181
+ var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3, ExportDeclaration$4, ExportDeclaration$5];
15117
15182
  function ExportDeclaration(ctx, state2) {
15118
15183
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ExportDeclaration", ExportDeclaration$$);
15119
15184
  }
package/dist/civet CHANGED
@@ -90,7 +90,7 @@ async function parseArgs(args, isTTY = process.stdin.isTTY) {
90
90
  results.push(`-${char}`);
91
91
  }
92
92
  ;
93
- args.splice(i, 1 + i - i, ...results);
93
+ args.splice(i, i + 1 - i, ...results);
94
94
  continue;
95
95
  }
96
96
  switch (arg) {
@@ -305,9 +305,6 @@ async function repl(args, options) {
305
305
  };
306
306
  } else {
307
307
  const execArgv = ["--experimental-vm-modules"];
308
- if (process.env.NODE_OPTIONS) {
309
- execArgv.push(process.env.NODE_OPTIONS);
310
- }
311
308
  const { fork } = await import("node:child_process");
312
309
  fork(__filename, args, {
313
310
  execArgv,
@@ -650,9 +647,6 @@ You can override this behavior via: --civet rewriteCivetImports=.ext
650
647
  }
651
648
  const debugRe = /--debug|--inspect/;
652
649
  const isDebug = typeof v8debug === "object" || debugRe.test(process.execArgv.join(" ")) || debugRe.test(process.env.NODE_OPTIONS ?? "");
653
- if (process.env.NODE_OPTIONS) {
654
- execArgv.push(process.env.NODE_OPTIONS);
655
- }
656
650
  if (isDebug) {
657
651
  execArgv.push("--inspect=" + (process.debugPort + 1));
658
652
  }
package/dist/main.js CHANGED
@@ -7733,6 +7733,8 @@ var grammar = {
7733
7733
  NamedImports,
7734
7734
  OperatorNamedImports,
7735
7735
  FromClause,
7736
+ ImpliedFromClause,
7737
+ ImpliedFrom,
7736
7738
  ImportAssertion,
7737
7739
  TypeAndImportSpecifier,
7738
7740
  ImportSpecifier,
@@ -8417,7 +8419,7 @@ var $R28 = (0, import_lib4.$R)(new RegExp("(?!\\+\\+|--)[!~+-](?!\\s)", "suy"));
8417
8419
  var $R29 = (0, import_lib4.$R)(new RegExp("[:.]", "suy"));
8418
8420
  var $R30 = (0, import_lib4.$R)(new RegExp("(?=for|if|loop|unless|until|while)", "suy"));
8419
8421
  var $R31 = (0, import_lib4.$R)(new RegExp("(?=loop|comptime|do|for|until|while)", "suy"));
8420
- var $R32 = (0, import_lib4.$R)(new RegExp('[^;"\\s]+', "suy"));
8422
+ var $R32 = (0, import_lib4.$R)(new RegExp('[^;"\\s=>]+', "suy"));
8421
8423
  var $R33 = (0, import_lib4.$R)(new RegExp("(?=[0-9.])", "suy"));
8422
8424
  var $R34 = (0, import_lib4.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy"));
8423
8425
  var $R35 = (0, import_lib4.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy"));
@@ -9926,14 +9928,22 @@ var CallExpression$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Super, Arguments
9926
9928
  var CallExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, NamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9927
9929
  return dynamizeImportDeclarationExpression($0);
9928
9930
  });
9929
- var CallExpression$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9931
+ var CallExpression$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(FromClause, __, Import, _, NamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9932
+ var from = $1;
9933
+ var fws = $2;
9934
+ var i = $3;
9935
+ var iws = $4;
9936
+ var imports = $5;
9937
+ return dynamizeImportDeclarationExpression([i, iws, imports, fws, from]);
9938
+ });
9939
+ var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9930
9940
  var rest = $3;
9931
9941
  return processCallMemberExpression({
9932
9942
  type: "CallExpression",
9933
9943
  children: [$1, ...$2, ...rest.flat()]
9934
9944
  });
9935
9945
  });
9936
- var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression, AllowedTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9946
+ var CallExpression$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression, AllowedTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9937
9947
  var member = $1;
9938
9948
  var trailing = $2;
9939
9949
  var rest = $3;
@@ -9946,7 +9956,7 @@ var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression
9946
9956
  }
9947
9957
  return member;
9948
9958
  });
9949
- var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2, CallExpression$3];
9959
+ var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2, CallExpression$3, CallExpression$4];
9950
9960
  function CallExpression(ctx, state2) {
9951
9961
  return (0, import_lib4.$EVENT_C)(ctx, state2, "CallExpression", CallExpression$$);
9952
9962
  }
@@ -13976,9 +13986,12 @@ var ForBinding$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)(
13976
13986
  function ForBinding(ctx, state2) {
13977
13987
  return (0, import_lib4.$EVENT)(ctx, state2, "ForBinding", ForBinding$0);
13978
13988
  }
13979
- var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, (0, import_lib4.$C)(EmptyCondition, Condition), CaseBlock), function($skip, $loc, $0, $1, $2, $3) {
13980
- var condition = $2;
13981
- var caseBlock = $3;
13989
+ var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, ForbidNewlineBinaryOp, (0, import_lib4.$E)((0, import_lib4.$C)(EmptyCondition, Condition)), RestoreNewlineBinaryOp, CaseBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
13990
+ var s = $1;
13991
+ var condition = $3;
13992
+ var caseBlock = $5;
13993
+ if (!condition)
13994
+ return $skip;
13982
13995
  if (condition.type === "EmptyCondition") {
13983
13996
  caseBlock.clauses.forEach(({ cases }) => {
13984
13997
  if (cases) {
@@ -13998,7 +14011,8 @@ var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, (0, imp
13998
14011
  }
13999
14012
  return {
14000
14013
  type: "SwitchStatement",
14001
- children: $0,
14014
+ children: [s, condition, caseBlock],
14015
+ // omit NewlineBinaryOp control
14002
14016
  condition,
14003
14017
  caseBlock
14004
14018
  };
@@ -14366,8 +14380,8 @@ var SingleLineExpressionWithIndentedApplicationForbidden$0 = (0, import_lib4.$TS
14366
14380
  function SingleLineExpressionWithIndentedApplicationForbidden(ctx, state2) {
14367
14381
  return (0, import_lib4.$EVENT)(ctx, state2, "SingleLineExpressionWithIndentedApplicationForbidden", SingleLineExpressionWithIndentedApplicationForbidden$0);
14368
14382
  }
14369
- var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidNewlineBinaryOp, (0, import_lib4.$E)(Expression), RestoreNewlineBinaryOp, RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14370
- var exp = $4;
14383
+ var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForbidBracedApplication, ForbidIndentedApplication, (0, import_lib4.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14384
+ var exp = $3;
14371
14385
  if (exp)
14372
14386
  return exp;
14373
14387
  return $skip;
@@ -14756,36 +14770,41 @@ var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Id
14756
14770
  children: [imp, $0.slice(1)]
14757
14771
  };
14758
14772
  });
14759
- var ImportDeclaration$1 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, TypeKeyword, __, ImportClause, __, FromClause), function(value) {
14760
- var imports = value[4];
14761
- var from = value[6];
14762
- return { "type": "ImportDeclaration", "ts": true, "children": value, "imports": imports, "from": from };
14763
- });
14764
- var ImportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, __, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
14765
- var behavior = $4;
14766
- var imports = $6;
14767
- var from = $8;
14773
+ var ImportDeclaration$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$S)(Import, __), ImpliedImport), Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14774
+ var i = $1;
14775
+ var behavior = $3;
14776
+ var ws1 = $4;
14777
+ var imports = $5;
14778
+ var ws2 = $6;
14779
+ var from = $7;
14768
14780
  imports.specifiers.forEach((spec) => {
14769
14781
  state.operators.set(spec.binding.name, spec.behavior ?? behavior);
14770
14782
  });
14771
14783
  return {
14772
14784
  type: "ImportDeclaration",
14773
- children: [$1, $2, trimFirstSpace($5), imports, $7, from],
14774
- // omit $3 = Operator and $4 = OperatorBehavior
14785
+ children: [i, trimFirstSpace(ws1), imports, ws2, from],
14786
+ // omit $2 = Operator and $3 = OperatorBehavior
14775
14787
  imports,
14776
14788
  from
14777
14789
  };
14778
14790
  });
14779
- var ImportDeclaration$3 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ImportClause, __, FromClause), function(value) {
14780
- var imports = value[2];
14781
- var from = value[4];
14782
- return { "type": "ImportDeclaration", "children": value, "imports": imports, "from": from };
14791
+ var ImportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, __, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
14792
+ var t = $3;
14793
+ var imports = $4;
14794
+ var from = $6;
14795
+ return {
14796
+ type: "ImportDeclaration",
14797
+ children: $0,
14798
+ imports,
14799
+ from,
14800
+ ts: !!t
14801
+ };
14783
14802
  });
14784
- var ImportDeclaration$4 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ModuleSpecifier), function(value) {
14803
+ var ImportDeclaration$3 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ModuleSpecifier), function(value) {
14785
14804
  var module2 = value[2];
14786
14805
  return { "type": "ImportDeclaration", "children": value, "module": module2 };
14787
14806
  });
14788
- var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14807
+ var ImportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14789
14808
  var i = $1;
14790
14809
  var t = $2;
14791
14810
  var imports = $3;
@@ -14798,22 +14817,40 @@ var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport
14798
14817
  const children = [i, t, imports, w, from];
14799
14818
  return { type: "ImportDeclaration", ts: !!t, children, imports, from };
14800
14819
  });
14801
- var ImportDeclaration$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14802
- var i = $1;
14803
- var behavior = $3;
14804
- var imports = $5;
14805
- var from = $7;
14820
+ var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Import, __, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
14821
+ var from = $1;
14822
+ var fws = $2;
14823
+ var i = $3;
14824
+ var iws = $4;
14825
+ var behavior = $6;
14826
+ var ows = $7;
14827
+ var imports = $8;
14806
14828
  imports.specifiers.forEach((spec) => {
14807
14829
  state.operators.set(spec.binding.name, spec.behavior ?? behavior);
14808
14830
  });
14809
14831
  return {
14810
14832
  type: "ImportDeclaration",
14811
- children: [$1, trimFirstSpace($4), imports, $6, from],
14812
- // omit $2 = Operator and $3 = OperatorBehavior
14833
+ children: [i, iws, trimFirstSpace(ows), imports, fws, from],
14834
+ // omit Operator and OperatorBehavior
14813
14835
  imports,
14814
14836
  from
14815
14837
  };
14816
14838
  });
14839
+ var ImportDeclaration$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Import, __, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
14840
+ var from = $1;
14841
+ var fws = $2;
14842
+ var i = $3;
14843
+ var iws = $4;
14844
+ var t = $5;
14845
+ var imports = $6;
14846
+ return {
14847
+ type: "ImportDeclaration",
14848
+ children: [i, iws, t, imports, fws, from],
14849
+ imports,
14850
+ from,
14851
+ ts: !!t
14852
+ };
14853
+ });
14817
14854
  var ImportDeclaration$$ = [ImportDeclaration$0, ImportDeclaration$1, ImportDeclaration$2, ImportDeclaration$3, ImportDeclaration$4, ImportDeclaration$5, ImportDeclaration$6];
14818
14855
  function ImportDeclaration(ctx, state2) {
14819
14856
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportDeclaration", ImportDeclaration$$);
@@ -14898,6 +14935,21 @@ var FromClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(From, __, ModuleSpec
14898
14935
  function FromClause(ctx, state2) {
14899
14936
  return (0, import_lib4.$EVENT)(ctx, state2, "FromClause", FromClause$0);
14900
14937
  }
14938
+ var ImpliedFromClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$S)(From, __), ImpliedFrom), ModuleSpecifier), function($skip, $loc, $0, $1, $2) {
14939
+ var module2 = $2;
14940
+ if (!Array.isArray(module2))
14941
+ return $0;
14942
+ return [$1, ...module2];
14943
+ });
14944
+ function ImpliedFromClause(ctx, state2) {
14945
+ return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFromClause", ImpliedFromClause$0);
14946
+ }
14947
+ var ImpliedFrom$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'ImpliedFrom ""'), function($skip, $loc, $0, $1) {
14948
+ return { $loc, token: "from " };
14949
+ });
14950
+ function ImpliedFrom(ctx, state2) {
14951
+ return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
14952
+ }
14901
14953
  var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L124, 'ImportAssertion "with"'), (0, import_lib4.$EXPECT)($L125, 'ImportAssertion "assert"')), NonIdContinue, (0, import_lib4.$E)(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14902
14954
  var keyword = $2;
14903
14955
  var object = $5;
@@ -15030,7 +15082,7 @@ var UnprocessedModuleSpecifier$$ = [UnprocessedModuleSpecifier$0, UnprocessedMod
15030
15082
  function UnprocessedModuleSpecifier(ctx, state2) {
15031
15083
  return (0, import_lib4.$EVENT_C)(ctx, state2, "UnprocessedModuleSpecifier", UnprocessedModuleSpecifier$$);
15032
15084
  }
15033
- var UnquotedSpecifier$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($R32, 'UnquotedSpecifier /[^;"\\s]+/'), function($skip, $loc, $0, $1) {
15085
+ var UnquotedSpecifier$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($R32, 'UnquotedSpecifier /[^;"\\s=>]+/'), function($skip, $loc, $0, $1) {
15034
15086
  var spec = $0;
15035
15087
  return { $loc, token: `"${spec}"` };
15036
15088
  });
@@ -15083,13 +15135,26 @@ var ExportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_li
15083
15135
  return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
15084
15136
  });
15085
15137
  var ExportDeclaration$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(Export, __, ExportFromClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15086
- return { type: "ExportDeclaration", ts: $3.ts, children: $0 };
15138
+ var exports2 = $3;
15139
+ return { type: "ExportDeclaration", ts: exports2.ts, children: $0 };
15140
+ });
15141
+ var ExportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Export, __, ExportFromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15142
+ var from = $1;
15143
+ var fws = $2;
15144
+ var e = $3;
15145
+ var ews = $4;
15146
+ var exports2 = $5;
15147
+ return {
15148
+ type: "ExportDeclaration",
15149
+ ts: exports2.ts,
15150
+ children: [e, ews, exports2, " ", from, trimFirstSpace(fws)]
15151
+ };
15087
15152
  });
15088
- var ExportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(Decorators), Export, __, (0, import_lib4.$C)(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
15153
+ var ExportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(Decorators), Export, __, (0, import_lib4.$C)(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
15089
15154
  var declaration = $4;
15090
15155
  return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
15091
15156
  });
15092
- var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3, ExportDeclaration$4];
15157
+ var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3, ExportDeclaration$4, ExportDeclaration$5];
15093
15158
  function ExportDeclaration(ctx, state2) {
15094
15159
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ExportDeclaration", ExportDeclaration$$);
15095
15160
  }
package/dist/main.mjs CHANGED
@@ -7713,6 +7713,8 @@ var grammar = {
7713
7713
  NamedImports,
7714
7714
  OperatorNamedImports,
7715
7715
  FromClause,
7716
+ ImpliedFromClause,
7717
+ ImpliedFrom,
7716
7718
  ImportAssertion,
7717
7719
  TypeAndImportSpecifier,
7718
7720
  ImportSpecifier,
@@ -8397,7 +8399,7 @@ var $R28 = (0, import_lib4.$R)(new RegExp("(?!\\+\\+|--)[!~+-](?!\\s)", "suy"));
8397
8399
  var $R29 = (0, import_lib4.$R)(new RegExp("[:.]", "suy"));
8398
8400
  var $R30 = (0, import_lib4.$R)(new RegExp("(?=for|if|loop|unless|until|while)", "suy"));
8399
8401
  var $R31 = (0, import_lib4.$R)(new RegExp("(?=loop|comptime|do|for|until|while)", "suy"));
8400
- var $R32 = (0, import_lib4.$R)(new RegExp('[^;"\\s]+', "suy"));
8402
+ var $R32 = (0, import_lib4.$R)(new RegExp('[^;"\\s=>]+', "suy"));
8401
8403
  var $R33 = (0, import_lib4.$R)(new RegExp("(?=[0-9.])", "suy"));
8402
8404
  var $R34 = (0, import_lib4.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)n", "suy"));
8403
8405
  var $R35 = (0, import_lib4.$R)(new RegExp("(?:0|[1-9](?:_[0-9]|[0-9])*)(?=\\.(?:\\p{ID_Start}|[_$]))", "suy"));
@@ -9906,14 +9908,22 @@ var CallExpression$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Super, Arguments
9906
9908
  var CallExpression$1 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, NamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9907
9909
  return dynamizeImportDeclarationExpression($0);
9908
9910
  });
9909
- var CallExpression$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9911
+ var CallExpression$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(FromClause, __, Import, _, NamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
9912
+ var from = $1;
9913
+ var fws = $2;
9914
+ var i = $3;
9915
+ var iws = $4;
9916
+ var imports = $5;
9917
+ return dynamizeImportDeclarationExpression([i, iws, imports, fws, from]);
9918
+ });
9919
+ var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$EXPECT)($L15, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9910
9920
  var rest = $3;
9911
9921
  return processCallMemberExpression({
9912
9922
  type: "CallExpression",
9913
9923
  children: [$1, ...$2, ...rest.flat()]
9914
9924
  });
9915
9925
  });
9916
- var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression, AllowedTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9926
+ var CallExpression$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression, AllowedTrailingMemberExpressions, (0, import_lib4.$Q)(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
9917
9927
  var member = $1;
9918
9928
  var trailing = $2;
9919
9929
  var rest = $3;
@@ -9926,7 +9936,7 @@ var CallExpression$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(MemberExpression
9926
9936
  }
9927
9937
  return member;
9928
9938
  });
9929
- var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2, CallExpression$3];
9939
+ var CallExpression$$ = [CallExpression$0, CallExpression$1, CallExpression$2, CallExpression$3, CallExpression$4];
9930
9940
  function CallExpression(ctx, state2) {
9931
9941
  return (0, import_lib4.$EVENT_C)(ctx, state2, "CallExpression", CallExpression$$);
9932
9942
  }
@@ -13956,9 +13966,12 @@ var ForBinding$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)(
13956
13966
  function ForBinding(ctx, state2) {
13957
13967
  return (0, import_lib4.$EVENT)(ctx, state2, "ForBinding", ForBinding$0);
13958
13968
  }
13959
- var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, (0, import_lib4.$C)(EmptyCondition, Condition), CaseBlock), function($skip, $loc, $0, $1, $2, $3) {
13960
- var condition = $2;
13961
- var caseBlock = $3;
13969
+ var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, ForbidNewlineBinaryOp, (0, import_lib4.$E)((0, import_lib4.$C)(EmptyCondition, Condition)), RestoreNewlineBinaryOp, CaseBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
13970
+ var s = $1;
13971
+ var condition = $3;
13972
+ var caseBlock = $5;
13973
+ if (!condition)
13974
+ return $skip;
13962
13975
  if (condition.type === "EmptyCondition") {
13963
13976
  caseBlock.clauses.forEach(({ cases }) => {
13964
13977
  if (cases) {
@@ -13978,7 +13991,8 @@ var SwitchStatement$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Switch, (0, imp
13978
13991
  }
13979
13992
  return {
13980
13993
  type: "SwitchStatement",
13981
- children: $0,
13994
+ children: [s, condition, caseBlock],
13995
+ // omit NewlineBinaryOp control
13982
13996
  condition,
13983
13997
  caseBlock
13984
13998
  };
@@ -14346,8 +14360,8 @@ var SingleLineExpressionWithIndentedApplicationForbidden$0 = (0, import_lib4.$TS
14346
14360
  function SingleLineExpressionWithIndentedApplicationForbidden(ctx, state2) {
14347
14361
  return (0, import_lib4.$EVENT)(ctx, state2, "SingleLineExpressionWithIndentedApplicationForbidden", SingleLineExpressionWithIndentedApplicationForbidden$0);
14348
14362
  }
14349
- var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidNewlineBinaryOp, (0, import_lib4.$E)(Expression), RestoreNewlineBinaryOp, RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14350
- var exp = $4;
14363
+ var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(ForbidBracedApplication, ForbidIndentedApplication, (0, import_lib4.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14364
+ var exp = $3;
14351
14365
  if (exp)
14352
14366
  return exp;
14353
14367
  return $skip;
@@ -14736,36 +14750,41 @@ var ImportDeclaration$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, _, Id
14736
14750
  children: [imp, $0.slice(1)]
14737
14751
  };
14738
14752
  });
14739
- var ImportDeclaration$1 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, TypeKeyword, __, ImportClause, __, FromClause), function(value) {
14740
- var imports = value[4];
14741
- var from = value[6];
14742
- return { "type": "ImportDeclaration", "ts": true, "children": value, "imports": imports, "from": from };
14743
- });
14744
- var ImportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, __, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
14745
- var behavior = $4;
14746
- var imports = $6;
14747
- var from = $8;
14753
+ var ImportDeclaration$1 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$S)(Import, __), ImpliedImport), Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14754
+ var i = $1;
14755
+ var behavior = $3;
14756
+ var ws1 = $4;
14757
+ var imports = $5;
14758
+ var ws2 = $6;
14759
+ var from = $7;
14748
14760
  imports.specifiers.forEach((spec) => {
14749
14761
  state.operators.set(spec.binding.name, spec.behavior ?? behavior);
14750
14762
  });
14751
14763
  return {
14752
14764
  type: "ImportDeclaration",
14753
- children: [$1, $2, trimFirstSpace($5), imports, $7, from],
14754
- // omit $3 = Operator and $4 = OperatorBehavior
14765
+ children: [i, trimFirstSpace(ws1), imports, ws2, from],
14766
+ // omit $2 = Operator and $3 = OperatorBehavior
14755
14767
  imports,
14756
14768
  from
14757
14769
  };
14758
14770
  });
14759
- var ImportDeclaration$3 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ImportClause, __, FromClause), function(value) {
14760
- var imports = value[2];
14761
- var from = value[4];
14762
- return { "type": "ImportDeclaration", "children": value, "imports": imports, "from": from };
14771
+ var ImportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)(Import, __, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
14772
+ var t = $3;
14773
+ var imports = $4;
14774
+ var from = $6;
14775
+ return {
14776
+ type: "ImportDeclaration",
14777
+ children: $0,
14778
+ imports,
14779
+ from,
14780
+ ts: !!t
14781
+ };
14763
14782
  });
14764
- var ImportDeclaration$4 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ModuleSpecifier), function(value) {
14783
+ var ImportDeclaration$3 = (0, import_lib4.$T)((0, import_lib4.$S)(Import, __, ModuleSpecifier), function(value) {
14765
14784
  var module = value[2];
14766
14785
  return { "type": "ImportDeclaration", "children": value, "module": module };
14767
14786
  });
14768
- var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14787
+ var ImportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14769
14788
  var i = $1;
14770
14789
  var t = $2;
14771
14790
  var imports = $3;
@@ -14778,22 +14797,40 @@ var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport
14778
14797
  const children = [i, t, imports, w, from];
14779
14798
  return { type: "ImportDeclaration", ts: !!t, children, imports, from };
14780
14799
  });
14781
- var ImportDeclaration$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedImport, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
14782
- var i = $1;
14783
- var behavior = $3;
14784
- var imports = $5;
14785
- var from = $7;
14800
+ var ImportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Import, __, Operator, (0, import_lib4.$E)(OperatorBehavior), __, OperatorNamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
14801
+ var from = $1;
14802
+ var fws = $2;
14803
+ var i = $3;
14804
+ var iws = $4;
14805
+ var behavior = $6;
14806
+ var ows = $7;
14807
+ var imports = $8;
14786
14808
  imports.specifiers.forEach((spec) => {
14787
14809
  state.operators.set(spec.binding.name, spec.behavior ?? behavior);
14788
14810
  });
14789
14811
  return {
14790
14812
  type: "ImportDeclaration",
14791
- children: [$1, trimFirstSpace($4), imports, $6, from],
14792
- // omit $2 = Operator and $3 = OperatorBehavior
14813
+ children: [i, iws, trimFirstSpace(ows), imports, fws, from],
14814
+ // omit Operator and OperatorBehavior
14793
14815
  imports,
14794
14816
  from
14795
14817
  };
14796
14818
  });
14819
+ var ImportDeclaration$6 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Import, __, (0, import_lib4.$E)((0, import_lib4.$S)(TypeKeyword, __)), ImportClause), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
14820
+ var from = $1;
14821
+ var fws = $2;
14822
+ var i = $3;
14823
+ var iws = $4;
14824
+ var t = $5;
14825
+ var imports = $6;
14826
+ return {
14827
+ type: "ImportDeclaration",
14828
+ children: [i, iws, t, imports, fws, from],
14829
+ imports,
14830
+ from,
14831
+ ts: !!t
14832
+ };
14833
+ });
14797
14834
  var ImportDeclaration$$ = [ImportDeclaration$0, ImportDeclaration$1, ImportDeclaration$2, ImportDeclaration$3, ImportDeclaration$4, ImportDeclaration$5, ImportDeclaration$6];
14798
14835
  function ImportDeclaration(ctx, state2) {
14799
14836
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ImportDeclaration", ImportDeclaration$$);
@@ -14878,6 +14915,21 @@ var FromClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)(From, __, ModuleSpec
14878
14915
  function FromClause(ctx, state2) {
14879
14916
  return (0, import_lib4.$EVENT)(ctx, state2, "FromClause", FromClause$0);
14880
14917
  }
14918
+ var ImpliedFromClause$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$C)((0, import_lib4.$S)(From, __), ImpliedFrom), ModuleSpecifier), function($skip, $loc, $0, $1, $2) {
14919
+ var module = $2;
14920
+ if (!Array.isArray(module))
14921
+ return $0;
14922
+ return [$1, ...module];
14923
+ });
14924
+ function ImpliedFromClause(ctx, state2) {
14925
+ return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFromClause", ImpliedFromClause$0);
14926
+ }
14927
+ var ImpliedFrom$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($L0, 'ImpliedFrom ""'), function($skip, $loc, $0, $1) {
14928
+ return { $loc, token: "from " };
14929
+ });
14930
+ function ImpliedFrom(ctx, state2) {
14931
+ return (0, import_lib4.$EVENT)(ctx, state2, "ImpliedFrom", ImpliedFrom$0);
14932
+ }
14881
14933
  var ImportAssertion$0 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(_), (0, import_lib4.$C)((0, import_lib4.$EXPECT)($L124, 'ImportAssertion "with"'), (0, import_lib4.$EXPECT)($L125, 'ImportAssertion "assert"')), NonIdContinue, (0, import_lib4.$E)(_), ObjectLiteral), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
14882
14934
  var keyword = $2;
14883
14935
  var object = $5;
@@ -15010,7 +15062,7 @@ var UnprocessedModuleSpecifier$$ = [UnprocessedModuleSpecifier$0, UnprocessedMod
15010
15062
  function UnprocessedModuleSpecifier(ctx, state2) {
15011
15063
  return (0, import_lib4.$EVENT_C)(ctx, state2, "UnprocessedModuleSpecifier", UnprocessedModuleSpecifier$$);
15012
15064
  }
15013
- var UnquotedSpecifier$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($R32, 'UnquotedSpecifier /[^;"\\s]+/'), function($skip, $loc, $0, $1) {
15065
+ var UnquotedSpecifier$0 = (0, import_lib4.$TV)((0, import_lib4.$EXPECT)($R32, 'UnquotedSpecifier /[^;"\\s=>]+/'), function($skip, $loc, $0, $1) {
15014
15066
  var spec = $0;
15015
15067
  return { $loc, token: `"${spec}"` };
15016
15068
  });
@@ -15063,13 +15115,26 @@ var ExportDeclaration$2 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_li
15063
15115
  return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
15064
15116
  });
15065
15117
  var ExportDeclaration$3 = (0, import_lib4.$TS)((0, import_lib4.$S)(Export, __, ExportFromClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15066
- return { type: "ExportDeclaration", ts: $3.ts, children: $0 };
15118
+ var exports = $3;
15119
+ return { type: "ExportDeclaration", ts: exports.ts, children: $0 };
15120
+ });
15121
+ var ExportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)(ImpliedFromClause, __, Export, __, ExportFromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
15122
+ var from = $1;
15123
+ var fws = $2;
15124
+ var e = $3;
15125
+ var ews = $4;
15126
+ var exports = $5;
15127
+ return {
15128
+ type: "ExportDeclaration",
15129
+ ts: exports.ts,
15130
+ children: [e, ews, exports, " ", from, trimFirstSpace(fws)]
15131
+ };
15067
15132
  });
15068
- var ExportDeclaration$4 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(Decorators), Export, __, (0, import_lib4.$C)(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
15133
+ var ExportDeclaration$5 = (0, import_lib4.$TS)((0, import_lib4.$S)((0, import_lib4.$E)(Decorators), Export, __, (0, import_lib4.$C)(Declaration, VariableStatement, TypeAndNamedExports, ExportVarDec)), function($skip, $loc, $0, $1, $2, $3, $4) {
15069
15134
  var declaration = $4;
15070
15135
  return { type: "ExportDeclaration", declaration, ts: declaration.ts, children: $0 };
15071
15136
  });
15072
- var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3, ExportDeclaration$4];
15137
+ var ExportDeclaration$$ = [ExportDeclaration$0, ExportDeclaration$1, ExportDeclaration$2, ExportDeclaration$3, ExportDeclaration$4, ExportDeclaration$5];
15073
15138
  function ExportDeclaration(ctx, state2) {
15074
15139
  return (0, import_lib4.$EVENT_C)(ctx, state2, "ExportDeclaration", ExportDeclaration$$);
15075
15140
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.8.5",
4
+ "version": "0.8.6",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",
@@ -95,7 +95,7 @@
95
95
  "unplugin": "^1.12.2"
96
96
  },
97
97
  "devDependencies": {
98
- "@danielx/civet": "0.8.4",
98
+ "@danielx/civet": "0.8.5",
99
99
  "@danielx/hera": "^0.8.16",
100
100
  "@prettier/sync": "^0.5.2",
101
101
  "@types/assert": "^1.5.6",