token-goat 2.9.14 → 2.9.16

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.
Files changed (46) hide show
  1. package/README.md +15 -1
  2. package/dist/{token-goat-chunk-2ESBO4IN.mjs → token-goat-chunk-2IEIBVVD.mjs} +16 -9
  3. package/dist/{token-goat-chunk-RUDOKYPJ.mjs → token-goat-chunk-2PCFAQAS.mjs} +6582 -6194
  4. package/dist/{token-goat-chunk-AMYCQJX4.mjs → token-goat-chunk-3H6FQT62.mjs} +49 -256
  5. package/dist/{token-goat-chunk-PRJVGIC5.mjs → token-goat-chunk-4DC6DDIB.mjs} +7 -5
  6. package/dist/token-goat-chunk-4EXFN2AW.mjs +29 -0
  7. package/dist/{token-goat-chunk-VZYD4OZB.mjs → token-goat-chunk-5USHO7B6.mjs} +416 -4168
  8. package/dist/token-goat-chunk-63QWJ6UM.mjs +277 -0
  9. package/dist/token-goat-chunk-BFNTLGVA.mjs +4547 -0
  10. package/dist/token-goat-chunk-BGHSSJUA.mjs +102 -0
  11. package/dist/{token-goat-chunk-T2IWWTHB.mjs → token-goat-chunk-DMQ32ZSR.mjs} +35 -1142
  12. package/dist/{token-goat-chunk-DBNY4RLN.mjs → token-goat-chunk-EJCY6KHO.mjs} +5 -3
  13. package/dist/token-goat-chunk-ERTXEKB6.mjs +228 -0
  14. package/dist/{token-goat-chunk-Z6UXPYJA.mjs → token-goat-chunk-F2ARFHLJ.mjs} +1 -1
  15. package/dist/{token-goat-chunk-EG3663UT.mjs → token-goat-chunk-GIMGT34T.mjs} +4 -2
  16. package/dist/{token-goat-chunk-XVZ4MNQC.mjs → token-goat-chunk-GMXBQS6O.mjs} +360 -116
  17. package/dist/{token-goat-chunk-SAQ5PG4L.mjs → token-goat-chunk-H3DXI6VD.mjs} +8 -4
  18. package/dist/token-goat-chunk-LJL6FGDS.mjs +35 -0
  19. package/dist/{token-goat-chunk-NEI4NC54.mjs → token-goat-chunk-LKSXAMJB.mjs} +7 -2
  20. package/dist/token-goat-chunk-LMFO66YD.mjs +331 -0
  21. package/dist/{token-goat-chunk-7OGKZ7AP.mjs → token-goat-chunk-M2R4UQ3B.mjs} +5 -3
  22. package/dist/{token-goat-chunk-YHGTGG6K.mjs → token-goat-chunk-MA5BZ2KI.mjs} +68 -7
  23. package/dist/{token-goat-chunk-ASVVF4JV.mjs → token-goat-chunk-MIL62GMN.mjs} +171 -23
  24. package/dist/{token-goat-chunk-ZFM4PWXL.mjs → token-goat-chunk-NAMH252H.mjs} +10 -7
  25. package/dist/{token-goat-chunk-YTQHZJXW.mjs → token-goat-chunk-NOBZV7PM.mjs} +96 -22
  26. package/dist/{token-goat-chunk-4SDX3QP3.mjs → token-goat-chunk-NQZCSVN2.mjs} +13 -5
  27. package/dist/{token-goat-chunk-XEH6KBWW.mjs → token-goat-chunk-OCI25AXY.mjs} +4 -3
  28. package/dist/token-goat-chunk-OSUFN2FV.mjs +326 -0
  29. package/dist/{token-goat-chunk-O5WAMISC.mjs → token-goat-chunk-QMZMHQRR.mjs} +29 -18
  30. package/dist/{token-goat-chunk-POBYR64E.mjs → token-goat-chunk-R3X5TCPB.mjs} +801 -3
  31. package/dist/token-goat-chunk-RRNZMM3A.mjs +3364 -0
  32. package/dist/{token-goat-chunk-PGGDW7DZ.mjs → token-goat-chunk-ULA4WCED.mjs} +9 -6
  33. package/dist/token-goat-chunk-UMXD2M7O.mjs +975 -0
  34. package/dist/{token-goat-chunk-3XQPEJMV.mjs → token-goat-chunk-UXHDBVUR.mjs} +1 -1
  35. package/dist/{token-goat-chunk-EZNVAIR3.mjs → token-goat-chunk-VVIYEFBI.mjs} +4 -3
  36. package/dist/token-goat-chunk-XOHTFRDH.mjs +10760 -0
  37. package/dist/{token-goat-chunk-HF6H7RNK.mjs → token-goat-chunk-YPS64ACE.mjs} +13 -3
  38. package/dist/{token-goat-chunk-DAMXYVIW.mjs → token-goat-chunk-Z5VPAXTC.mjs} +2560 -820
  39. package/dist/{token-goat-chunk-XQF5J25J.mjs → token-goat-chunk-ZEHFYJ7Z.mjs} +5 -4
  40. package/dist/token-goat-hook.mjs +15 -10
  41. package/dist/token-goat.core.mjs +24 -18
  42. package/docs/cli.md +8 -6
  43. package/package.json +1 -1
  44. package/dist/token-goat-chunk-IT6O3PNN.mjs +0 -15463
  45. package/dist/token-goat-chunk-ZD4EM4LR.mjs +0 -30
  46. package/dist/token-goat-chunk-ZYNNQ36L.mjs +0 -479
