@danielx/civet 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -483,7 +483,7 @@ ${body}`;
483
483
  }
484
484
  });
485
485
 
486
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
486
+ // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
487
487
  var main_civet_exports = {};
488
488
  __export(main_civet_exports, {
489
489
  ParseError: () => import_lib2.ParseError,
@@ -504,7 +504,7 @@ module.exports = __toCommonJS(main_civet_exports);
504
504
  // source/parser.hera
505
505
  var import_lib2 = __toESM(require_machine());
506
506
 
507
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
507
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
508
508
  var lib_civet_exports = {};
509
509
  __export(lib_civet_exports, {
510
510
  addPostfixStatement: () => addPostfixStatement,
@@ -584,7 +584,7 @@ __export(lib_civet_exports, {
584
584
  wrapTypeInPromise: () => wrapTypeInPromise
585
585
  });
586
586
 
587
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\util.civet.jsx
587
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/util.civet.jsx
588
588
  function len(arr, length) {
589
589
  return arr.length === length;
590
590
  }
@@ -1583,7 +1583,7 @@ function flatJoin(array, separator) {
1583
1583
  return result;
1584
1584
  }
1585
1585
 
1586
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\traversal.civet.jsx
1586
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/traversal.civet.jsx
1587
1587
  function gatherRecursiveWithinFunction(node, predicate) {
1588
1588
  return gatherRecursive(node, predicate, isFunction);
1589
1589
  }
@@ -1692,7 +1692,7 @@ function gatherRecursiveAll(node, predicate) {
1692
1692
  return nodes;
1693
1693
  }
1694
1694
 
1695
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\ref.civet.jsx
1695
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/ref.civet.jsx
1696
1696
  var range = (start, end) => {
1697
1697
  const length = end - start;
1698
1698
  if (length <= 0) return [];
@@ -1787,7 +1787,7 @@ function populateRefs(statements) {
1787
1787
  }
1788
1788
  }
1789
1789
 
1790
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\binding.civet.jsx
1790
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/binding.civet.jsx
1791
1791
  function adjustAtBindings(statements, asThis = false) {
1792
1792
  for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "AtBindingProperty"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
1793
1793
  const binding = ref1[i1];
@@ -2054,12 +2054,12 @@ function gatherBindingPatternTypeSuffix(pattern) {
2054
2054
  return pattern;
2055
2055
  }
2056
2056
 
2057
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2057
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2058
2058
  var import_node_path = require("node:path");
2059
2059
  var import_node_module = require("node:module");
2060
2060
  var import_node_vm = __toESM(require("node:vm"));
2061
2061
 
2062
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\helper.civet.jsx
2062
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/helper.civet.jsx
2063
2063
  var preludeVar = "var ";
2064
2064
  function ts(children) {
2065
2065
  return {
@@ -2376,7 +2376,7 @@ function extractPreludeFor(node) {
2376
2376
  }
2377
2377
  }
2378
2378
 
2379
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\generate.civet.jsx
2379
+ // unplugin-civet:/home/daniel/apps/Civet/source/generate.civet.jsx
2380
2380
  function stringify(node) {
2381
2381
  try {
2382
2382
  return JSON.stringify(removeParentPointers(node));
@@ -2486,7 +2486,7 @@ function prune(node) {
2486
2486
  return node;
2487
2487
  }
2488
2488
 
2489
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2489
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2490
2490
  function expressionizeComptime(statement) {
2491
2491
  const { expressions } = statement.block;
2492
2492
  const expression = wrapIIFE(expressions, hasAwait(expressions));
@@ -2807,7 +2807,7 @@ function serialize(value, context) {
2807
2807
  return recurse(value);
2808
2808
  }
2809
2809
 
2810
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\function.civet.jsx
2810
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/function.civet.jsx
2811
2811
  var concatAssign = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
2812
2812
  function getTypeArguments(args) {
2813
2813
  while (typeof args === "object" && args != null && "args" in args) {
@@ -4240,7 +4240,7 @@ function makeAmpersandFunction(rhs) {
4240
4240
  return fn;
4241
4241
  }
4242
4242
 
4243
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\block.civet.jsx
4243
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/block.civet.jsx
4244
4244
  function blockWithPrefix(prefixStatements, block) {
4245
4245
  if (prefixStatements && prefixStatements.length) {
4246
4246
  const expressions = [...prefixStatements, ...block.expressions];
@@ -4461,7 +4461,7 @@ function blockContainingStatement(exp) {
4461
4461
  };
4462
4462
  }
4463
4463
 
4464
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\op.civet.jsx
4464
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/op.civet.jsx
4465
4465
  var precedenceOrder = [
4466
4466
  ["||", "??"],
4467
4467
  ["^^"],
@@ -4797,7 +4797,7 @@ function expandChainedComparisons([first, binops]) {
4797
4797
  }
4798
4798
  }
4799
4799
 
4800
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pattern-matching.civet.jsx
4800
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/pattern-matching.civet.jsx
4801
4801
  function processPatternTest(lhs, patterns) {
4802
4802
  const { ref, refAssignmentComma } = maybeRefAssignment(lhs, "m");
4803
4803
  const conditionExpression = flatJoin(patterns.map(($1) => getPatternConditions($1, ref)).map(($2) => flatJoin($2, " && ")), " || ");
@@ -5316,7 +5316,7 @@ function aliasBinding(p, ref) {
5316
5316
  }
5317
5317
  }
5318
5318
 
5319
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\declaration.civet.jsx
5319
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/declaration.civet.jsx
5320
5320
  function len2(arr, length) {
5321
5321
  return arr.length === length;
5322
5322
  }
@@ -5870,7 +5870,7 @@ function convertWithClause(withClause, extendsClause) {
5870
5870
  return [extendsToken, insertTrimmingSpace(ws, " "), wrapped];
5871
5871
  }
5872
5872
 
5873
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\unary.civet.jsx
5873
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/unary.civet.jsx
5874
5874
  function processUnaryExpression(pre, exp, post) {
5875
5875
  if (!(pre.length || post)) {
5876
5876
  return exp;
@@ -6032,7 +6032,7 @@ function processUnaryNestedExpression(pre, args, post) {
6032
6032
  return processUnaryExpression(pre, args, post);
6033
6033
  }
6034
6034
 
6035
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pipe.civet.jsx
6035
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/pipe.civet.jsx
6036
6036
  function constructInvocation(fn, arg) {
6037
6037
  let expr = fn.expr;
6038
6038
  while (expr.type === "ParenthesizedExpression") {
@@ -6255,7 +6255,7 @@ function processPipelineExpressions(statements) {
6255
6255
  }
6256
6256
  }
6257
6257
 
6258
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\for.civet.jsx
6258
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/for.civet.jsx
6259
6259
  function processRangeExpression(start, ws1, range2, end) {
6260
6260
  ws1 = [ws1, range2.children[0]];
6261
6261
  const ws2 = range2.children[1];
@@ -6700,7 +6700,7 @@ function processForInOf($0) {
6700
6700
  };
6701
6701
  }
6702
6702
 
6703
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\auto-dec.civet.jsx
6703
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/auto-dec.civet.jsx
6704
6704
  var concatAssign2 = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
6705
6705
  function findDecs(statements) {
6706
6706
  const declarations = gatherNodes(statements, ($) => $.type === "Declaration");
@@ -6846,7 +6846,7 @@ function createVarDecs(block, scopes, pushVar) {
6846
6846
  scopes.pop();
6847
6847
  }
6848
6848
 
6849
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\string.civet.jsx
6849
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/string.civet.jsx
6850
6850
  function getIndentLevel(str, tab) {
6851
6851
  if (tab != null && tab != 1) {
6852
6852
  const tabs = str.match(/\t/g);
@@ -7014,7 +7014,7 @@ function quoteString(str) {
7014
7014
  return JSON.stringify(str);
7015
7015
  }
7016
7016
 
7017
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
7017
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
7018
7018
  var xor = (a, b) => a ? !b && a : b;
7019
7019
  function addPostfixStatement(statement, ws, post) {
7020
7020
  const expressions = [
@@ -9615,6 +9615,7 @@ var grammar = {
9615
9615
  TypeIndexedAccess,
9616
9616
  UnknownAlias,
9617
9617
  TypePrimary,
9618
+ TypeIdentifier,
9618
9619
  ImportType,
9619
9620
  TypeTuple,
9620
9621
  TypeTupleContent,
@@ -11182,7 +11183,7 @@ var ExtendsClause$0 = (0, import_lib2.$S)(ExtendsToken, __, ExtendsTarget);
11182
11183
  function ExtendsClause(ctx, state2) {
11183
11184
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsClause", ExtendsClause$0);
11184
11185
  }
11185
- var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ExtendsTarget, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11186
+ var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, Expression, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11186
11187
  var targets = $4;
11187
11188
  if (!targets.length) return $skip;
11188
11189
  targets = targets.map(($) => $.slice(0, -1));
@@ -11274,7 +11275,7 @@ var ExtendsTarget$0 = (0, import_lib2.$TV)(LeftHandSideExpressionWithObjectAppli
11274
11275
  function ExtendsTarget(ctx, state2) {
11275
11276
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsTarget", ExtendsTarget$0);
11276
11277
  }
11277
- var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ImplementsTarget, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11278
+ var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, TypeIdentifier, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11278
11279
  var i = $1;
11279
11280
  var targets = $3;
11280
11281
  if (!targets.length) return $skip;
@@ -18402,7 +18403,7 @@ var Yield$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)(
18402
18403
  function Yield(ctx, state2) {
18403
18404
  return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
18404
18405
  }
18405
- var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
18406
+ var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
18406
18407
  const jsx = $2.length === 0 ? $1 : {
18407
18408
  type: "JSXFragment",
18408
18409
  children: [
@@ -19856,7 +19857,20 @@ var TypePrimary$7 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19856
19857
  children: $0
19857
19858
  };
19858
19859
  });
19859
- var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19860
+ var TypePrimary$8 = TypeIdentifier;
19861
+ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19862
+ if (!$4) return $skip;
19863
+ return {
19864
+ type: "TypeParenthesized",
19865
+ children: [$1, $2, $4, $6, $7]
19866
+ // omit AllowAll/RestoreAll
19867
+ };
19868
+ });
19869
+ var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9];
19870
+ function TypePrimary(ctx, state2) {
19871
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19872
+ }
19873
+ var TypeIdentifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19860
19874
  return {
19861
19875
  type: "TypeIdentifier",
19862
19876
  children: $0,
@@ -19864,7 +19878,7 @@ var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19864
19878
  args: void 0
19865
19879
  };
19866
19880
  });
19867
- var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19881
+ var TypeIdentifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19868
19882
  var args = $4;
19869
19883
  return {
19870
19884
  type: "TypeIdentifier",
@@ -19873,17 +19887,9 @@ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19873
19887
  args
19874
19888
  };
19875
19889
  });
19876
- var TypePrimary$10 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19877
- if (!$4) return $skip;
19878
- return {
19879
- type: "TypeParenthesized",
19880
- children: [$1, $2, $4, $6, $7]
19881
- // omit AllowAll/RestoreAll
19882
- };
19883
- });
19884
- var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
19885
- function TypePrimary(ctx, state2) {
19886
- return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19890
+ var TypeIdentifier$$ = [TypeIdentifier$0, TypeIdentifier$1];
19891
+ function TypeIdentifier(ctx, state2) {
19892
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeIdentifier", TypeIdentifier$$);
19887
19893
  }
19888
19894
  var ImportType$0 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), OpenParen, __, StringLiteral, __, CloseParen, (0, import_lib2.$E)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)(TypeArguments));
19889
19895
  var ImportType$1 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), InsertOpenParen, (0, import_lib2.$E)(Trimmed_), StringLiteral, InsertCloseParen);
@@ -21162,7 +21168,7 @@ var wellKnownSymbols = [
21162
21168
  "unscopables"
21163
21169
  ];
21164
21170
 
21165
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\sourcemap.civet.jsx
21171
+ // unplugin-civet:/home/daniel/apps/Civet/source/sourcemap.civet.jsx
21166
21172
  var sourcemap_civet_exports = {};
21167
21173
  __export(sourcemap_civet_exports, {
21168
21174
  SourceMap: () => SourceMap,
@@ -21476,7 +21482,7 @@ var remapPosition = function(position, sourcemapLines) {
21476
21482
  }
21477
21483
  };
21478
21484
 
21479
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\state-cache.civet.jsx
21485
+ // unplugin-civet:/home/daniel/apps/Civet/source/state-cache.civet.jsx
21480
21486
  var StateCache = class {
21481
21487
  cache = /* @__PURE__ */ new Map();
21482
21488
  get(key) {
@@ -21516,7 +21522,7 @@ var StateCache = class {
21516
21522
  }
21517
21523
  };
21518
21524
 
21519
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\worker-pool.civet.jsx
21525
+ // unplugin-civet:/home/daniel/apps/Civet/source/worker-pool.civet.jsx
21520
21526
  var WorkerPool = class {
21521
21527
  idle;
21522
21528
  spawned;
@@ -21612,7 +21618,7 @@ var WorkerPool = class {
21612
21618
  }
21613
21619
  };
21614
21620
 
21615
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
21621
+ // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
21616
21622
  var { SourceMap: SourceMap2 } = sourcemap_civet_exports;
21617
21623
  var ParseErrors = class extends Error {
21618
21624
  name = "ParseErrors";
package/dist/main.mjs CHANGED
@@ -485,7 +485,7 @@ ${body}`;
485
485
  // source/parser.hera
