@danielx/civet 0.11.9 → 0.11.10

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
@@ -9536,6 +9536,7 @@ var grammar = {
9536
9536
  ImplicitAccessStart,
9537
9537
  PropertyAccessModifier,
9538
9538
  PropertyAccess,
9539
+ AccessLiteral,
9539
9540
  ExplicitPropertyGlob,
9540
9541
  PropertyGlob,
9541
9542
  PropertyBind,
@@ -15564,13 +15565,14 @@ function ClassElement$0($$ctx, $$state) {
15564
15565
  }
15565
15566
  if ($$ctx.tokenize) return $$r;
15566
15567
  const $$loc = $$r.loc, $$value = $$r.value;
15567
- const $$m = /* @__PURE__ */ (function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
15568
+ const $$m = (function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
15568
15569
  var decorators = $2;
15569
15570
  var declare = $3;
15570
15571
  var access = $4;
15571
15572
  var static_ = $5;
15572
15573
  var override = $6;
15573
15574
  var assignment = $7;
15575
+ if (assignment.assigned?.type === "SymbolLiteral") return $skip;
15574
15576
  return {
15575
15577
  type: static_ ? "CoffeeClassPublic" : "CoffeeClassPrivate",
15576
15578
  children: [decorators, declare, access, static_, override, assignment],
@@ -17409,7 +17411,7 @@ function PropertyAccessModifier($$ctx, $$state) {
17409
17411
  if ($$ctx.exit) $$ctx.exit("PropertyAccessModifier", $$state, $$final, $$eventData);
17410
17412
  return $$final;
17411
17413
  }
17412
- var PropertyAccess$0$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$C)(TemplateLiteral, StringLiteral, IntegerLiteral, SymbolLiteral));
17414
+ var PropertyAccess$0$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$C)(TemplateLiteral, AccessLiteral, SymbolLiteral));
17413
17415
  var PropertyAccess$1$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$EXPECT)($L22, 'PropertyAccess "-"'), IntegerLiteral);
17414
17416
  var PropertyAccess$2$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$Q)(InlineComment), (0, import_lib2.$C)(IdentifierName, PrivateIdentifier, LengthShorthand));
17415
17417
  var PropertyAccess$3$parser = (0, import_lib2.$S)(ExplicitAccessStart, (0, import_lib2.$Y)(EOS));