@@ -1,6 +1,7 @@
1
1
  import { createRequire as __cjsRequire } from 'node:module';
2
2
  const require = __cjsRequire(import.meta.url);
3
3
  import {
4
+ GENERIC_CLAUSE,
4
5
  lastContentLine,
5
6
  makeLineSymbol,
6
7
  matchGroovySlashy,
@@ -9,7 +10,7 @@ import {
9
10
  stripMultilineStringSpan,
10
11
  stripNestedBlockCommentSpan,
11
12
  stripStringLiterals
12
- } from "./token-goat-chunk-POBYR64E.mjs";
13
+ } from "./token-goat-chunk-R3X5TCPB.mjs";
13
14
  import {
14
15
  init_define_import_meta_env
15
16
  } from "./token-goat-chunk-A37V4PBF.mjs";
@@ -22,7 +23,7 @@ var IDENT = `(?:\`[^\`]+\`|[${IDENT_START}][${IDENT_CONT}]*)`;
22
23
  function unquoteIdent(name) {
23
24
  return name.startsWith("`") && name.endsWith("`") ? name.slice(1, -1) : name;
24
25
  }
25
- var GENERIC = "(?:<(?:[^<>]|<[^<>]*>)*>)?";
26
+ var GENERIC = "(?:" + GENERIC_CLAUSE + ")?";
26
27
  var LEADING_ATTRIBUTE_RE = /^\s*(?:@[A-Za-z_][A-Za-z0-9_.]*(?:\((?:[^()]|\([^()]*\))*\))?\s+)+/;
27
28
  function stripLeadingAttributes(s) {
28
29
  return s.replace(LEADING_ATTRIBUTE_RE, "");
@@ -1747,6 +1748,15 @@ function isReturnType(typeText) {
1747
1748
  const last = first.split(".").pop() ?? "";
1748
1749
  return /^[A-Z]/.test(last);
1749
1750
  }
1751
+ function withoutTypeParams(code) {
1752
+ if (!code.startsWith("<")) return code;
1753
+ let depth = 0;
1754
+ for (let i = 0; i < code.length; i++) {
1755
+ if (code[i] === "<") depth++;
1756
+ else if (code[i] === ">" && --depth === 0) return code.slice(i + 1).trimStart();
1757
+ }
1758
+ return code;
1759
+ }
1750
1760
  function matchGroovy(code, ctx) {
1751
1761
  const s = stripLeadingWords(code, MODIFIERS, true);
1752
1762
  const at = code.length - s.length;
@@ -1762,7 +1772,7 @@ function matchGroovy(code, ctx) {
1762
1772
  if (ctx.scope === "container" && TYPE_KINDS2.has(ctx.parentKind) && s.startsWith(ctx.parent) && /^\s*\(/.test(s.slice(ctx.parent.length))) {
1763
1773
  return { name: ctx.parent, kind: "constructor", end: "brace" };
1764
1774
  }
1765
- const fn = cFunctionHeader(s);
1775
+ const fn = cFunctionHeader(withoutTypeParams(s));
1766
1776
  if (fn !== null && fn.qualifier === "" && isReturnType(fn.typeText)) return { name: fn.name, kind: member, end: "brace" };
1767
1777
  }
1768
1778
  if (ctx.insideFunction) return null;