486
486
  var import_lib2 = __toESM(require_machine());
487
487
 
488
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
488
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
489
489
  var lib_civet_exports = {};
490
490
  __export(lib_civet_exports, {
491
491
  addPostfixStatement: () => addPostfixStatement,
@@ -565,7 +565,7 @@ __export(lib_civet_exports, {
565
565
  wrapTypeInPromise: () => wrapTypeInPromise
566
566
  });
567
567
 
568
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\util.civet.jsx
568
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/util.civet.jsx
569
569
  function len(arr, length) {
570
570
  return arr.length === length;
571
571
  }
@@ -1564,7 +1564,7 @@ function flatJoin(array, separator) {
1564
1564
  return result;
1565
1565
  }
1566
1566
 
1567
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\traversal.civet.jsx
1567
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/traversal.civet.jsx
1568
1568
  function gatherRecursiveWithinFunction(node, predicate) {
1569
1569
  return gatherRecursive(node, predicate, isFunction);
1570
1570
  }
@@ -1673,7 +1673,7 @@ function gatherRecursiveAll(node, predicate) {
1673
1673
  return nodes;
1674
1674
  }
1675
1675
 
1676
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\ref.civet.jsx
1676
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/ref.civet.jsx
1677
1677
  var range = (start, end) => {
1678
1678
  const length = end - start;
1679
1679
  if (length <= 0) return [];
@@ -1768,7 +1768,7 @@ function populateRefs(statements) {
1768
1768
  }
1769
1769
  }
1770
1770
 
1771
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\binding.civet.jsx
1771
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/binding.civet.jsx
1772
1772
  function adjustAtBindings(statements, asThis = false) {
1773
1773
  for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "AtBindingProperty"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
1774
1774
  const binding = ref1[i1];
@@ -2035,12 +2035,12 @@ function gatherBindingPatternTypeSuffix(pattern) {
2035
2035
  return pattern;
2036
2036
  }
2037
2037
 
2038
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2038
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2039
2039
  import { resolve, dirname } from "node:path";
2040
2040
  import { createRequire } from "node:module";
2041
2041
  import vm from "node:vm";
2042
2042
 
2043
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\helper.civet.jsx
2043
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/helper.civet.jsx
2044
2044
  var preludeVar = "var ";
2045
2045
  function ts(children) {
2046
2046
  return {
@@ -2357,7 +2357,7 @@ function extractPreludeFor(node) {
2357
2357
  }
2358
2358
  }
2359
2359
 
2360
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\generate.civet.jsx
2360
+ // unplugin-civet:/home/daniel/apps/Civet/source/generate.civet.jsx
2361
2361
  function stringify(node) {
2362
2362
  try {
2363
2363
  return JSON.stringify(removeParentPointers(node));
@@ -2467,7 +2467,7 @@ function prune(node) {
2467
2467
  return node;
2468
2468
  }
2469
2469
 
2470
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2470
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2471
2471
  function expressionizeComptime(statement) {
2472
2472
  const { expressions } = statement.block;
2473
2473
  const expression = wrapIIFE(expressions, hasAwait(expressions));
@@ -2788,7 +2788,7 @@ function serialize(value, context) {
2788
2788
  return recurse(value);
2789
2789
  }
2790
2790
 
2791
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\function.civet.jsx
2791
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/function.civet.jsx
2792
2792
  var concatAssign = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
2793
2793
  function getTypeArguments(args) {
2794
2794
  while (typeof args === "object" && args != null && "args" in args) {
@@ -4221,7 +4221,7 @@ function makeAmpersandFunction(rhs) {
4221
4221
  return fn;
4222
4222
  }
4223
4223
 
4224
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\block.civet.jsx
4224
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/block.civet.jsx
4225
4225
  function blockWithPrefix(prefixStatements, block) {
4226
4226
  if (prefixStatements && prefixStatements.length) {
4227
4227
  const expressions = [...prefixStatements, ...block.expressions];
@@ -4442,7 +4442,7 @@ function blockContainingStatement(exp) {
4442
4442
  };
4443
4443
  }
4444
4444
 
4445
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\op.civet.jsx
4445
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/op.civet.jsx
4446
4446
  var precedenceOrder = [
4447
4447
  ["||", "??"],
4448
4448
  ["^^"],
@@ -4778,7 +4778,7 @@ function expandChainedComparisons([first, binops]) {
4778
4778
  }
4779
4779
  }
4780
4780
 
4781
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pattern-matching.civet.jsx
4781
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/pattern-matching.civet.jsx
4782
4782
  function processPatternTest(lhs, patterns) {
4783
4783
  const { ref, refAssignmentComma } = maybeRefAssignment(lhs, "m");
4784
4784
  const conditionExpression = flatJoin(patterns.map(($1) => getPatternConditions($1, ref)).map(($2) => flatJoin($2, " && ")), " || ");
@@ -5297,7 +5297,7 @@ function aliasBinding(p, ref) {
5297
5297
  }
5298
5298
  }
5299
5299
 
5300
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\declaration.civet.jsx
5300
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/declaration.civet.jsx
5301
5301
  function len2(arr, length) {
5302
5302
  return arr.length === length;
5303
5303
  }
@@ -5851,7 +5851,7 @@ function convertWithClause(withClause, extendsClause) {
5851
5851
  return [extendsToken, insertTrimmingSpace(ws, " "), wrapped];
5852
5852
  }
5853
5853
 
5854
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\unary.civet.jsx
5854
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/unary.civet.jsx
5855
5855
  function processUnaryExpression(pre, exp, post) {
5856
5856
  if (!(pre.length || post)) {
5857
5857
  return exp;
@@ -6013,7 +6013,7 @@ function processUnaryNestedExpression(pre, args, post) {
6013
6013
  return processUnaryExpression(pre, args, post);
6014
6014
  }
6015
6015
 
6016
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pipe.civet.jsx
6016
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/pipe.civet.jsx
6017
6017
  function constructInvocation(fn, arg) {
6018
6018
  let expr = fn.expr;
6019
6019
  while (expr.type === "ParenthesizedExpression") {
@@ -6236,7 +6236,7 @@ function processPipelineExpressions(statements) {
6236
6236
  }
6237
6237
  }
6238
6238
 
6239
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\for.civet.jsx
6239
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/for.civet.jsx
6240
6240
  function processRangeExpression(start, ws1, range2, end) {
6241
6241
  ws1 = [ws1, range2.children[0]];
6242
6242
  const ws2 = range2.children[1];
@@ -6681,7 +6681,7 @@ function processForInOf($0) {
6681
6681
  };
6682
6682
  }
6683
6683
 
6684
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\auto-dec.civet.jsx
6684
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/auto-dec.civet.jsx
6685
6685
  var concatAssign2 = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
6686
6686
  function findDecs(statements) {
6687
6687
  const declarations = gatherNodes(statements, ($) => $.type === "Declaration");
@@ -6827,7 +6827,7 @@ function createVarDecs(block, scopes, pushVar) {
6827
6827
  scopes.pop();
6828
6828
  }
6829
6829
 
6830
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\string.civet.jsx
6830
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/string.civet.jsx
6831
6831
  function getIndentLevel(str, tab) {
6832
6832
  if (tab != null && tab != 1) {
6833
6833
  const tabs = str.match(/\t/g);
@@ -6995,7 +6995,7 @@ function quoteString(str) {
6995
6995
  return JSON.stringify(str);
6996
6996
  }
6997
6997
 
6998
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
6998
+ // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
6999
6999
  var xor = (a, b) => a ? !b && a : b;
7000
7000
  function addPostfixStatement(statement, ws, post) {
7001
7001
  const expressions = [
@@ -9596,6 +9596,7 @@ var grammar = {
9596
9596
  TypeIndexedAccess,
9597
9597
  UnknownAlias,
9598
9598
  TypePrimary,
9599
+ TypeIdentifier,
9599
9600
  ImportType,
9600
9601
  TypeTuple,
9601
9602
  TypeTupleContent,
@@ -11163,7 +11164,7 @@ var ExtendsClause$0 = (0, import_lib2.$S)(ExtendsToken, __, ExtendsTarget);
11163
11164
  function ExtendsClause(ctx, state2) {
11164
11165
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsClause", ExtendsClause$0);
11165
11166
  }
11166
- var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ExtendsTarget, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11167
+ var WithClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(NotDedented, With, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, Expression, (0, import_lib2.$E)(_), (0, import_lib2.$E)(Comma))), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11167
11168
  var targets = $4;
11168
11169
  if (!targets.length) return $skip;
11169
11170
  targets = targets.map(($) => $.slice(0, -1));
@@ -11255,7 +11256,7 @@ var ExtendsTarget$0 = (0, import_lib2.$TV)(LeftHandSideExpressionWithObjectAppli
11255
11256
  function ExtendsTarget(ctx, state2) {
11256
11257
  return (0, import_lib2.$EVENT)(ctx, state2, "ExtendsTarget", ExtendsTarget$0);
11257
11258
  }
11258
- var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, ImplementsTarget, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11259
+ var ImplementsClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ImplementsToken, PushIndent, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, TypeIdentifier, ArrayBulletDelimiter)), PopIndent), function($skip, $loc, $0, $1, $2, $3, $4) {
11259
11260
  var i = $1;
11260
11261
  var targets = $3;
11261
11262
  if (!targets.length) return $skip;
@@ -18383,7 +18384,7 @@ var Yield$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)(
18383
18384
  function Yield(ctx, state2) {
18384
18385
  return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
18385
18386
  }
18386
- var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, JSXTag))), function($skip, $loc, $0, $1, $2) {
18387
+ var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
18387
18388
  const jsx = $2.length === 0 ? $1 : {
18388
18389
  type: "JSXFragment",
18389
18390
  children: [
@@ -19837,7 +19838,20 @@ var TypePrimary$7 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19837
19838
  children: $0
19838
19839
  };
19839
19840
  });
19840
- var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19841
+ var TypePrimary$8 = TypeIdentifier;
19842
+ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19843
+ if (!$4) return $skip;
19844
+ return {
19845
+ type: "TypeParenthesized",
19846
+ children: [$1, $2, $4, $6, $7]
19847
+ // omit AllowAll/RestoreAll
19848
+ };
19849
+ });
19850
+ var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9];
19851
+ function TypePrimary(ctx, state2) {
19852
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19853
+ }
19854
+ var TypeIdentifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), UnknownAlias), function($skip, $loc, $0, $1, $2) {
19841
19855
  return {
19842
19856
  type: "TypeIdentifier",
19843
19857
  children: $0,
@@ -19845,7 +19859,7 @@ var TypePrimary$8 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19845
19859
  args: void 0
19846
19860
  };
19847
19861
  });
19848
- var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19862
+ var TypeIdentifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), Identifier, (0, import_lib2.$Q)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)((0, import_lib2.$C)(TypeArguments, ImplicitTypeArguments))), function($skip, $loc, $0, $1, $2, $3, $4) {
19849
19863
  var args = $4;
19850
19864
  return {
19851
19865
  type: "TypeIdentifier",
@@ -19854,17 +19868,9 @@ var TypePrimary$9 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)
19854
19868
  args
19855
19869
  };
19856
19870
  });
19857
- var TypePrimary$10 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), OpenParen, AllowAll, (0, import_lib2.$E)((0, import_lib2.$C)(MaybeNestedType, (0, import_lib2.$S)(EOS, Type))), RestoreAll, __, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
19858
- if (!$4) return $skip;
19859
- return {
19860
- type: "TypeParenthesized",
19861
- children: [$1, $2, $4, $6, $7]
19862
- // omit AllowAll/RestoreAll
19863
- };
19864
- });
19865
- var TypePrimary$$ = [TypePrimary$0, TypePrimary$1, TypePrimary$2, TypePrimary$3, TypePrimary$4, TypePrimary$5, TypePrimary$6, TypePrimary$7, TypePrimary$8, TypePrimary$9, TypePrimary$10];
19866
- function TypePrimary(ctx, state2) {
19867
- return (0, import_lib2.$EVENT_C)(ctx, state2, "TypePrimary", TypePrimary$$);
19871
+ var TypeIdentifier$$ = [TypeIdentifier$0, TypeIdentifier$1];
19872
+ function TypeIdentifier(ctx, state2) {
19873
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeIdentifier", TypeIdentifier$$);
19868
19874
  }
19869
19875
  var ImportType$0 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), OpenParen, __, StringLiteral, __, CloseParen, (0, import_lib2.$E)((0, import_lib2.$S)(Dot, IdentifierName)), (0, import_lib2.$E)(TypeArguments));
