@danielx/civet 0.11.8 → 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/CHANGELOG.md CHANGED
@@ -4,36 +4,61 @@ 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.11.10 (2026-05-18, [diff](https://github.com/DanielXMoore/Civet/compare/v0.11.9...v0.11.10), [commits](https://github.com/DanielXMoore/Civet/commits/v0.11.10))
8
+ * Coverage: re-enable `--parallel` for test runs [[#2064](https://github.com/DanielXMoore/Civet/pull/2064)]
9
+ * LSP: implement workspace/symbol [[#2049](https://github.com/DanielXMoore/Civet/pull/2049)]
10
+ * Fix reserved word ref creation [[#2076](https://github.com/DanielXMoore/Civet/pull/2076)]
11
+ * Dev: add `pnpm test:grep` script and document bootstrapping binaries [[#2079](https://github.com/DanielXMoore/Civet/pull/2079)]
12
+ * Coffee classes: backtrack on `:symbol` LHS so `[Symbol.x]` wraps [[#2077](https://github.com/DanielXMoore/Civet/pull/2077)]
13
+ * LSP: fix missing line/column info by unwrapping ParseErrors [[#2075](https://github.com/DanielXMoore/Civet/pull/2075)]
14
+ * LSP: skip semantic tokens in unmapped TS prelude code [[#2070](https://github.com/DanielXMoore/Civet/pull/2070)]
15
+ * Fix `x.literal` shorthand [[#2074](https://github.com/DanielXMoore/Civet/pull/2074)]
16
+ * LSP: emit semantic tokens for import binding names [[#2071](https://github.com/DanielXMoore/Civet/pull/2071)]
17
+ * Sourcemap: walk back in `remapPosition` when line has no mapping [[#2066](https://github.com/DanielXMoore/Civet/pull/2066)]
18
+ * LSP: warn + narrow scope when project has no tsconfig.json [[#2078](https://github.com/DanielXMoore/Civet/pull/2078)]
19
+ * LSP handlers for `signatureHelp`, `prepareRename`, `documentHighlight`, `typeDefinition`, `implementation`, `foldingRange`, `selectionRange`, `linkedEditingRange` [[#2069](https://github.com/DanielXMoore/Civet/pull/2069)]
20
+
21
+ ## 0.11.9 (2026-05-14, [diff](https://github.com/DanielXMoore/Civet/compare/v0.11.8...v0.11.9), [commits](https://github.com/DanielXMoore/Civet/commits/v0.11.9))
22
+ * Browser LSP: fix `console` types in non-DOM mode [[#2047](https://github.com/DanielXMoore/Civet/pull/2047)]
23
+ * LSP e2e: fix Linux test reliability (Wayland headless + flaky import-completion) [[#2050](https://github.com/DanielXMoore/Civet/pull/2050)]
24
+ * Tests: force V8 coverage flush before mocha worker exit [[#2056](https://github.com/DanielXMoore/Civet/pull/2056)]
25
+ * CI: rolling cache keys + prune stale entries [[#2057](https://github.com/DanielXMoore/Civet/pull/2057)]
26
+ * Fix Unicode property names in `@`-bind, `::` prototype access, `:` symbol shorthand [[#2055](https://github.com/DanielXMoore/Civet/pull/2055)]
27
+ * Coverage: eliminate flakiness from parallel mocha + dual-compile [[#2060](https://github.com/DanielXMoore/Civet/pull/2060)]
28
+ * Restore leaf-glom fallback in `prepend` [[#2059](https://github.com/DanielXMoore/Civet/pull/2059)]
29
+ * Upgrade Prettier, add `civet.dev` workspace [[#2063](https://github.com/DanielXMoore/Civet/pull/2063)]
30
+ * Fix: unwrap if/then/else assignment to ternary without ref [[#2054](https://github.com/DanielXMoore/Civet/pull/2054)]
31
+
7
32
  ## 0.11.8 (2026-05-13, [diff](https://github.com/DanielXMoore/Civet/compare/v0.11.7...v0.11.8), [commits](https://github.com/DanielXMoore/Civet/commits/v0.11.8))
8
- * Dev: Autopublish vsce and ovsx from GitHub CI [[#1963](https://github.com/DanielXMoore/Civet/pull/1963)]
9
- * dev: show-uncovered script at root [[#1966](https://github.com/DanielXMoore/Civet/pull/1966)]
10
- * ci: upgrade claude; track output in s3 [[#1975](https://github.com/DanielXMoore/Civet/pull/1975)]
11
- * lsp: auto-reload TSService when tsconfig.json changes [[#1965](https://github.com/DanielXMoore/Civet/pull/1965)]
12
- * dev: coverage template and branch coverage report [[#1971](https://github.com/DanielXMoore/Civet/pull/1971)]
33
+ * Dev: autopublish vsce and ovsx from GitHub CI [[#1963](https://github.com/DanielXMoore/Civet/pull/1963)]
34
+ * Dev: show-uncovered script at root [[#1966](https://github.com/DanielXMoore/Civet/pull/1966)]
35
+ * CI: upgrade Claude; track output in S3 [[#1975](https://github.com/DanielXMoore/Civet/pull/1975)]
36
+ * LSP: auto-reload TSService when tsconfig.json changes [[#1965](https://github.com/DanielXMoore/Civet/pull/1965)]
37
+ * Dev: coverage template and branch coverage report [[#1971](https://github.com/DanielXMoore/Civet/pull/1971)]
13
38
  * Remove legacy esbuild-plugin; JS output extensions imply --js [[#1976](https://github.com/DanielXMoore/Civet/pull/1976)]
14
39
  * Coverage: 100% for generate.civet and sourcemap.civet [[#1974](https://github.com/DanielXMoore/Civet/pull/1974)]
15
- * test: increase coverage for compiler core (main, config, worker-pool, esm) [[#1972](https://github.com/DanielXMoore/Civet/pull/1972)]
40
+ * Test: increase coverage for compiler core (main, config, worker-pool, esm) [[#1972](https://github.com/DanielXMoore/Civet/pull/1972)]
16
41
  * Coverage: unplugin & build plugins — 100% line coverage [[#1973](https://github.com/DanielXMoore/Civet/pull/1973)]
17
- * ci: migrate to codecov [[#1978](https://github.com/DanielXMoore/Civet/pull/1978)]
18
- * ci: batched dot reporter [[#1977](https://github.com/DanielXMoore/Civet/pull/1977)]
19
- * test: increase parser transform coverage to 97% [[#1982](https://github.com/DanielXMoore/Civet/pull/1982)]
20
- * fix: LSP stale diagnostics on close/delete, add protocol test harness [[#1980](https://github.com/DanielXMoore/Civet/pull/1980)]
21
- * test(cli): add coverage for piped stdin, --config, --typecheck [[#1981](https://github.com/DanielXMoore/Civet/pull/1981)]
42
+ * CI: migrate to Codecov [[#1978](https://github.com/DanielXMoore/Civet/pull/1978)]
43
+ * CI: batched dot reporter [[#1977](https://github.com/DanielXMoore/Civet/pull/1977)]
44
+ * Test: increase parser transform coverage to 97% [[#1982](https://github.com/DanielXMoore/Civet/pull/1982)]
45
+ * Fix LSP stale diagnostics on close/delete, add protocol test harness [[#1980](https://github.com/DanielXMoore/Civet/pull/1980)]
46
+ * Test (CLI): add coverage for piped stdin, --config, --typecheck [[#1981](https://github.com/DanielXMoore/Civet/pull/1981)]
22
47
  * Test coverage for CLI and REPL [[#1983](https://github.com/DanielXMoore/Civet/pull/1983)]
23
48
  * Reforbid comma in `:=` shorthand [[#1987](https://github.com/DanielXMoore/Civet/pull/1987)]
24
49
  * Preserve quotes in method signature names [[#1989](https://github.com/DanielXMoore/Civet/pull/1989)]
25
50
  * Fix `case` list with newline before comma [[#1991](https://github.com/DanielXMoore/Civet/pull/1991)]
26
- * add helix config details [[#1992](https://github.com/DanielXMoore/Civet/pull/1992)]
51
+ * Add Helix config details [[#1992](https://github.com/DanielXMoore/Civet/pull/1992)]
27
52
  * Fix `asserts` in interface call signature return type [[#1994](https://github.com/DanielXMoore/Civet/pull/1994)]
28
- * fix: change zed extension grammar repository to github url [[#1996](https://github.com/DanielXMoore/Civet/pull/1996)]
29
- * add pnpm typecheck for .civet + .hera files, refactor types.civet onto shared bases [[#1995](https://github.com/DanielXMoore/Civet/pull/1995)]
30
- * don't lose claude logs when hitting max turns [[#2005](https://github.com/DanielXMoore/Civet/pull/2005)]
53
+ * Zed: point extension grammar repo to GitHub URL [[#1996](https://github.com/DanielXMoore/Civet/pull/1996)]
54
+ * Add `pnpm typecheck` for `.civet` + `.hera` files; refactor `types.civet` onto shared bases [[#1995](https://github.com/DanielXMoore/Civet/pull/1995)]
55
+ * CI: don't lose Claude logs when hitting max turns [[#2005](https://github.com/DanielXMoore/Civet/pull/2005)]
31
56
  * Upgrade @danielx/hera 0.8.20 → 0.9.0 [[#2006](https://github.com/DanielXMoore/Civet/pull/2006)]
32
57
  * CLI lazy loads unplugin, fix race, allow symlink failure on Windows [[#2007](https://github.com/DanielXMoore/Civet/pull/2007)]
33
- * Remove some unnecessary boolean checks [[#2008](https://github.com/DanielXMoore/Civet/pull/2008)]
58
+ * Remove unnecessary boolean checks [[#2008](https://github.com/DanielXMoore/Civet/pull/2008)]
34
59
  * Semantic tokens for comments, fixing `coffeeComment` syntax highlighting [[#2011](https://github.com/DanielXMoore/Civet/pull/2011)]
35
60
  * Document optional elements in tuple types [[#2012](https://github.com/DanielXMoore/Civet/pull/2012)]
36
- * ci: separate typecheck step [[#2013](https://github.com/DanielXMoore/Civet/pull/2013)]
61
+ * CI: separate typecheck step [[#2013](https://github.com/DanielXMoore/Civet/pull/2013)]
37
62
  * Add typecheck iteration tooling [[#2014](https://github.com/DanielXMoore/Civet/pull/2014)]
38
63
  * Fix `typeof` types consuming top-level assignments [[#2017](https://github.com/DanielXMoore/Civet/pull/2017)]
39
64
  * Fix computed index side effects evaluated twice in compound assignment expressions [[#1885](https://github.com/DanielXMoore/Civet/pull/1885)]
@@ -41,9 +66,9 @@ as well as a full diff and commit list.
41
66
  * VSCode basic syntax highlighting for `type`/`interface` [[#2022](https://github.com/DanielXMoore/Civet/pull/2022)]
42
67
  * Fix implicit return of `abstract class` mixin body [[#2020](https://github.com/DanielXMoore/Civet/pull/2020)]
43
68
  * Fix LSP `@` shorthand incorrectly completing as `@this.member` [[#2032](https://github.com/DanielXMoore/Civet/pull/2032)]
44
- * test(ci): reduce Windows mocha flakes via worker cap + warmup hook [[#2033](https://github.com/DanielXMoore/Civet/pull/2033)]
45
- * LSP: Fix `@` completion in implicit return context [[#2034](https://github.com/DanielXMoore/Civet/pull/2034)]
46
- * svelte lang="civet" support in vscode extension [[#2021](https://github.com/DanielXMoore/Civet/pull/2021)]
69
+ * Test (CI): reduce Windows mocha flakes via worker cap + warmup hook [[#2033](https://github.com/DanielXMoore/Civet/pull/2033)]
70
+ * LSP: fix `@` completion in implicit return context [[#2034](https://github.com/DanielXMoore/Civet/pull/2034)]
71
+ * VSCode: support `lang="civet"` in Svelte components [[#2021](https://github.com/DanielXMoore/Civet/pull/2021)]
47
72
  * Fix unplugin + esbuild sourcemap source paths when using library [[#2035](https://github.com/DanielXMoore/Civet/pull/2035)]
48
73
  * Make Import rule express its intent via NonIdContinue [[#2037](https://github.com/DanielXMoore/Civet/pull/2037)]
49
74
  * Allow non-identifier Unicode codepoints as identifiers [[#2036](https://github.com/DanielXMoore/Civet/pull/2036)]
package/dist/browser.js CHANGED
@@ -463,6 +463,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
463
463
  braceBlock: () => braceBlock,
464
464
  bracedBlock: () => bracedBlock,
465
465
  buildExportSplitClause: () => buildExportSplitClause,
466
+ canExpressionizeIfAsTernary: () => canExpressionizeIfAsTernary,
466
467
  convertArrowFunctionToMethod: () => convertArrowFunctionToMethod,
467
468
  convertFunctionToMethod: () => convertFunctionToMethod,
468
469
  convertNamedImportsToObject: () => convertNamedImportsToObject,
@@ -816,10 +817,10 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
816
817
  }
817
818
  }
818
819
  function prepend(prefix, node) {
819
- return !prefix || Array.isArray(prefix) && len(prefix, 0) ? node : Array.isArray(node) ? [prefix, ...node] : (assert(isParent(node), "prepend: can't glom into an AST leaf"), {
820
+ return !prefix || Array.isArray(prefix) && len(prefix, 0) ? node : Array.isArray(node) ? [prefix, ...node] : isParent(node) ? {
820
821
  ...node,
821
822
  children: [prefix, ...node.children]
822
- });
823
+ } : [prefix, node];
823
824
  }
824
825
  function append(node, suffix) {
825
826
  return !suffix || Array.isArray(suffix) && len(suffix, 0) ? node : Array.isArray(node) ? [...node, suffix] : isParent(node) ? {
@@ -4270,7 +4271,10 @@ ${js}`
4270
4271
  let { expression: exp } = initializer, ws;
4271
4272
  if (Array.isArray(exp) && exp.length === 2 && isWhitespaceOrEmpty(exp[0]) && (ws = exp[0], exp = exp[1]), !(typeof exp == "object" && exp != null && "type" in exp && exp.type === "StatementExpression"))
4272
4273
  return;
4273
- let statementExp = exp.statement, blockStatement = [ws || "", statementExp, ";"], pre = [blockStatement], ref;
4274
+ let statementExp = exp.statement;
4275
+ if (statementExp.type === "IfStatement" && canExpressionizeIfAsTernary(statementExp))
4276
+ return;
4277
+ let blockStatement = [ws || "", statementExp, ";"], pre = [blockStatement], ref;
4274
4278
  if (statementExp.type === "IterationExpression") {
4275
4279
  if (statementExp.async || statementExp.generator)
4276
4280
  return;
@@ -5524,6 +5528,21 @@ ${js}`
5524
5528
  } else
5525
5529
  return blockOrExpression;
5526
5530
  }
5531
+ function canExpressionizeIfAsTernary(statement) {
5532
+ let { then: b, else: e } = statement;
5533
+ return canExpressionizeBlock(b) && (e ? canExpressionizeBlock(e.block) : !0);
5534
+ }
5535
+ function canExpressionizeBlock(blockOrExpression) {
5536
+ if (blockOrExpression && typeof blockOrExpression == "object" && "expressions" in blockOrExpression) {
5537
+ let { expressions } = blockOrExpression, results1 = !0;
5538
+ for (let [, s] of expressions)
5539
+ if (!isExpression(s)) {
5540
+ results1 = !1;
5541
+ break;
5542
+ }
5543
+ return results1;
5544
+ }
5545
+ }
5527
5546
  function expressionizeIfStatement(statement) {
5528
5547
  let { condition, then: b, else: e } = statement, [...condRest] = condition.children, [closeParen] = condRest.splice(-1), expressionizedBlock = expressionizeBlock(b);
5529
5548
  if (!expressionizedBlock)
@@ -6344,9 +6363,9 @@ ${js}`
6344
6363
  }
6345
6364
  }
6346
6365
  function processTypes(node) {
6347
- let results1 = [];
6366
+ let results2 = [];
6348
6367
  for (let ref22 = gatherRecursiveAll(node, ($13) => $13.type === "TypeUnary"), i12 = 0, len11 = ref22.length; i12 < len11; i12++) {
6349
- let unary = ref22[i12], suffixIndex = unary.suffix.length - 1, results2 = [];
6368
+ let unary = ref22[i12], suffixIndex = unary.suffix.length - 1, results3 = [];
6350
6369
  for (; suffixIndex >= 0; ) {
6351
6370
  let suffix = unary.suffix[suffixIndex];
6352
6371
  if (typeof suffix == "object" && suffix != null && "token" in suffix && suffix.token === "?") {
@@ -6395,7 +6414,7 @@ ${js}`
6395
6414
  prefix,
6396
6415
  suffix: outer,
6397
6416
  children: [prefix, replace, outer]
6398
- })), results2.push(replaceNode(unary, replace, parent));
6417
+ })), results3.push(replaceNode(unary, replace, parent));
6399
6418
  } else if (typeof suffix == "object" && suffix != null && "type" in suffix && suffix.type === "NonNullAssertion") {
6400
6419
  let {} = suffix, m7;
6401
6420
  for (; m7 = unary.suffix[suffixIndex], typeof m7 == "object" && m7 != null && "type" in m7 && m7.type === "NonNullAssertion"; )
@@ -6436,13 +6455,13 @@ ${js}`
6436
6455
  prefix,
6437
6456
  suffix: outer,
6438
6457
  children: [prefix, replace, outer]
6439
- })), results2.push(replaceNode(unary, replace, parent));
6458
+ })), results3.push(replaceNode(unary, replace, parent));
6440
6459
  } else
6441
- results2.push(suffixIndex--);
6460
+ results3.push(suffixIndex--);
6442
6461
  }
6443
- results1.push(results2);
6462
+ results2.push(results3);
6444
6463
  }
6445
- return results1;
6464
+ return results2;
6446
6465
  }
6447
6466
  function processStatementExpressions(statements) {
6448
6467
  for (let ref24 = gatherRecursiveAll(statements, ($14) => $14.type === "StatementExpression"), i13 = 0, len12 = ref24.length; i13 < len12; i13++) {
@@ -6592,12 +6611,12 @@ ${js}`
6592
6611
  index + 1,
6593
6612
  0,
6594
6613
  ...(() => {
6595
- let results3 = [];
6614
+ let results4 = [];
6596
6615
  for (let i16 = 0, len15 = autoBinds.length; i16 < len15; i16++) {
6597
6616
  let [, a] = autoBinds[i16];
6598
- results3.push([indent, ["this.", a.name, " = this.", a.name, ".bind(this)"], ";"]);
6617
+ results4.push([indent, ["this.", a.name, " = this.", a.name, ".bind(this)"], ";"]);
6599
6618
  }
6600
- return results3;
6619
+ return results4;
6601
6620
  })()
6602
6621
  );
6603
6622
  }
@@ -7016,6 +7035,7 @@ ${js}`
7016
7035
  ImplicitAccessStart,
7017
7036
  PropertyAccessModifier,
7018
7037
  PropertyAccess,
7038
+ AccessLiteral,
7019
7039
  ExplicitPropertyGlob,
7020
7040
  PropertyGlob,
7021
7041
  PropertyBind,
@@ -10817,9 +10837,9 @@ ${js}`
10817
10837
  if (!$$r)
10818
10838
  return;
10819
10839
  if ($$ctx.tokenize) return $$r;
10820
- let $$loc = $$r.loc, $$value = $$r.value, $$m = /* @__PURE__ */ (function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
10840
+ let $$loc = $$r.loc, $$value = $$r.value, $$m = (function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
10821
10841
  var decorators = $2, declare = $3, access = $4, static_ = $5, override = $6, assignment = $7;
10822
- return {
10842
+ return assignment.assigned?.type === "SymbolLiteral" ? $skip : {
10823
10843
  type: static_ ? "CoffeeClassPublic" : "CoffeeClassPrivate",
10824
10844
  children: [decorators, declare, access, static_, override, assignment],
10825
10845
  assignment
@@ -11990,19 +12010,21 @@ ${js}`
11990
12010
  loc: $$final.loc
11991
12011
  }), $$ctx.exit && $$ctx.exit("PropertyAccessModifier", $$state, $$final, $$eventData), $$final;
11992
12012
  }
11993
- var PropertyAccess$0$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$C)(TemplateLiteral, StringLiteral, IntegerLiteral, SymbolLiteral)), PropertyAccess$1$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$EXPECT)($L22, 'PropertyAccess "-"'), IntegerLiteral), PropertyAccess$2$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$Q)(InlineComment), (0, import_lib2.$C)(IdentifierName, PrivateIdentifier, LengthShorthand)), PropertyAccess$3$parser = (0, import_lib2.$S)(ExplicitAccessStart, (0, import_lib2.$Y)(EOS)), PropertyAccess$4$parser = (0, import_lib2.$S)(ImplicitAccessStart, (0, import_lib2.$C)(PrivateIdentifier, LengthShorthand)), PropertyAccess$5$parser = (0, import_lib2.$S)(CoffeePrototypeEnabled, (0, import_lib2.$E)(PropertyAccessModifier), DoubleColon, (0, import_lib2.$E)(IdentifierName));
12013
+ var PropertyAccess$0$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$C)(TemplateLiteral, AccessLiteral, SymbolLiteral)), PropertyAccess$1$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$EXPECT)($L22, 'PropertyAccess "-"'), IntegerLiteral), PropertyAccess$2$parser = (0, import_lib2.$S)(AccessStart, (0, import_lib2.$Q)(InlineComment), (0, import_lib2.$C)(IdentifierName, PrivateIdentifier, LengthShorthand)), PropertyAccess$3$parser = (0, import_lib2.$S)(ExplicitAccessStart, (0, import_lib2.$Y)(EOS)), PropertyAccess$4$parser = (0, import_lib2.$S)(ImplicitAccessStart, (0, import_lib2.$C)(PrivateIdentifier, LengthShorthand)), PropertyAccess$5$parser = (0, import_lib2.$S)(CoffeePrototypeEnabled, (0, import_lib2.$E)(PropertyAccessModifier), DoubleColon, (0, import_lib2.$E)(IdentifierName));
11994
12014
  function PropertyAccess$0($$ctx, $$state) {
11995
12015
  let $$r = PropertyAccess$0$parser($$ctx, $$state);
11996
12016
  if (!$$r)
11997
12017
  return;
11998
12018
  if ($$ctx.tokenize) return $$r;
11999
12019
  let $$loc = $$r.loc, $$value = $$r.value, $$m = (function($skip, $loc, $0, $1, $2) {
12000
- var dot = $1, literal = $2;
12020
+ var dot = $1, expression = $2;
12001
12021
  return {
12002
12022
  type: "Index",
12023
+ expression,
12003
12024
  children: [
12004
12025
  adjustIndexAccess(dot),
12005
- literal,
12026
+ expression,
12027
+ "",
12006
12028
  "]"
12007
12029
  ]
12008
12030
  };
@@ -12040,15 +12062,26 @@ ${js}`
12040
12062
  if ($$ctx.tokenize) return $$r;
12041
12063
  let $$loc = $$r.loc, $$value = $$r.value, $$m = (function($skip, $loc, $0, $1, $2, $3) {
12042
12064
  var dot = $1, comments = $2, id = $3;
12043
- return id.unicode ? {
12044
- type: "Index",
12045
- children: [
12046
- adjustIndexAccess(dot),
12047
- ...comments,
12048
- propertyKey(id),
12049
- "]"
12050
- ]
12051
- } : {
12065
+ if (id.unicode) {
12066
+ let key = propertyKey(id), expression = {
12067
+ type: "Literal",
12068
+ subtype: "StringLiteral",
12069
+ children: [key],
12070
+ raw: key.token
12071
+ };
12072
+ return {
12073
+ type: "Index",
12074
+ expression,
12075
+ children: [
12076
+ adjustIndexAccess(dot),
12077
+ ...comments,
12078
+ expression,
12079
+ "",
12080
+ "]"
12081
+ ]
12082
+ };
12083
+ }
12084
+ return {
12052
12085
  type: "PropertyAccess",
12053
12086
  name: id.name,
12054
12087
  dot,
@@ -12107,17 +12140,21 @@ ${js}`
12107
12140
  children: modifier ? [modifier, dot] : [dot],
12108
12141
  optional: modifier?.token === "?"
12109
12142
  };
12110
- return id ? {
12111
- type: "PropertyAccess",
12112
- name: id.name,
12113
- dot: start,
12114
- children: [start, "prototype.", id]
12115
- } : {
12116
- type: "PropertyAccess",
12117
- name: "prototype",
12118
- dot: start,
12119
- children: [start, "prototype"]
12120
- };
12143
+ if (id) {
12144
+ let access = id.unicode ? ["prototype[", propertyKey(id), "]"] : ["prototype.", id];
12145
+ return {
12146
+ type: "PropertyAccess",
12147
+ name: id.name,
12148
+ dot: start,
12149
+ children: [start, ...access]
12150
+ };
12151
+ } else
12152
+ return {
12153
+ type: "PropertyAccess",
12154
+ name: "prototype",
12155
+ dot: start,
12156
+ children: [start, "prototype"]
12157
+ };
12121
12158
  })(import_lib2.SKIP, $$loc, $$value, $$value[0], $$value[1], $$value[2], $$value[3]), $$final;
12122
12159
  return $$m !== import_lib2.SKIP && ($$r.value = $$m, $$final = $$r), $$final;
12123
12160
  }
@@ -12132,6 +12169,30 @@ ${js}`
12132
12169
  loc: $$final.loc
12133
12170
  }), $$ctx.exit && $$ctx.exit("PropertyAccess", $$state, $$final, $$eventData), $$final;
12134
12171
  }
12172
+ var AccessLiteral$parser = (0, import_lib2.$C)(StringLiteral, IntegerLiteral);
12173
+ function AccessLiteral($$ctx, $$state) {
12174
+ let $$entered = $$ctx.enter && $$ctx.enter("AccessLiteral", $$state);
12175
+ if ($$entered && "cache" in $$entered) return $$entered.cache;
12176
+ let $$eventData = $$entered && $$entered.data, $$r = AccessLiteral$parser($$ctx, $$state);
12177
+ if (!$$r) {
12178
+ $$ctx.exit && $$ctx.exit("AccessLiteral", $$state, void 0, $$eventData);
12179
+ return;
12180
+ }
12181
+ if ($$ctx.tokenize) {
12182
+ let $$tok = $$r;
12183
+ return $$tok.value = { type: "AccessLiteral", children: [$$r.value].flat(), token: $$state.input.substring($$state.pos, $$r.pos), loc: $$r.loc }, $$ctx.exit && $$ctx.exit("AccessLiteral", $$state, $$tok, $$eventData), $$tok;
12184
+ }
12185
+ let $$loc = $$r.loc, $$value = $$r.value, $$m = (function($skip, $loc, $0, $1) {
12186
+ var literal = $0;
12187
+ return {
12188
+ type: "Literal",
12189
+ subtype: literal.type,
12190
+ children: [literal],
12191
+ raw: literal.token
12192
+ };
12193
+ })(import_lib2.SKIP, $$loc, $$value, $$value), $$final;
12194
+ return $$m !== import_lib2.SKIP && ($$r.value = $$m, $$final = $$r), $$ctx.exit && $$ctx.exit("AccessLiteral", $$state, $$final, $$eventData), $$final;
12195
+ }
12135
12196
  var ExplicitPropertyGlob$parser = (0, import_lib2.$S)((0, import_lib2.$Y)(ExplicitAccessStart), PropertyGlob);
12136
12197
  function ExplicitPropertyGlob($$ctx, $$state) {
12137
12198
  let $$entered = $$ctx.enter && $$ctx.enter("ExplicitPropertyGlob", $$state);
@@ -12189,10 +12250,11 @@ ${js}`
12189
12250
  }
12190
12251
  let $$loc = $$r.loc, $$value = $$r.value, $$m = (function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12191
12252
  var modifier = $1, dot = $3, id = $4, args = $5;
12253
+ let children = id.unicode ? [modifier, modifier?.token === "?" ? dot : null, "[", propertyKey(id), "]"] : [modifier, dot, id];
12192
12254
  return {
12193
12255
  type: "PropertyBind",
12194
12256
  name: id.name,
12195
- children: [modifier, dot, id],
12257
+ children,
12196
12258
  // omit `@` from children
12197
12259
  args: args?.children.slice(1, -1) ?? []
12198
12260
  // remove the parens from the arg list, or give an empty list
@@ -12215,10 +12277,11 @@ ${js}`
12215
12277
  }
12216
12278
  let $$loc = $$r.loc, $$value = $$r.value, $$m = (function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12217
12279
  var modifier = $1, dot = $3, id = $4, args = $5;
12280
+ let children = id.unicode ? [modifier, modifier?.token === "?" ? dot : null, "[", propertyKey(id), "]"] : [modifier, dot, id];
12218
12281
  return {
12219
12282
  type: "PropertyBind",
12220
12283
  name: id.name,
12221
- children: [modifier, dot, id],
12284
+ children,
12222
12285
  // omit `@` from children
12223
12286
  args: args?.children.slice(1, -1) ?? []
12224
12287
  // remove the parens from the arg list, or give an empty list
@@ -14889,28 +14952,28 @@ ${js}`
14889
14952
  }
14890
14953
  let $$loc = $$r.loc, $$value = $$r.value, $$m = (function($skip, $loc, $0, $1, $2) {
14891
14954
  var colon = $1, id = $2;
14892
- let name, token;
14893
- return id.type === "Identifier" ? { name, children: [token] } = id : (name = literalValue({
14955
+ let name, token, quoted;
14956
+ return id.type === "Identifier" ? id.unicode ? (name = id.unicode, token = { $loc: id.children?.[0]?.$loc, token: `"${id.unicode}"` }, quoted = !0) : ({ name, children: [token] } = id, quoted = !1) : (name = literalValue({
14894
14957
  type: "Literal",
14895
14958
  subtype: "StringLiteral",
14896
14959
  raw: id.token,
14897
14960
  children: [id]
14898
- }), token = id), config.symbols.includes(name) ? {
14961
+ }), token = id, quoted = !0), config.symbols.includes(name) ? {
14899
14962
  type: "SymbolLiteral",
14900
- children: id.type === "Identifier" ? [
14901
- { ...colon, token: "Symbol." },
14902
- token
14903
- ] : [
14963
+ children: quoted ? [
14904
14964
  { ...colon, token: "Symbol[" },
14905
14965
  token,
14906
14966
  "]"
14967
+ ] : [
14968
+ { ...colon, token: "Symbol." },
14969
+ token
14907
14970
  ],
14908
14971
  name
14909
14972
  } : {
14910
14973
  type: "SymbolLiteral",
14911
14974
  children: [
14912
14975
  { ...colon, token: "Symbol.for(" },
14913
- id.type === "Identifier" ? ['"', token, '"'] : token,
14976
+ quoted ? token : ['"', token, '"'],
14914
14977
  ")"
14915
14978
  ],
14916
14979
  name
@@ -22610,7 +22673,7 @@ ${js}`
22610
22673
  }
22611
22674
  let $$loc = $$r.loc, $$value = $$r.value, $$m = /* @__PURE__ */ (function($skip, $loc, $0, $1, $2) {
22612
22675
  var token = $2;
22613
- return { $loc, token };
22676
+ return { type: "NumericLiteral", $loc, token };
22614
22677
  })(import_lib2.SKIP, $$loc, $$value, $$value[0], $$value[1]), $$final;
22615
22678
  return $$m !== import_lib2.SKIP && ($$r.value = $$m, $$final = $$r), $$ctx.exit && $$ctx.exit("IntegerLiteral", $$state, $$final, $$eventData), $$final;
22616
22679
  }
@@ -23357,7 +23420,7 @@ ${js}`
23357
23420
  })(import_lib2.SKIP, $$loc, $$value[0], $$value[1], $$value[2], $$value[3], $$value[4], $$value[5], $$value[6], $$value[7], $$value[8], $$value[9]), $$final;
23358
23421
  return $$m !== import_lib2.SKIP && ($$r.value = $$m, $$final = $$r), $$ctx.exit && $$ctx.exit("TemplateBlockCharacters", $$state, $$final, $$eventData), $$final;
23359
23422
  }
23360
- var ReservedWord$0$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R67, "ReservedWord /(?:off|yes|on|no)/"), NonIdContinue, CoffeeBooleansEnabled), ReservedWord$1$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R68, "ReservedWord /isnt/"), NonIdContinue, CoffeeIsntEnabled), ReservedWord$2$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R69, "ReservedWord /by/"), NonIdContinue, CoffeeForLoopsEnabled), ReservedWord$3$parser = (0, import_lib2.$S)((0, import_lib2.$EXPECT)($R70, "ReservedWord /of/"), NonIdContinue, CoffeeOfEnabled), 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);
23423
+ var ReservedWord$0$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R67, "ReservedWord /(?:off|yes|on|no)/")), NonIdContinue, CoffeeBooleansEnabled), ReservedWord$1$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R68, "ReservedWord /isnt/")), NonIdContinue, CoffeeIsntEnabled), ReservedWord$2$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R69, "ReservedWord /by/")), NonIdContinue, CoffeeForLoopsEnabled), ReservedWord$3$parser = (0, import_lib2.$S)((0, import_lib2.$TEXT)((0, import_lib2.$EXPECT)($R70, "ReservedWord /of/")), NonIdContinue, CoffeeOfEnabled), 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);
23361
23424
  function ReservedWord$0($$ctx, $$state) {
23362
23425
  let $$r = ReservedWord$0$parser($$ctx, $$state);
23363
23426
  if (!$$r)