@@ -17424,12 +17426,14 @@ function PropertyAccess$0($$ctx, $$state) {
17424
17426
  const $$loc = $$r.loc, $$value = $$r.value;
17425
17427
  const $$m = (function($skip, $loc, $0, $1, $2) {
17426
17428
  var dot = $1;
17427
- var literal = $2;
17429
+ var expression = $2;
17428
17430
  return {
17429
17431
  type: "Index",
17432
+ expression,
17430
17433
  children: [
17431
17434
  adjustIndexAccess(dot),
17432
- literal,
17435
+ expression,
17436
+ "",
17433
17437
  "]"
17434
17438
  ]
17435
17439
  };
@@ -17487,12 +17491,21 @@ function PropertyAccess$2($$ctx, $$state) {
17487
17491
  var comments = $2;
17488
17492
  var id = $3;
17489
17493
  if (id.unicode) {
17494
+ const key = propertyKey(id);
17495
+ const expression = {
17496
+ type: "Literal",
17497
+ subtype: "StringLiteral",
17498
+ children: [key],
17499
+ raw: key.token
17500
+ };
17490
17501
  return {
17491
17502
  type: "Index",
17503
+ expression,
17492
17504
  children: [
17493
17505
  adjustIndexAccess(dot),
17494
17506
  ...comments,
17495
- propertyKey(id),
17507
+ expression,
17508
+ "",
17496
17509
  "]"
17497
17510
  ]
17498
17511
  };
@@ -17626,6 +17639,40 @@ function PropertyAccess($$ctx, $$state) {
17626
17639
  if ($$ctx.exit) $$ctx.exit("PropertyAccess", $$state, $$final, $$eventData);
17627
17640
  return $$final;
17628
17641
  }
17642
+ var AccessLiteral$parser = (0, import_lib2.$C)(StringLiteral, IntegerLiteral);
17643
+ function AccessLiteral($$ctx, $$state) {
17644
+ const $$entered = $$ctx.enter && $$ctx.enter("AccessLiteral", $$state);
17645
+ if ($$entered && "cache" in $$entered) return $$entered.cache;
17646
+ const $$eventData = $$entered && $$entered.data;
17647
+ const $$r = AccessLiteral$parser($$ctx, $$state);
17648
+ if (!$$r) {
17649
+ if ($$ctx.exit) $$ctx.exit("AccessLiteral", $$state, void 0, $$eventData);
17650
+ return void 0;
17651
+ }
17652
+ if ($$ctx.tokenize) {
17653
+ const $$tok = $$r;
17654
+ $$tok.value = { type: "AccessLiteral", children: [$$r.value].flat(), token: $$state.input.substring($$state.pos, $$r.pos), loc: $$r.loc };
17655
+ if ($$ctx.exit) $$ctx.exit("AccessLiteral", $$state, $$tok, $$eventData);
17656
+ return $$tok;
17657
+ }
17658
+ const $$loc = $$r.loc, $$value = $$r.value;
17659
+ const $$m = (function($skip, $loc, $0, $1) {
17660
+ var literal = $0;
17661
+ return {
17662
+ type: "Literal",
17663
+ subtype: literal.type,
17664
+ children: [literal],
17665
+ raw: literal.token
17666
+ };
17667
+ })(import_lib2.SKIP, $$loc, $$value, $$value);
17668
+ let $$final = void 0;
17669
+ if ($$m !== import_lib2.SKIP) {
17670
+ $$r.value = $$m;
17671
+ $$final = $$r;
17672
+ }
17673
+ if ($$ctx.exit) $$ctx.exit("AccessLiteral", $$state, $$final, $$eventData);
17674
+ return $$final;
17675
+ }
17629
17676
  var ExplicitPropertyGlob$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(ExplicitAccessStart), PropertyGlob);
17630
17677
  function ExplicitPropertyGlob($$ctx, $$state) {
17631
17678
  const $$entered = $$ctx.enter && $$ctx.enter("ExplicitPropertyGlob", $$state);
@@ -34220,7 +34267,7 @@ function IntegerLiteral($$ctx, $$state) {
34220
34267
  const $$loc = $$r.loc, $$value = $$r.value;
34221
34268
  const $$m = /* @__PURE__ */ (function($skip, $loc, $0, $1, $2) {
34222
34269
  var token = $2;
34223
- return { $loc, token };
34270
+ return { type: "NumericLiteral", $loc, token };
34224
34271
  })(import_lib2.SKIP, $$loc, $$value, $$value[0], $$value[1]);
34225
34272
  let $$final = void 0;
34226
34273
  if ($$m !== import_lib2.SKIP) {
@@ -35381,11 +35428,11 @@ function TemplateBlockCharacters($$ctx, $$state) {
35381
35428
  if ($$ctx.exit) $$ctx.exit("TemplateBlockCharacters", $$state, $$final, $$eventData);
35382
35429
  return $$final;
35383
35430
  }
35384
- var ReservedWord$0$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R67, "ReservedWord /(?:off|yes|on|no)/"), NonIdContinue, CoffeeBooleansEnabled);
35385
- var ReservedWord$1$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R68, "ReservedWord /isnt/"), NonIdContinue, CoffeeIsntEnabled);
35386
- var ReservedWord$2$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R69, "ReservedWord /by/"), NonIdContinue, CoffeeForLoopsEnabled);
35387
- var ReservedWord$3$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R70, "ReservedWord /of/"), NonIdContinue, CoffeeOfEnabled);
35388
- var ReservedWord$4$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R71, "ReservedWord /(?:instanceof|interface|protected|continue|debugger|function|default|extends|finally|private|delete|export|import|public|return|static|switch|typeof|unless|await|break|catch|class|const|false|super|throw|until|while|yield|case|else|enum|loop|null|this|true|void|with|and|for|let|new|not|try|var|do|if|in|is|or)/"), NonIdContinue);
35431
+ var ReservedWord$0$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R67, "ReservedWord /(?:off|yes|on|no)/")), NonIdContinue, CoffeeBooleansEnabled);
35432
+ var ReservedWord$1$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R68, "ReservedWord /isnt/")), NonIdContinue, CoffeeIsntEnabled);
35433
+ var ReservedWord$2$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R69, "ReservedWord /by/")), NonIdContinue, CoffeeForLoopsEnabled);
35434
+ var ReservedWord$3$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R70, "ReservedWord /of/")), NonIdContinue, CoffeeOfEnabled);
35435
+ var ReservedWord$4$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R71, "ReservedWord /(?:instanceof|interface|protected|continue|debugger|function|default|extends|finally|private|delete|export|import|public|return|static|switch|typeof|unless|await|break|catch|class|const|false|super|throw|until|while|yield|case|else|enum|loop|null|this|true|void|with|and|for|let|new|not|try|var|do|if|in|is|or)/")), NonIdContinue);
35389
35436
  function ReservedWord$0($$ctx, $$state) {
35390
35437
  const $$r = ReservedWord$0$parser($$ctx, $$state);
35391
35438
  if (!$$r) {
package/dist/main.mjs CHANGED
@@ -9515,6 +9515,7 @@ var grammar = {
9515
9515
  ImplicitAccessStart,
9516
9516
  PropertyAccessModifier,
9517
9517
  PropertyAccess,
9518
+ AccessLiteral,
9518
9519
  ExplicitPropertyGlob,
9519
9520
  PropertyGlob,
9520
9521
  PropertyBind,
@@ -15543,13 +15544,14 @@ function ClassElement$0($$ctx, $$state) {
15543
15544
  }
15544
15545
  if ($$ctx.tokenize) return $$r;
15545
15546
  const $$loc = $$r.loc, $$value = $$r.value;
15546
- const $$m = /* @__PURE__ */ (function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
15547
+ const $$m = (function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
15547
15548
  var decorators = $2;
15548
15549
  var declare = $3;
15549
15550
  var access = $4;
15550
15551
  var static_ = $5;
15551
15552
  var override = $6;
15552
15553
  var assignment = $7;
15554
+ if (assignment.assigned?.type === "SymbolLiteral") return $skip;
15553
15555
  return {
15554
15556
  type: static_ ? "CoffeeClassPublic" : "CoffeeClassPrivate",
15555
15557
  children: [decorators, declare, access, static_, override, assignment],
@@ -17388,7 +17390,7 @@ function PropertyAccessModifier($$ctx, $$state) {
17388
17390
  if ($$ctx.exit) $$ctx.exit("PropertyAccessModifier", $$state, $$final, $$eventData);
17389
17391
  return $$final;
17390
17392
  }
17391
- var PropertyAccess$0$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$C)(TemplateLiteral, StringLiteral, IntegerLiteral, SymbolLiteral));
17393
+ var PropertyAccess$0$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$C)(TemplateLiteral, AccessLiteral, SymbolLiteral));
17392
17394
  var PropertyAccess$1$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$EXPECT)($L22, 'PropertyAccess "-"'), IntegerLiteral);