19870
19876
  var ImportType$1 = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($L15, 'ImportType "import"'), InsertOpenParen, (0, import_lib2.$E)(Trimmed_), StringLiteral, InsertCloseParen);
@@ -21143,7 +21149,7 @@ var wellKnownSymbols = [
21143
21149
  "unscopables"
21144
21150
  ];
21145
21151
 
21146
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\sourcemap.civet.jsx
21152
+ // unplugin-civet:/home/daniel/apps/Civet/source/sourcemap.civet.jsx
21147
21153
  var sourcemap_civet_exports = {};
21148
21154
  __export(sourcemap_civet_exports, {
21149
21155
  SourceMap: () => SourceMap,
@@ -21457,7 +21463,7 @@ var remapPosition = function(position, sourcemapLines) {
21457
21463
  }
21458
21464
  };
21459
21465
 
21460
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\state-cache.civet.jsx
21466
+ // unplugin-civet:/home/daniel/apps/Civet/source/state-cache.civet.jsx
21461
21467
  var StateCache = class {
21462
21468
  cache = /* @__PURE__ */ new Map();
21463
21469
  get(key) {
@@ -21497,7 +21503,7 @@ var StateCache = class {
21497
21503
  }
21498
21504
  };
21499
21505
 
21500
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\worker-pool.civet.jsx
21506
+ // unplugin-civet:/home/daniel/apps/Civet/source/worker-pool.civet.jsx
21501
21507
  var WorkerPool = class {
21502
21508
  idle;
21503
21509
  spawned;
@@ -21599,7 +21605,7 @@ var WorkerPool = class {
21599
21605
  }
21600
21606
  };
21601
21607
 
21602
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
21608
+ // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
21603
21609
  var { SourceMap: SourceMap2 } = sourcemap_civet_exports;
21604
21610
  var ParseErrors = class extends Error {
21605
21611
  name = "ParseErrors";
@@ -1,4 +1,4 @@
1
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\node-worker.civet.jsx
1
+ // unplugin-civet:/home/daniel/apps/Civet/source/node-worker.civet.jsx
2
2
  import { parentPort } from "node:worker_threads";
3
3
  import module from "node:module";
4
4
  try {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\astro.civet.jsx
29
+ // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/astro.civet.jsx
30
30
  var astro_civet_exports = {};
31
31
  __export(astro_civet_exports, {
32
32
  default: () => astro_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\astro.civet.jsx
1
+ // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/astro.civet.jsx
2
2
  import civetUnplugin, {} from "./unplugin.mjs";
3
3
  var astro_civet_default = function(opts = {}) {
4
4
  return {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\esbuild.civet.jsx
29
+ // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/esbuild.civet.jsx
30
30
  var esbuild_civet_exports = {};
31
31
  __export(esbuild_civet_exports, {
32
32
  default: () => esbuild_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\esbuild.civet.jsx
1
+ // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/esbuild.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var esbuild_civet_default = civetUnplugin.esbuild;
4
4
  export {
@@ -0,0 +1,2 @@
1
+ declare const _default: (options: import("./unplugin.js").PluginOptions) => JsPlugin;
2
+ export default _default;