17393
17395
  var PropertyAccess$2$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$Q)(InlineComment), (0, import_lib2.$C)(IdentifierName, PrivateIdentifier, LengthShorthand));
17394
17396
  var PropertyAccess$3$parser = (0, import_lib2.$S)(ExplicitAccessStart, (0, import_lib2.$Y)(EOS));
@@ -17403,12 +17405,14 @@ function PropertyAccess$0($$ctx, $$state) {
17403
17405
  const $$loc = $$r.loc, $$value = $$r.value;
17404
17406
  const $$m = (function($skip, $loc, $0, $1, $2) {
17405
17407
  var dot = $1;
17406
- var literal = $2;
17408
+ var expression = $2;
17407
17409
  return {
17408
17410
  type: "Index",
17411
+ expression,
17409
17412
  children: [
17410
17413
  adjustIndexAccess(dot),
17411
- literal,
17414
+ expression,
17415
+ "",
17412
17416
  "]"
17413
17417
  ]
17414
17418
  };
@@ -17466,12 +17470,21 @@ function PropertyAccess$2($$ctx, $$state) {
17466
17470
  var comments = $2;
17467
17471
  var id = $3;
17468
17472
  if (id.unicode) {
17473
+ const key = propertyKey(id);
17474
+ const expression = {
17475
+ type: "Literal",
17476
+ subtype: "StringLiteral",
17477
+ children: [key],
17478
+ raw: key.token
17479
+ };
17469
17480
  return {
17470
17481
  type: "Index",
17482
+ expression,
17471
17483
  children: [
17472
17484
  adjustIndexAccess(dot),
17473
17485
  ...comments,
17474
- propertyKey(id),
17486
+ expression,
17487
+ "",
17475
17488
  "]"
17476
17489
  ]
17477
17490
  };
@@ -17605,6 +17618,40 @@ function PropertyAccess($$ctx, $$state) {
17605
17618
  if ($$ctx.exit) $$ctx.exit("PropertyAccess", $$state, $$final, $$eventData);
17606
17619
  return $$final;
17607
17620
  }
17621
+ var AccessLiteral$parser = (0, import_lib2.$C)(StringLiteral, IntegerLiteral);
17622
+ function AccessLiteral($$ctx, $$state) {
17623
+ const $$entered = $$ctx.enter && $$ctx.enter("AccessLiteral", $$state);
17624
+ if ($$entered && "cache" in $$entered) return $$entered.cache;
17625
+ const $$eventData = $$entered && $$entered.data;
17626
+ const $$r = AccessLiteral$parser($$ctx, $$state);
17627
+ if (!$$r) {
17628
+ if ($$ctx.exit) $$ctx.exit("AccessLiteral", $$state, void 0, $$eventData);
17629
+ return void 0;
17630
+ }
17631
+ if ($$ctx.tokenize) {
17632
+ const $$tok = $$r;
17633
+ $$tok.value = { type: "AccessLiteral", children: [$$r.value].flat(), token: $$state.input.substring($$state.pos, $$r.pos), loc: $$r.loc };
17634
+ if ($$ctx.exit) $$ctx.exit("AccessLiteral", $$state, $$tok, $$eventData);
17635
+ return $$tok;
17636
+ }
17637
+ const $$loc = $$r.loc, $$value = $$r.value;
17638
+ const $$m = (function($skip, $loc, $0, $1) {
17639
+ var literal = $0;
17640
+ return {
17641
+ type: "Literal",
17642
+ subtype: literal.type,
17643
+ children: [literal],
17644
+ raw: literal.token
17645
+ };
17646
+ })(import_lib2.SKIP, $$loc, $$value, $$value);
17647
+ let $$final = void 0;
17648
+ if ($$m !== import_lib2.SKIP) {
17649
+ $$r.value = $$m;
17650
+ $$final = $$r;
17651
+ }
17652
+ if ($$ctx.exit) $$ctx.exit("AccessLiteral", $$state, $$final, $$eventData);
17653
+ return $$final;
17654
+ }
17608
17655
  var ExplicitPropertyGlob$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(ExplicitAccessStart), PropertyGlob);
17609
17656
  function ExplicitPropertyGlob($$ctx, $$state) {
17610
17657
  const $$entered = $$ctx.enter && $$ctx.enter("ExplicitPropertyGlob", $$state);
@@ -34199,7 +34246,7 @@ function IntegerLiteral($$ctx, $$state) {
34199
34246
  const $$loc = $$r.loc, $$value = $$r.value;
34200
34247
  const $$m = /* @__PURE__ */ (function($skip, $loc, $0, $1, $2) {
34201
34248
  var token = $2;
34202
- return { $loc, token };
34249
+ return { type: "NumericLiteral", $loc, token };
34203
34250
  })(import_lib2.SKIP, $$loc, $$value, $$value[0], $$value[1]);
34204
34251
  let $$final = void 0;
34205
34252
  if ($$m !== import_lib2.SKIP) {
@@ -35360,11 +35407,11 @@ function TemplateBlockCharacters($$ctx, $$state) {
35360
35407
  if ($$ctx.exit) $$ctx.exit("TemplateBlockCharacters", $$state, $$final, $$eventData);
35361
35408
  return $$final;
35362
35409
  }
35363
- var ReservedWord$0$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R67, "ReservedWord /(?:off|yes|on|no)/"), NonIdContinue, CoffeeBooleansEnabled);
35364
- var ReservedWord$1$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R68, "ReservedWord /isnt/"), NonIdContinue, CoffeeIsntEnabled);
35365
- var ReservedWord$2$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R69, "ReservedWord /by/"), NonIdContinue, CoffeeForLoopsEnabled);
35366
- var ReservedWord$3$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R70, "ReservedWord /of/"), NonIdContinue, CoffeeOfEnabled);
35367
- var ReservedWord$4$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R71, "ReservedWord /(?:instanceof|interface|protected|continue|debugger|function|default|extends|finally|private|delete|export|import|public|return|static|switch|typeof|unless|await|break|catch|class|const|false|super|throw|until|while|yield|case|else|enum|loop|null|this|true|void|with|and|for|let|new|not|try|var|do|if|in|is|or)/"), NonIdContinue);
35410
+ var ReservedWord$0$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R67, "ReservedWord /(?:off|yes|on|no)/")), NonIdContinue, CoffeeBooleansEnabled);
35411
+ var ReservedWord$1$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R68, "ReservedWord /isnt/")), NonIdContinue, CoffeeIsntEnabled);
35412
+ var ReservedWord$2$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R69, "ReservedWord /by/")), NonIdContinue, CoffeeForLoopsEnabled);
35413
+ var ReservedWord$3$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R70, "ReservedWord /of/")), NonIdContinue, CoffeeOfEnabled);
35414
+ var ReservedWord$4$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R71, "ReservedWord /(?:instanceof|interface|protected|continue|debugger|function|default|extends|finally|private|delete|export|import|public|return|static|switch|typeof|unless|await|break|catch|class|const|false|super|throw|until|while|yield|case|else|enum|loop|null|this|true|void|with|and|for|let|new|not|try|var|do|if|in|is|or)/")), NonIdContinue);
35368
35415
  function ReservedWord$0($$ctx, $$state) {
35369
35416
  const $$r = ReservedWord$0$parser($$ctx, $$state);
35370
35417
  if (!$$r) {
@@ -21,14 +21,22 @@ __export(ts_diagnostic_exports, {
21
21
  flattenDiagnosticMessageText: () => flattenDiagnosticMessageText,
22
22
  forwardMap: () => forwardMap,
23
23
  remapPosition: () => remapPosition,
24
+ remapPositionStrict: () => remapPositionStrict,
24
25
  remapRange: () => remapRange
25
26
  });
26
27
  module.exports = __toCommonJS(ts_diagnostic_exports);
27
28
  function remapPosition(position, sourcemapLines) {
28
- if (!sourcemapLines) return position;
29
+ if (!sourcemapLines) {
30
+ return position;
31
+ }
32
+ return remapPositionStrict(position, sourcemapLines) ?? walkBack(position, sourcemapLines) ?? position;
33
+ }
34
+ function remapPositionStrict(position, sourcemapLines) {
29
35
  const { line, character } = position;
30
36
  const textLine = sourcemapLines[line];
31
- if (!textLine?.length) return position;
37
+ if (!textLine?.length) {
38
+ return void 0;
39
+ }
32
40
  let i = 0, p = 0, l = textLine.length, lastMapping, lastMappingPosition = 0;
33
41
  while (i < l) {
34
42
  const mapping = textLine[i];
@@ -42,18 +50,42 @@ function remapPosition(position, sourcemapLines) {
42
50
  }
43
51
  i++;
44
52
  }
45
- if (lastMapping) {
46
- const srcLine = lastMapping[2];
47
- const srcChar = lastMapping[3];
48
- const newChar = srcChar + character - lastMappingPosition;
49
- return {
50
- line: srcLine,
51
- character: Math.max(0, newChar)
52
- };
53
- } else {
54
- return position;
53
+ if (!lastMapping) {
54
+ return void 0;
55
55
  }
56
+ const srcLine = lastMapping[2];
57
+ const srcChar = lastMapping[3];
58
+ const newChar = srcChar + character - lastMappingPosition;
59
+ return {
60
+ line: srcLine,
61
+ character: Math.max(0, newChar)
62
+ };
56
63
  }
64
+ const walkBack = function(position, sourcemapLines) {
65
+ for (let i1 = Math.min(position.line, sourcemapLines.length) + -1; i1 >= 0; --i1) {
66
+ const l = i1;
67
+ const prevLine = sourcemapLines[l];
68
+ if (!prevLine?.length) {
69
+ continue;
70
+ }
71
+ let results = void 0;
72
+ for (let i2 = prevLine.length + -1; i2 >= 0; --i2) {
73
+ const i = i2;
74
+ if (!(prevLine[i].length === 4)) continue;
75
+ results = prevLine[i];
76
+ break;
77
+ }
78
+ ;
79
+ const lastMapping = results;
80
+ if (lastMapping) {
81
+ return {
82
+ line: lastMapping[2],
83
+ character: Math.max(0, lastMapping[3])
84
+ };
85
+ }
86
+ }
87
+ return void 0;
88
+ };
57
89
  function remapRange(range, sourcemapLines) {
58
90
  return {
59
91
  start: remapPosition(range.start, sourcemapLines),
@@ -126,5 +158,6 @@ function flattenDiagnosticMessageText(diag, indent = 0) {
126
158
  flattenDiagnosticMessageText,
127
159
  forwardMap,
128
160
  remapPosition,
161
+ remapPositionStrict,
129
162
  remapRange
130
163
  });
@@ -1,8 +1,15 @@
1
1
  function remapPosition(position, sourcemapLines) {
2
- if (!sourcemapLines) return position;
2
+ if (!sourcemapLines) {
3
+ return position;
4
+ }
5
+ return remapPositionStrict(position, sourcemapLines) ?? walkBack(position, sourcemapLines) ?? position;
6
+ }
7
+ function remapPositionStrict(position, sourcemapLines) {
3
8
  const { line, character } = position;
4
9
  const textLine = sourcemapLines[line];
5
- if (!textLine?.length) return position;
10
+ if (!textLine?.length) {
11
+ return void 0;
12
+ }
6
13
  let i = 0, p = 0, l = textLine.length, lastMapping, lastMappingPosition = 0;
7
14
  while (i < l) {
8
15
  const mapping = textLine[i];
@@ -16,18 +23,42 @@ function remapPosition(position, sourcemapLines) {
16
23
  }
17
24
  i++;
18
25
  }
19
- if (lastMapping) {
20
- const srcLine = lastMapping[2];
21
- const srcChar = lastMapping[3];
22
- const newChar = srcChar + character - lastMappingPosition;
23
- return {
24
- line: srcLine,
25
- character: Math.max(0, newChar)
26
- };
27
- } else {
28
- return position;
26
+ if (!lastMapping) {
27
+ return void 0;
29
28
  }
29
+ const srcLine = lastMapping[2];
30
+ const srcChar = lastMapping[3];
31
+ const newChar = srcChar + character - lastMappingPosition;
32
+ return {
33
+ line: srcLine,
34
+ character: Math.max(0, newChar)
35
+ };
30
36
  }
37
+ const walkBack = function(position, sourcemapLines) {
38
+ for (let i1 = Math.min(position.line, sourcemapLines.length) + -1; i1 >= 0; --i1) {
39
+ const l = i1;
40
+ const prevLine = sourcemapLines[l];
41
+ if (!prevLine?.length) {
42
+ continue;
43
+ }
44
+ let results = void 0;
45
+ for (let i2 = prevLine.length + -1; i2 >= 0; --i2) {
46
+ const i = i2;
47
+ if (!(prevLine[i].length === 4)) continue;
48
+ results = prevLine[i];
49
+ break;
50
+ }
51
+ ;
52
+ const lastMapping = results;
53
+ if (lastMapping) {
54
+ return {
55
+ line: lastMapping[2],
56
+ character: Math.max(0, lastMapping[3])
57
+ };
58
+ }
59
+ }
60
+ return void 0;
61
+ };
31
62
  function remapRange(range, sourcemapLines) {
32
63
  return {
33
64
  start: remapPosition(range.start, sourcemapLines),
@@ -99,5 +130,6 @@ export {
99
130
  flattenDiagnosticMessageText,
100
131
  forwardMap,
101
132
  remapPosition,
133
+ remapPositionStrict,
102
134
  remapRange
103
135
  };
@@ -223,7 +223,26 @@ function parseTsConfigForCivet(projectPath, transpilers, options = {}) {
223
223
  } else ref2 = system;
224
224
  const configSys = ref2;
225
225
  const tsConfigPath = import_node_path2.default.join(projectPath, "tsconfig.json");
226
- const config = options.tsConfig ?? import_typescript4.default.readConfigFile(tsConfigPath, system.readFile).config;
226
+ let config;
227
+ let configFound;
228
+ if (options.tsConfig != null) {
229
+ config = options.tsConfig;
230
+ configFound = true;
231
+ } else {
232
+ configFound = system.fileExists(tsConfigPath);
233
+ let ref3;
234
+ if (configFound) {
235
+ ref3 = import_typescript4.default.readConfigFile(tsConfigPath, system.readFile).config;
236
+ } else {
237
+ if (extraExtensions.length > 0) {
238
+ ref3 = { include: extraExtensions.map((ext) => `**/*${ext}`) };
239
+ } else {
240
+ ref3 = {};
241
+ }
242
+ }
243
+ ;
244
+ config = ref3;
245
+ }
227
246
  const parsed = import_typescript4.default.parseJsonConfigFileContent(
228
247
  config,
229
248
  configSys,
@@ -235,6 +254,7 @@ function parseTsConfigForCivet(projectPath, transpilers, options = {}) {
235
254
  parsed.options.allowNonTsExtensions ??= true;
236
255
  parsed.options.jsx ??= import_typescript4.default.JsxEmit.Preserve;
237
256
  parsed.options.rootDir ??= projectPath;
257
+ parsed.configFound = configFound;
238
258
  return parsed;
239
259
  }
240
260
 
@@ -695,6 +715,7 @@ function TSService(projectPath, options) {
695
715
  };
696
716
  return Object.assign({}, service, {
697
717
  host,
718
+ configFound: parsedConfig.configFound,
698
719
  /** `foo.civet.tsx` → `foo.civet`; passthrough for non-transpiled files. */
699
720
  getSourceFileName(fileName) {
700
721
  return getCanonicalFileName(remapFileName(fileName, transpilers));