@whaaaley/crush 0.0.0-stage → 0.2.7

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 (358) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +185 -2
  3. package/SKILL.md +187 -0
  4. package/THIRD_PARTY_NOTICES.md +277 -0
  5. package/dist/capture/capture.operations.d.ts +23 -0
  6. package/dist/capture/capture.operations.js +231 -0
  7. package/dist/capture/capture.schema.d.ts +73 -0
  8. package/dist/capture/capture.schema.js +28 -0
  9. package/dist/collapse/collapse.operations.d.ts +2 -0
  10. package/dist/collapse/collapse.operations.js +82 -0
  11. package/dist/collapse/collapse.schema.d.ts +40 -0
  12. package/dist/collapse/collapse.schema.js +35 -0
  13. package/dist/crush.tables.d.ts +3583 -0
  14. package/dist/crush.tables.js +456 -0
  15. package/dist/crushes/callback.crush.d.ts +2 -0
  16. package/dist/crushes/callback.crush.js +19 -0
  17. package/dist/crushes/crush.d.ts +36 -0
  18. package/dist/crushes/crush.js +12 -0
  19. package/dist/crushes/crush.names.d.ts +1 -0
  20. package/dist/crushes/crush.names.js +2 -0
  21. package/dist/crushes/crushes.d.ts +2 -0
  22. package/dist/crushes/crushes.js +9 -0
  23. package/dist/crushes/default-value.crush.d.ts +2 -0
  24. package/dist/crushes/default-value.crush.js +29 -0
  25. package/dist/crushes/drop-operand.crush.d.ts +2 -0
  26. package/dist/crushes/drop-operand.crush.js +37 -0
  27. package/dist/crushes/fold.d.ts +64 -0
  28. package/dist/crushes/fold.js +366 -0
  29. package/dist/crushes/force-fork.crush.d.ts +2 -0
  30. package/dist/crushes/force-fork.crush.js +79 -0
  31. package/dist/crushes/loop-once.crush.d.ts +2 -0
  32. package/dist/crushes/loop-once.crush.js +71 -0
  33. package/dist/crushes/optional-chain.crush.d.ts +2 -0
  34. package/dist/crushes/optional-chain.crush.js +30 -0
  35. package/dist/crushes/switch-case.crush.d.ts +2 -0
  36. package/dist/crushes/switch-case.crush.js +19 -0
  37. package/dist/decisions/decide.d.ts +61 -0
  38. package/dist/decisions/decide.js +161 -0
  39. package/dist/decisions/decisions.d.ts +24 -0
  40. package/dist/decisions/decisions.js +62 -0
  41. package/dist/decisions/forks.decision.d.ts +4 -0
  42. package/dist/decisions/forks.decision.js +32 -0
  43. package/dist/decisions/kinds.d.ts +101 -0
  44. package/dist/decisions/kinds.js +38 -0
  45. package/dist/decisions/loops.decision.d.ts +4 -0
  46. package/dist/decisions/loops.decision.js +39 -0
  47. package/dist/decisions/shorts.decision.d.ts +3 -0
  48. package/dist/decisions/shorts.decision.js +66 -0
  49. package/dist/decisions/switches.decision.d.ts +3 -0
  50. package/dist/decisions/switches.decision.js +20 -0
  51. package/dist/decisions/throws.decision.d.ts +3 -0
  52. package/dist/decisions/throws.decision.js +35 -0
  53. package/dist/decisions/values.decision.d.ts +3 -0
  54. package/dist/decisions/values.decision.js +67 -0
  55. package/dist/explore/edges/explore.d.ts +60 -0
  56. package/dist/explore/edges/explore.db.d.ts +22 -0
  57. package/dist/explore/edges/explore.db.js +55 -0
  58. package/dist/explore/edges/explore.js +305 -0
  59. package/dist/explore/edges/random.d.ts +2 -0
  60. package/dist/explore/edges/random.js +32 -0
  61. package/dist/explore/explore.operations.d.ts +30 -0
  62. package/dist/explore/explore.operations.js +117 -0
  63. package/dist/explore/limits.operations.d.ts +14 -0
  64. package/dist/explore/limits.operations.js +20 -0
  65. package/dist/explore/targets.operations.d.ts +36 -0
  66. package/dist/explore/targets.operations.js +32 -0
  67. package/dist/explore/utils/draws.d.ts +6 -0
  68. package/dist/explore/utils/draws.js +2 -0
  69. package/dist/explore/utils/edits.d.ts +15 -0
  70. package/dist/explore/utils/edits.js +151 -0
  71. package/dist/explore/utils/guide.d.ts +23 -0
  72. package/dist/explore/utils/guide.js +35 -0
  73. package/dist/explore/utils/keep.d.ts +10 -0
  74. package/dist/explore/utils/keep.js +61 -0
  75. package/dist/explore/utils/pools.d.ts +17 -0
  76. package/dist/explore/utils/pools.js +121 -0
  77. package/dist/explore/utils/reads.d.ts +19 -0
  78. package/dist/explore/utils/reads.js +118 -0
  79. package/dist/explore/utils/twin.d.ts +21 -0
  80. package/dist/explore/utils/twin.js +55 -0
  81. package/dist/forks/forks.operations.d.ts +32 -0
  82. package/dist/forks/forks.operations.js +134 -0
  83. package/dist/forks/forks.schema.d.ts +20 -0
  84. package/dist/forks/forks.schema.js +14 -0
  85. package/dist/graph/cfg/cfg.d.ts +28 -0
  86. package/dist/graph/cfg/cfg.js +31 -0
  87. package/dist/graph/cfg/code-paths/analyzer.d.ts +27 -0
  88. package/dist/graph/cfg/code-paths/analyzer.js +358 -0
  89. package/dist/graph/cfg/code-paths/segments.d.ts +44 -0
  90. package/dist/graph/cfg/code-paths/segments.js +105 -0
  91. package/dist/graph/cfg/code-paths/state.d.ts +121 -0
  92. package/dist/graph/cfg/code-paths/state.js +611 -0
  93. package/dist/graph/cfg/entries.d.ts +13 -0
  94. package/dist/graph/cfg/entries.js +120 -0
  95. package/dist/graph/cfg/functions.d.ts +6 -0
  96. package/dist/graph/cfg/functions.js +47 -0
  97. package/dist/graph/cfg/paths.d.ts +27 -0
  98. package/dist/graph/cfg/paths.js +91 -0
  99. package/dist/graph/cfg/scopes/scopes.d.ts +40 -0
  100. package/dist/graph/cfg/scopes/scopes.js +375 -0
  101. package/dist/graph/symbols/file.d.ts +90 -0
  102. package/dist/graph/symbols/file.js +427 -0
  103. package/dist/graph/symbols/keys.d.ts +13 -0
  104. package/dist/graph/symbols/keys.js +22 -0
  105. package/dist/graph/symbols/resolve.operations.d.ts +4 -0
  106. package/dist/graph/symbols/resolve.operations.js +33 -0
  107. package/dist/graph/symbols/symbols.d.ts +12 -0
  108. package/dist/graph/symbols/symbols.js +155 -0
  109. package/dist/graph/symbols/symbols.schema.d.ts +32 -0
  110. package/dist/graph/symbols/symbols.schema.js +19 -0
  111. package/dist/graph/unused/tests.d.ts +7 -0
  112. package/dist/graph/unused/tests.js +95 -0
  113. package/dist/graph/unused/unused.d.ts +53 -0
  114. package/dist/graph/unused/unused.js +319 -0
  115. package/dist/graph/walk/walk.d.ts +7 -0
  116. package/dist/graph/walk/walk.js +39 -0
  117. package/dist/instrument/instrument.operations.d.ts +72 -0
  118. package/dist/instrument/instrument.operations.js +786 -0
  119. package/dist/instrument/instrument.schema.d.ts +257 -0
  120. package/dist/instrument/instrument.schema.js +100 -0
  121. package/dist/judge/counters.d.ts +86 -0
  122. package/dist/judge/counters.js +402 -0
  123. package/dist/judge/edges/api.d.ts +14 -0
  124. package/dist/judge/edges/api.js +80 -0
  125. package/dist/judge/edges/completion.reporter.d.ts +9 -0
  126. package/dist/judge/edges/completion.reporter.js +51 -0
  127. package/dist/judge/edges/hints.reporter.d.ts +13 -0
  128. package/dist/judge/edges/hints.reporter.js +29 -0
  129. package/dist/judge/edges/judge.edges.d.ts +52 -0
  130. package/dist/judge/edges/judge.edges.js +59 -0
  131. package/dist/judge/edges/judge.fs.d.ts +8 -0
  132. package/dist/judge/edges/judge.fs.js +45 -0
  133. package/dist/judge/edges/merge.d.ts +11 -0
  134. package/dist/judge/edges/merge.js +60 -0
  135. package/dist/judge/edges/plugin.d.ts +132 -0
  136. package/dist/judge/edges/plugin.js +441 -0
  137. package/dist/judge/edges/reach.d.ts +68 -0
  138. package/dist/judge/edges/reach.js +132 -0
  139. package/dist/judge/edges/speed.d.ts +32 -0
  140. package/dist/judge/edges/speed.js +34 -0
  141. package/dist/judge/edges/strays.d.ts +1 -0
  142. package/dist/judge/edges/strays.js +14 -0
  143. package/dist/judge/edges/vitest.d.ts +20 -0
  144. package/dist/judge/edges/vitest.js +36 -0
  145. package/dist/judge/edges/vitest.schema.d.ts +14 -0
  146. package/dist/judge/edges/vitest.schema.js +16 -0
  147. package/dist/judge/explore.test.d.ts +1 -0
  148. package/dist/judge/explore.test.js +101 -0
  149. package/dist/judge/hints.d.ts +11 -0
  150. package/dist/judge/hints.js +44 -0
  151. package/dist/judge/judge.operations.d.ts +218 -0
  152. package/dist/judge/judge.operations.js +464 -0
  153. package/dist/judge/judge.schema.d.ts +135 -0
  154. package/dist/judge/judge.schema.js +129 -0
  155. package/dist/judge/judge.shard-1.test.d.ts +1 -0
  156. package/dist/judge/judge.shard-1.test.js +3 -0
  157. package/dist/judge/judge.shard-2.test.d.ts +1 -0
  158. package/dist/judge/judge.shard-2.test.js +3 -0
  159. package/dist/judge/judge.test.d.ts +1 -0
  160. package/dist/judge/judge.test.js +3 -0
  161. package/dist/judge/refusals.d.ts +14 -0
  162. package/dist/judge/refusals.js +10 -0
  163. package/dist/judge/report.test.d.ts +1 -0
  164. package/dist/judge/report.test.js +432 -0
  165. package/dist/judge/runner.d.ts +3 -0
  166. package/dist/judge/runner.js +1602 -0
  167. package/dist/judge/stresses.test.d.ts +1 -0
  168. package/dist/judge/stresses.test.js +12 -0
  169. package/dist/judge/task-meta.d.ts +14 -0
  170. package/dist/judge/task-meta.js +1 -0
  171. package/dist/justify/edges/load.d.ts +7 -0
  172. package/dist/justify/edges/load.js +40 -0
  173. package/dist/justify/edges/refresh.fs.d.ts +8 -0
  174. package/dist/justify/edges/refresh.fs.js +15 -0
  175. package/dist/justify/justify.operations.d.ts +46 -0
  176. package/dist/justify/justify.operations.js +80 -0
  177. package/dist/justify/justify.schema.d.ts +21 -0
  178. package/dist/justify/justify.schema.js +11 -0
  179. package/dist/mutators/arithmetic-operator.mutator.d.ts +2 -0
  180. package/dist/mutators/arithmetic-operator.mutator.js +22 -0
  181. package/dist/mutators/array-declaration.mutator.d.ts +2 -0
  182. package/dist/mutators/array-declaration.mutator.js +12 -0
  183. package/dist/mutators/arrow-function.mutator.d.ts +2 -0
  184. package/dist/mutators/arrow-function.mutator.js +10 -0
  185. package/dist/mutators/assignment-operator.mutator.d.ts +2 -0
  186. package/dist/mutators/assignment-operator.mutator.js +29 -0
  187. package/dist/mutators/await-expression.mutator.d.ts +2 -0
  188. package/dist/mutators/await-expression.mutator.js +7 -0
  189. package/dist/mutators/bitwise-operator.mutator.d.ts +2 -0
  190. package/dist/mutators/bitwise-operator.mutator.js +19 -0
  191. package/dist/mutators/block-statement.mutator.d.ts +2 -0
  192. package/dist/mutators/block-statement.mutator.js +30 -0
  193. package/dist/mutators/boolean-literal.mutator.d.ts +2 -0
  194. package/dist/mutators/boolean-literal.mutator.js +5 -0
  195. package/dist/mutators/coercion.mutator.d.ts +2 -0
  196. package/dist/mutators/coercion.mutator.js +28 -0
  197. package/dist/mutators/conditional-expression.mutator.d.ts +2 -0
  198. package/dist/mutators/conditional-expression.mutator.js +36 -0
  199. package/dist/mutators/disposal.mutator.d.ts +2 -0
  200. package/dist/mutators/disposal.mutator.js +13 -0
  201. package/dist/mutators/empty-destructuring.mutator.d.ts +2 -0
  202. package/dist/mutators/empty-destructuring.mutator.js +35 -0
  203. package/dist/mutators/empty-return.mutator.d.ts +2 -0
  204. package/dist/mutators/empty-return.mutator.js +35 -0
  205. package/dist/mutators/equality-operator.mutator.d.ts +2 -0
  206. package/dist/mutators/equality-operator.mutator.js +16 -0
  207. package/dist/mutators/loop-exit.mutator.d.ts +2 -0
  208. package/dist/mutators/loop-exit.mutator.js +5 -0
  209. package/dist/mutators/method-expression.mutator.d.ts +2 -0
  210. package/dist/mutators/method-expression.mutator.js +59 -0
  211. package/dist/mutators/missing-lookup.mutator.d.ts +2 -0
  212. package/dist/mutators/missing-lookup.mutator.js +25 -0
  213. package/dist/mutators/mutator.d.ts +40 -0
  214. package/dist/mutators/mutator.js +49 -0
  215. package/dist/mutators/mutator.names.d.ts +3 -0
  216. package/dist/mutators/mutator.names.js +43 -0
  217. package/dist/mutators/mutators.d.ts +8 -0
  218. package/dist/mutators/mutators.js +84 -0
  219. package/dist/mutators/nested-condition.mutator.d.ts +2 -0
  220. package/dist/mutators/nested-condition.mutator.js +16 -0
  221. package/dist/mutators/number-literal.mutator.d.ts +3 -0
  222. package/dist/mutators/number-literal.mutator.js +13 -0
  223. package/dist/mutators/object-literal.mutator.d.ts +2 -0
  224. package/dist/mutators/object-literal.mutator.js +6 -0
  225. package/dist/mutators/odd-number.mutator.d.ts +2 -0
  226. package/dist/mutators/odd-number.mutator.js +15 -0
  227. package/dist/mutators/operand-deletion.mutator.d.ts +2 -0
  228. package/dist/mutators/operand-deletion.mutator.js +9 -0
  229. package/dist/mutators/outcome.mutator.d.ts +3 -0
  230. package/dist/mutators/outcome.mutator.js +45 -0
  231. package/dist/mutators/plain-assignment.mutator.d.ts +2 -0
  232. package/dist/mutators/plain-assignment.mutator.js +7 -0
  233. package/dist/mutators/power-operator.mutator.d.ts +2 -0
  234. package/dist/mutators/power-operator.mutator.js +13 -0
  235. package/dist/mutators/private-brand.mutator.d.ts +2 -0
  236. package/dist/mutators/private-brand.mutator.js +7 -0
  237. package/dist/mutators/regex.mutator.d.ts +2 -0
  238. package/dist/mutators/regex.mutator.js +29 -0
  239. package/dist/mutators/short-iteration.mutator.d.ts +2 -0
  240. package/dist/mutators/short-iteration.mutator.js +8 -0
  241. package/dist/mutators/string-literal.mutator.d.ts +3 -0
  242. package/dist/mutators/string-literal.mutator.js +149 -0
  243. package/dist/mutators/switch-default.mutator.d.ts +2 -0
  244. package/dist/mutators/switch-default.mutator.js +13 -0
  245. package/dist/mutators/sync-iteration.mutator.d.ts +3 -0
  246. package/dist/mutators/sync-iteration.mutator.js +9 -0
  247. package/dist/mutators/thrown-call.mutator.d.ts +2 -0
  248. package/dist/mutators/thrown-call.mutator.js +7 -0
  249. package/dist/mutators/unary-operator.mutator.d.ts +2 -0
  250. package/dist/mutators/unary-operator.mutator.js +18 -0
  251. package/dist/mutators/unbound-call.mutator.d.ts +2 -0
  252. package/dist/mutators/unbound-call.mutator.js +14 -0
  253. package/dist/mutators/update-operator.mutator.d.ts +2 -0
  254. package/dist/mutators/update-operator.mutator.js +15 -0
  255. package/dist/mutators/yield-value.mutator.d.ts +2 -0
  256. package/dist/mutators/yield-value.mutator.js +7 -0
  257. package/dist/parity/compare.d.ts +27 -0
  258. package/dist/parity/compare.js +26 -0
  259. package/dist/parity/corpus.parity.d.ts +1 -0
  260. package/dist/parity/corpus.parity.js +97 -0
  261. package/dist/parity/edges/corpus.fs.d.ts +3 -0
  262. package/dist/parity/edges/corpus.fs.js +30 -0
  263. package/dist/parity/edges/ports.d.ts +2 -0
  264. package/dist/parity/edges/ports.js +21 -0
  265. package/dist/parity/edges/vitest.d.ts +2 -0
  266. package/dist/parity/edges/vitest.js +3 -0
  267. package/dist/parity/parity.operations.d.ts +33 -0
  268. package/dist/parity/parity.operations.js +60 -0
  269. package/dist/parity/parity.schema.d.ts +5 -0
  270. package/dist/parity/parity.schema.js +6 -0
  271. package/dist/parity/stryker/compare.d.ts +14 -0
  272. package/dist/parity/stryker/compare.js +52 -0
  273. package/dist/parity/stryker/edges/ports.d.ts +12 -0
  274. package/dist/parity/stryker/edges/ports.js +28 -0
  275. package/dist/parity/stryker/equivalence.d.ts +1 -0
  276. package/dist/parity/stryker/equivalence.js +42 -0
  277. package/dist/parity/stryker/intended.d.ts +29 -0
  278. package/dist/parity/stryker/intended.js +152 -0
  279. package/dist/parity/stryker/normalize.d.ts +27 -0
  280. package/dist/parity/stryker/normalize.js +181 -0
  281. package/dist/parity/stryker/rules.d.ts +6 -0
  282. package/dist/parity/stryker/rules.js +116 -0
  283. package/dist/parity/stryker/sides.d.ts +46 -0
  284. package/dist/parity/stryker/sides.js +199 -0
  285. package/dist/parity/stryker/stryker.parity.d.ts +1 -0
  286. package/dist/parity/stryker/stryker.parity.js +147 -0
  287. package/dist/parity/stryker/stryker.schema.d.ts +6 -0
  288. package/dist/parity/stryker/stryker.schema.js +7 -0
  289. package/dist/parity/views.d.ts +21 -0
  290. package/dist/parity/views.js +119 -0
  291. package/dist/questions/questions.operations.d.ts +110 -0
  292. package/dist/questions/questions.operations.js +446 -0
  293. package/dist/questions/questions.schema.d.ts +57 -0
  294. package/dist/questions/questions.schema.js +28 -0
  295. package/dist/record/edges/calls.db.d.ts +10 -0
  296. package/dist/record/edges/calls.db.js +91 -0
  297. package/dist/record/edges/hits.db.d.ts +3 -0
  298. package/dist/record/edges/hits.db.js +5 -0
  299. package/dist/record/edges/holds.db.d.ts +4 -0
  300. package/dist/record/edges/holds.db.js +31 -0
  301. package/dist/record/edges/judged-state.db.d.ts +5 -0
  302. package/dist/record/edges/judged-state.db.js +25 -0
  303. package/dist/record/edges/markers.db.d.ts +11 -0
  304. package/dist/record/edges/markers.db.js +55 -0
  305. package/dist/record/edges/merge.db.d.ts +7 -0
  306. package/dist/record/edges/merge.db.js +46 -0
  307. package/dist/record/edges/parts.db.d.ts +42 -0
  308. package/dist/record/edges/parts.db.js +389 -0
  309. package/dist/record/edges/parts.edges.d.ts +2 -0
  310. package/dist/record/edges/parts.edges.js +7 -0
  311. package/dist/record/edges/parts.fs.d.ts +1 -0
  312. package/dist/record/edges/parts.fs.js +11 -0
  313. package/dist/record/edges/parts.writer.d.ts +1 -0
  314. package/dist/record/edges/parts.writer.js +85 -0
  315. package/dist/record/edges/passes.db.d.ts +19 -0
  316. package/dist/record/edges/passes.db.js +31 -0
  317. package/dist/record/edges/plan.db.d.ts +21 -0
  318. package/dist/record/edges/plan.db.js +174 -0
  319. package/dist/record/edges/reach.db.d.ts +6 -0
  320. package/dist/record/edges/reach.db.js +62 -0
  321. package/dist/record/edges/record.db.d.ts +22 -0
  322. package/dist/record/edges/record.db.js +176 -0
  323. package/dist/record/edges/record.fs.d.ts +3 -0
  324. package/dist/record/edges/record.fs.js +7 -0
  325. package/dist/record/edges/site-verdicts.db.d.ts +11 -0
  326. package/dist/record/edges/site-verdicts.db.js +66 -0
  327. package/dist/record/edges/verified.db.d.ts +7 -0
  328. package/dist/record/edges/verified.db.js +71 -0
  329. package/dist/record/parts.operations.d.ts +26 -0
  330. package/dist/record/parts.operations.js +31 -0
  331. package/dist/record/path-checks.operations.d.ts +15 -0
  332. package/dist/record/path-checks.operations.js +84 -0
  333. package/dist/record/record.operations.d.ts +36 -0
  334. package/dist/record/record.operations.js +11 -0
  335. package/dist/stresses/edges/stresses.record.d.ts +4 -0
  336. package/dist/stresses/edges/stresses.record.js +37 -0
  337. package/dist/stresses/stresses.operations.d.ts +28 -0
  338. package/dist/stresses/stresses.operations.js +22 -0
  339. package/dist/utils/ast.d.ts +55 -0
  340. package/dist/utils/ast.js +181 -0
  341. package/dist/utils/errors.d.ts +8 -0
  342. package/dist/utils/errors.js +12 -0
  343. package/dist/utils/faults.d.ts +6 -0
  344. package/dist/utils/faults.js +10 -0
  345. package/dist/utils/lookup.d.ts +4 -0
  346. package/dist/utils/lookup.js +27 -0
  347. package/dist/utils/order.d.ts +2 -0
  348. package/dist/utils/order.js +17 -0
  349. package/dist/utils/retry.d.ts +14 -0
  350. package/dist/utils/retry.js +15 -0
  351. package/dist/utils/safe.d.ts +11 -0
  352. package/dist/utils/safe.js +31 -0
  353. package/migrations/main/20261129123324_initial/migration.sql +418 -0
  354. package/migrations/main/20261129123324_initial/snapshot.json +3641 -0
  355. package/package.json +89 -4
  356. package/references/consumer-setup.md +92 -0
  357. package/src/graph/cfg/code-paths/LICENSE +21 -0
  358. package/src/graph/cfg/scopes/LICENSE +24 -0
@@ -0,0 +1,611 @@
1
+ import { heldOr } from '../../../utils/faults.js';
2
+ import { add, addAll, takeAll, clear, emptyFork, flattenUnused, headOf, isEmpty, isReachable, leavingFork, makeDisconnected, makeNext, makeUnreachable, newNext, nextId, noFork, noSegments, replaceHead, rootFork, rootSegment, segmentAt, someReachable, } from './segments.js';
3
+ export const stateOf = (ids, faults, onLooped) => {
4
+ const initial = rootSegment(ids);
5
+ const fork = rootFork(ids, faults, initial);
6
+ return {
7
+ ids,
8
+ faults,
9
+ onLooped,
10
+ fork,
11
+ choice: null,
12
+ switch: null,
13
+ try: null,
14
+ loop: null,
15
+ break: null,
16
+ chain: null,
17
+ current: [],
18
+ initial,
19
+ final: [],
20
+ returned: [],
21
+ thrown: [],
22
+ };
23
+ };
24
+ // What a walk goes on with once a bug left nothing open, and whose answer is dropped for the error kept.
25
+ const noChoice = { upper: null, kind: 'test', isForkingAsResult: false, true: noFork, false: noFork, nullish: noFork, processed: false };
26
+ const noChain = { upper: null, choices: 0 };
27
+ const noBreak = { upper: null, breakable: true, label: null, broken: noFork };
28
+ const noSwitch = { upper: null, hasCase: false, defaultSegments: [], defaultBody: null, foundEmptyDefault: false, lastIsDefault: false, forks: 0 };
29
+ const noTry = { upper: null, hasFinalizer: false, position: 'try', returned: noFork, thrown: noFork, lastOfTryIsReachable: false, lastOfCatchIsReachable: false };
30
+ const noLoop = {
31
+ upper: null,
32
+ type: 'ForOfStatement',
33
+ label: null,
34
+ broken: noFork,
35
+ test: undefined,
36
+ continueDestination: null,
37
+ continued: noFork,
38
+ entry: null,
39
+ endOfInit: null,
40
+ testSegments: null,
41
+ endOfTest: null,
42
+ update: null,
43
+ endOfUpdate: null,
44
+ previous: null,
45
+ left: null,
46
+ endOfLeft: null,
47
+ };
48
+ const choiceIn = (state) => heldOr(state.faults, state.choice, noChoice, 'choice open');
49
+ const chainIn = (state) => heldOr(state.faults, state.chain, noChain, 'chain open');
50
+ const breakIn = (state) => heldOr(state.faults, state.break, noBreak, 'break context open');
51
+ const loopIn = (state) => heldOr(state.faults, state.loop, noLoop, 'loop open');
52
+ const switchIn = (state) => heldOr(state.faults, state.switch, noSwitch, 'switch open');
53
+ const tryIn = (state) => heldOr(state.faults, state.try, noTry, 'try open');
54
+ // The fork the current one opened in.
55
+ const upperFork = (state) => heldOr(state.faults, state.fork.upper, noFork, 'fork around the current one');
56
+ // The segments a loop's earlier part left for a later one.
57
+ const segmentsIn = (state, segments) => heldOr(state.faults, segments, noSegments, 'segments of a loop part');
58
+ // A segment ending the path is kept once in `final`, whether it returns, throws or both.
59
+ const addEnding = (state, ending, segments) => {
60
+ const others = ending === 'returned' ? state.thrown : state.returned;
61
+ for (const segment of segments) {
62
+ state[ending].push(segment);
63
+ if (!others.includes(segment))
64
+ state.final.push(segment);
65
+ }
66
+ };
67
+ // Only a loop's nearest label names it, so `continue a` in `a: b: while (c) continue a` finds no loop.
68
+ const continueContextOf = (state, label) => {
69
+ if (!label)
70
+ return state.loop;
71
+ for (let context = state.loop; context; context = context.upper) {
72
+ if (context.label === label)
73
+ return context;
74
+ }
75
+ return null;
76
+ };
77
+ const breakContextOf = (state, label) => {
78
+ for (let context = state.break; context; context = context.upper) {
79
+ if (label ? context.label === label : context.breakable)
80
+ return context;
81
+ }
82
+ return null;
83
+ };
84
+ // A `return` inside a try with a `finally` goes through the `finally` first, else it ends the path.
85
+ const addReturned = (state, segments) => {
86
+ for (let context = state.try; context; context = context.upper) {
87
+ if (context.hasFinalizer && context.position !== 'finally')
88
+ return add(context.returned, segments);
89
+ }
90
+ addEnding(state, 'returned', segments);
91
+ };
92
+ // A throw inside a try goes to its catch, one inside a catch with a `finally` to the `finally`, else it ends the path.
93
+ const throwContextOf = (state) => {
94
+ for (let context = state.try; context; context = context.upper) {
95
+ if (context.position === 'try' || (context.hasFinalizer && context.position === 'catch'))
96
+ return context;
97
+ }
98
+ return null;
99
+ };
100
+ const addThrown = (state, segments) => {
101
+ const context = throwContextOf(state);
102
+ if (context)
103
+ add(context.thrown, segments);
104
+ else
105
+ addEnding(state, 'thrown', segments);
106
+ };
107
+ const remove = (segments, segment) => {
108
+ segments.splice(segments.indexOf(segment), 1);
109
+ };
110
+ const disconnect = (state, previous, next) => {
111
+ for (const [index, from] of previous.entries()) {
112
+ const to = segmentAt(state.faults, next, index);
113
+ remove(from.allNext, to);
114
+ remove(to.allPrevious, from);
115
+ }
116
+ };
117
+ const makeLooped = (state, unflattenedFrom, unflattenedTo) => {
118
+ const fromSegments = flattenUnused(unflattenedFrom);
119
+ const toSegments = flattenUnused(unflattenedTo);
120
+ // Only as many pairs as the shorter list holds are linked, as ESLint links them.
121
+ for (const [index, from] of fromSegments.slice(0, toSegments.length).entries()) {
122
+ const to = segmentAt(state.faults, toSegments, index);
123
+ from.allNext.push(to);
124
+ to.allPrevious.push(from);
125
+ state.onLooped(from, to);
126
+ }
127
+ };
128
+ const settleChoice = (choice, head) => {
129
+ if (choice.processed)
130
+ return;
131
+ add(choice.true, head);
132
+ add(choice.false, head);
133
+ add(choice.nullish, head);
134
+ };
135
+ const finalizeForTest = (loop, choice, head) => {
136
+ settleChoice(choice, head);
137
+ if (loop.test !== true)
138
+ addAll(loop.broken, choice.false);
139
+ loop.endOfTest = makeNext(choice.true, 0, -1);
140
+ };
141
+ export const pushFork = (state) => {
142
+ state.fork = emptyFork(state.fork);
143
+ return state.fork;
144
+ };
145
+ export const popFork = (state) => {
146
+ const last = state.fork;
147
+ state.fork = upperFork(state);
148
+ replaceHead(state.fork, makeNext(last, 0, -1));
149
+ };
150
+ export const forkPath = (state) => add(state.fork, makeNext(upperFork(state), -1, -1));
151
+ export const forkBypassPath = (state) => add(state.fork, headOf(upperFork(state)));
152
+ export const pushChoice = (state, choice) => {
153
+ const { fork } = state;
154
+ const { kind, isForkingAsResult } = choice;
155
+ state.choice = { upper: state.choice, kind, isForkingAsResult, true: emptyFork(fork), false: emptyFork(fork), nullish: emptyFork(fork), processed: false };
156
+ };
157
+ export const popChoice = (state) => {
158
+ const popped = choiceIn(state);
159
+ const { fork } = state;
160
+ const head = headOf(fork);
161
+ state.choice = popped.upper;
162
+ switch (popped.kind) {
163
+ case '&&':
164
+ case '||':
165
+ case '??': {
166
+ settleChoice(popped, head);
167
+ if (popped.isForkingAsResult) {
168
+ const parent = choiceIn(state);
169
+ takeAll(parent.true, popped.true);
170
+ takeAll(parent.false, popped.false);
171
+ takeAll(parent.nullish, popped.nullish);
172
+ parent.processed = true;
173
+ return;
174
+ }
175
+ break;
176
+ }
177
+ case 'test': {
178
+ const side = popped.processed ? popped.false : popped.true;
179
+ clear(side);
180
+ add(side, head);
181
+ break;
182
+ }
183
+ case 'loop':
184
+ return;
185
+ }
186
+ takeAll(popped.true, popped.false);
187
+ replaceHead(fork, makeNext(popped.true, 0, -1));
188
+ };
189
+ const andSides = { right: 'true', leaves: ['false', 'nullish'] };
190
+ // Each logical operator's side its right operand continues from, and the sides it leaves by before reaching it: `&&` leaves when false or nullish, `||` when true, `??` either way.
191
+ const logicalSides = new Map([
192
+ ['&&', andSides],
193
+ ['||', { right: 'false', leaves: ['true'] }],
194
+ ['??', { right: 'nullish', leaves: ['true', 'false'] }],
195
+ ]);
196
+ export const makeLogicalRight = (state) => {
197
+ const choice = choiceIn(state);
198
+ const sides = heldOr(state.faults, logicalSides.get(choice.kind), andSides, 'logical operator open');
199
+ const { fork } = state;
200
+ if (choice.processed) {
201
+ const previous = choice[sides.right];
202
+ replaceHead(fork, makeNext(previous, 0, -1));
203
+ clear(previous);
204
+ choice.processed = false;
205
+ return;
206
+ }
207
+ const head = headOf(fork);
208
+ for (const side of sides.leaves)
209
+ add(choice[side], head);
210
+ replaceHead(fork, makeNext(fork, -1, -1));
211
+ };
212
+ export const makeIfConsequent = (state) => {
213
+ const choice = choiceIn(state);
214
+ settleChoice(choice, headOf(state.fork));
215
+ choice.processed = false;
216
+ replaceHead(state.fork, makeNext(choice.true, 0, -1));
217
+ };
218
+ export const makeIfAlternate = (state) => {
219
+ const choice = choiceIn(state);
220
+ clear(choice.true);
221
+ add(choice.true, headOf(state.fork));
222
+ choice.processed = true;
223
+ replaceHead(state.fork, makeNext(choice.false, 0, -1));
224
+ };
225
+ export const pushChain = (state) => {
226
+ state.chain = { upper: state.chain, choices: 0 };
227
+ };
228
+ export const popChain = (state) => {
229
+ const chain = chainIn(state);
230
+ state.chain = chain.upper;
231
+ for (let index = chain.choices; index > 0; --index)
232
+ popChoice(state);
233
+ };
234
+ export const makeOptionalNode = (state) => {
235
+ chainIn(state).choices += 1;
236
+ pushChoice(state, { kind: '??', isForkingAsResult: false });
237
+ };
238
+ export const pushBreak = (state, context) => {
239
+ const { breakable, label } = context;
240
+ state.break = { upper: state.break, breakable, label, broken: emptyFork(state.fork) };
241
+ return state.break;
242
+ };
243
+ export const popBreak = (state) => {
244
+ const context = breakIn(state);
245
+ state.break = context.upper;
246
+ if (!context.breakable && !isEmpty(context.broken)) {
247
+ add(context.broken, headOf(state.fork));
248
+ replaceHead(state.fork, makeNext(context.broken, 0, -1));
249
+ }
250
+ return context;
251
+ };
252
+ export const pushSwitch = (state, hasCase, label) => {
253
+ state.switch = { upper: state.switch, hasCase, defaultSegments: [], defaultBody: null, foundEmptyDefault: false, lastIsDefault: false, forks: 0 };
254
+ pushBreak(state, { breakable: true, label });
255
+ };
256
+ export const popSwitch = (state) => {
257
+ const context = switchIn(state);
258
+ state.switch = context.upper;
259
+ const { fork } = state;
260
+ const { broken } = popBreak(state);
261
+ if (context.forks === 0) {
262
+ if (!isEmpty(broken)) {
263
+ add(broken, makeNext(fork, -1, -1));
264
+ replaceHead(fork, makeNext(broken, 0, -1));
265
+ }
266
+ return;
267
+ }
268
+ const lastSegments = headOf(fork);
269
+ forkBypassPath(state);
270
+ const lastCaseSegments = headOf(fork);
271
+ add(broken, lastSegments);
272
+ // A default that is not last runs after the last case falls through, so its body loops back from there.
273
+ if (!context.lastIsDefault) {
274
+ if (context.defaultBody) {
275
+ disconnect(state, context.defaultSegments, context.defaultBody);
276
+ makeLooped(state, lastCaseSegments, context.defaultBody);
277
+ }
278
+ else {
279
+ add(broken, lastCaseSegments);
280
+ }
281
+ }
282
+ for (let index = 0; index < context.forks; ++index)
283
+ state.fork = upperFork(state);
284
+ replaceHead(state.fork, makeNext(broken, 0, -1));
285
+ };
286
+ export const makeSwitchCaseBody = (state, body) => {
287
+ const { isEmpty: isBodyEmpty, isDefault } = body;
288
+ const context = switchIn(state);
289
+ if (!context.hasCase)
290
+ return;
291
+ const parent = state.fork;
292
+ const fork = pushFork(state);
293
+ add(fork, makeNext(parent, 0, -1));
294
+ if (isDefault) {
295
+ context.defaultSegments = headOf(parent);
296
+ if (isBodyEmpty)
297
+ context.foundEmptyDefault = true;
298
+ else
299
+ context.defaultBody = headOf(fork);
300
+ }
301
+ else if (!isBodyEmpty && context.foundEmptyDefault) {
302
+ context.foundEmptyDefault = false;
303
+ context.defaultBody = headOf(fork);
304
+ }
305
+ context.lastIsDefault = isDefault;
306
+ context.forks += 1;
307
+ };
308
+ export const pushTry = (state, hasFinalizer) => {
309
+ const { fork } = state;
310
+ state.try = {
311
+ upper: state.try,
312
+ hasFinalizer,
313
+ position: 'try',
314
+ returned: emptyFork(fork),
315
+ thrown: emptyFork(fork),
316
+ lastOfTryIsReachable: false,
317
+ lastOfCatchIsReachable: false,
318
+ };
319
+ };
320
+ export const popTry = (state) => {
321
+ const context = tryIn(state);
322
+ state.try = context.upper;
323
+ if (context.position === 'catch') {
324
+ popFork(state);
325
+ return;
326
+ }
327
+ if (isEmpty(context.returned) && isEmpty(context.thrown))
328
+ return;
329
+ // The finally's fork runs a normal half and a leaving half, which goes on to return or throw.
330
+ const head = headOf(state.fork);
331
+ state.fork = upperFork(state);
332
+ const half = head.length / 2;
333
+ const normal = head.slice(0, half);
334
+ const leaving = head.slice(half);
335
+ if (!isEmpty(context.returned))
336
+ addReturned(state, leaving);
337
+ if (!isEmpty(context.thrown))
338
+ addThrown(state, leaving);
339
+ replaceHead(state.fork, normal);
340
+ // ESLint makes segments here and drops them, which only spends their ids, kept so ids match its own.
341
+ if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable)
342
+ makeUnreachable(state.fork, 1, 0);
343
+ };
344
+ export const makeCatchBlock = (state) => {
345
+ const context = tryIn(state);
346
+ const { fork } = state;
347
+ const thrown = context.thrown;
348
+ context.position = 'catch';
349
+ context.thrown = emptyFork(fork);
350
+ context.lastOfTryIsReachable = isReachable(fork);
351
+ add(thrown, headOf(fork));
352
+ const thrownSegments = makeNext(thrown, 0, -1);
353
+ pushFork(state);
354
+ forkBypassPath(state);
355
+ add(state.fork, thrownSegments);
356
+ };
357
+ export const makeFinallyBlock = (state) => {
358
+ const context = tryIn(state);
359
+ const { returned, thrown } = context;
360
+ const headOfLeaving = headOf(state.fork);
361
+ if (context.position === 'catch') {
362
+ popFork(state);
363
+ context.lastOfCatchIsReachable = isReachable(state.fork);
364
+ }
365
+ else {
366
+ context.lastOfTryIsReachable = isReachable(state.fork);
367
+ }
368
+ context.position = 'finally';
369
+ if (isEmpty(returned) && isEmpty(thrown))
370
+ return;
371
+ const { fork } = state;
372
+ const segments = makeNext(fork, -1, -1);
373
+ for (let index = 0; index < fork.count; ++index) {
374
+ const previous = [segmentAt(state.faults, headOfLeaving, index)];
375
+ for (const step of returned.list)
376
+ previous.push(...step.slice(index, index + 1));
377
+ for (const step of thrown.list)
378
+ previous.push(...step.slice(index, index + 1));
379
+ segments.push(newNext(nextId(state.ids), previous));
380
+ }
381
+ state.fork = leavingFork(state.fork);
382
+ add(state.fork, segments);
383
+ };
384
+ export const makeYield = (state) => {
385
+ const { fork } = state;
386
+ if (!isReachable(fork))
387
+ return;
388
+ const leaving = headOf(fork);
389
+ addReturned(state, leaving);
390
+ addThrown(state, leaving);
391
+ replaceHead(fork, makeNext(fork, -1, -1));
392
+ };
393
+ // The first node that can throw inside a try forks the path to its catch, once per block.
394
+ export const makeFirstThrowable = (state) => {
395
+ const { fork } = state;
396
+ if (!isReachable(fork))
397
+ return;
398
+ const context = throwContextOf(state);
399
+ if (!context || !isEmpty(context.thrown))
400
+ return;
401
+ add(context.thrown, headOf(fork));
402
+ replaceHead(fork, makeNext(fork, -1, -1));
403
+ };
404
+ export const pushLoop = (state, type, label) => {
405
+ const { broken } = pushBreak(state, { breakable: true, label });
406
+ if (type === 'WhileStatement' || type === 'DoWhileStatement' || type === 'ForStatement')
407
+ pushChoice(state, { kind: 'loop', isForkingAsResult: false });
408
+ state.loop = {
409
+ upper: state.loop,
410
+ type,
411
+ label,
412
+ broken,
413
+ test: undefined,
414
+ continueDestination: null,
415
+ continued: emptyFork(state.fork),
416
+ entry: null,
417
+ endOfInit: null,
418
+ testSegments: null,
419
+ endOfTest: null,
420
+ update: null,
421
+ endOfUpdate: null,
422
+ previous: null,
423
+ left: null,
424
+ endOfLeft: null,
425
+ };
426
+ };
427
+ export const popLoop = (state) => {
428
+ const context = loopIn(state);
429
+ state.loop = context.upper;
430
+ const { fork } = state;
431
+ const { broken } = popBreak(state);
432
+ switch (context.type) {
433
+ case 'WhileStatement':
434
+ case 'ForStatement':
435
+ popChoice(state);
436
+ makeLooped(state, headOf(fork), segmentsIn(state, context.continueDestination));
437
+ break;
438
+ case 'DoWhileStatement': {
439
+ const choice = choiceIn(state);
440
+ popChoice(state);
441
+ if (!choice.processed) {
442
+ add(choice.true, headOf(fork));
443
+ add(choice.false, headOf(fork));
444
+ }
445
+ if (context.test !== true)
446
+ addAll(broken, choice.false);
447
+ const entry = segmentsIn(state, context.entry);
448
+ for (const segments of choice.true.list)
449
+ makeLooped(state, segments, entry);
450
+ break;
451
+ }
452
+ case 'ForInStatement':
453
+ case 'ForOfStatement':
454
+ add(broken, headOf(fork));
455
+ makeLooped(state, headOf(fork), segmentsIn(state, context.left));
456
+ break;
457
+ }
458
+ if (isEmpty(broken))
459
+ replaceHead(fork, makeUnreachable(fork, -1, -1));
460
+ else
461
+ replaceHead(fork, makeNext(broken, 0, -1));
462
+ };
463
+ export const makeWhileTest = (state, test) => {
464
+ const context = loopIn(state);
465
+ const segments = makeNext(state.fork, 0, -1);
466
+ context.test = test;
467
+ context.continueDestination = segments;
468
+ replaceHead(state.fork, segments);
469
+ };
470
+ export const makeWhileBody = (state) => {
471
+ const context = loopIn(state);
472
+ const choice = choiceIn(state);
473
+ const { fork } = state;
474
+ if (!choice.processed) {
475
+ add(choice.true, headOf(fork));
476
+ add(choice.false, headOf(fork));
477
+ }
478
+ if (context.test !== true)
479
+ addAll(context.broken, choice.false);
480
+ replaceHead(fork, makeNext(choice.true, 0, -1));
481
+ };
482
+ export const makeDoWhileBody = (state) => {
483
+ const context = loopIn(state);
484
+ const segments = makeNext(state.fork, -1, -1);
485
+ context.entry = segments;
486
+ replaceHead(state.fork, segments);
487
+ };
488
+ export const makeDoWhileTest = (state, test) => {
489
+ const context = loopIn(state);
490
+ context.test = test;
491
+ if (isEmpty(context.continued))
492
+ return;
493
+ add(context.continued, headOf(state.fork));
494
+ replaceHead(state.fork, makeNext(context.continued, 0, -1));
495
+ };
496
+ export const makeForTest = (state, test) => {
497
+ const context = loopIn(state);
498
+ const { fork } = state;
499
+ const endOfInit = headOf(fork);
500
+ const segments = makeNext(fork, -1, -1);
501
+ context.test = test;
502
+ context.endOfInit = endOfInit;
503
+ context.continueDestination = segments;
504
+ context.testSegments = segments;
505
+ replaceHead(fork, segments);
506
+ };
507
+ export const makeForUpdate = (state) => {
508
+ const context = loopIn(state);
509
+ const { fork } = state;
510
+ if (context.testSegments)
511
+ finalizeForTest(context, choiceIn(state), headOf(fork));
512
+ else
513
+ context.endOfInit = headOf(fork);
514
+ const segments = makeDisconnected(fork, -1, -1);
515
+ context.continueDestination = segments;
516
+ context.update = segments;
517
+ replaceHead(fork, segments);
518
+ };
519
+ export const makeForBody = (state) => {
520
+ const context = loopIn(state);
521
+ const { fork } = state;
522
+ if (context.update) {
523
+ context.endOfUpdate = headOf(fork);
524
+ if (context.testSegments)
525
+ makeLooped(state, context.endOfUpdate, context.testSegments);
526
+ }
527
+ else if (context.testSegments) {
528
+ finalizeForTest(context, choiceIn(state), headOf(fork));
529
+ }
530
+ else {
531
+ context.endOfInit = headOf(fork);
532
+ }
533
+ let body = context.endOfTest;
534
+ if (!body) {
535
+ const previous = emptyFork(fork);
536
+ add(previous, segmentsIn(state, context.endOfInit));
537
+ if (context.endOfUpdate)
538
+ add(previous, context.endOfUpdate);
539
+ body = makeNext(previous, 0, -1);
540
+ }
541
+ context.continueDestination = context.continueDestination ?? body;
542
+ replaceHead(fork, body);
543
+ };
544
+ export const makeForInOfLeft = (state) => {
545
+ const context = loopIn(state);
546
+ const { fork } = state;
547
+ const segments = makeDisconnected(fork, -1, -1);
548
+ context.previous = headOf(fork);
549
+ context.left = segments;
550
+ context.continueDestination = segments;
551
+ replaceHead(fork, segments);
552
+ };
553
+ export const makeForInOfRight = (state) => {
554
+ const context = loopIn(state);
555
+ const { fork } = state;
556
+ const segments = segmentsIn(state, context.previous).map((previous) => newNext(nextId(state.ids), [previous]));
557
+ context.endOfLeft = headOf(fork);
558
+ replaceHead(fork, segments);
559
+ };
560
+ export const makeForInOfBody = (state) => {
561
+ const context = loopIn(state);
562
+ const { fork } = state;
563
+ const segments = segmentsIn(state, context.endOfLeft).map((previous) => newNext(nextId(state.ids), [previous]));
564
+ makeLooped(state, headOf(fork), segmentsIn(state, context.left));
565
+ add(context.broken, headOf(fork));
566
+ replaceHead(fork, segments);
567
+ };
568
+ export const makeBreak = (state, label) => {
569
+ const { fork } = state;
570
+ if (!isReachable(fork))
571
+ return;
572
+ const context = breakContextOf(state, label);
573
+ if (context)
574
+ add(context.broken, headOf(fork));
575
+ replaceHead(fork, makeUnreachable(fork, -1, -1));
576
+ };
577
+ export const makeContinue = (state, label) => {
578
+ const { fork } = state;
579
+ if (!isReachable(fork))
580
+ return;
581
+ const context = continueContextOf(state, label);
582
+ if (context) {
583
+ if (context.continueDestination) {
584
+ makeLooped(state, headOf(fork), context.continueDestination);
585
+ if (context.type === 'ForInStatement' || context.type === 'ForOfStatement')
586
+ add(context.broken, headOf(fork));
587
+ }
588
+ else {
589
+ add(context.continued, headOf(fork));
590
+ }
591
+ }
592
+ replaceHead(fork, makeUnreachable(fork, -1, -1));
593
+ };
594
+ export const makeReturn = (state) => {
595
+ const { fork } = state;
596
+ if (!isReachable(fork))
597
+ return;
598
+ addReturned(state, headOf(fork));
599
+ replaceHead(fork, makeUnreachable(fork, -1, -1));
600
+ };
601
+ export const makeThrow = (state) => {
602
+ const { fork } = state;
603
+ if (!isReachable(fork))
604
+ return;
605
+ addThrown(state, headOf(fork));
606
+ replaceHead(fork, makeUnreachable(fork, -1, -1));
607
+ };
608
+ export const makeFinal = (state) => {
609
+ if (someReachable(state.current))
610
+ addEnding(state, 'returned', state.current);
611
+ };
@@ -0,0 +1,13 @@
1
+ import { type Node, type Parsed } from '../../utils/ast.ts';
2
+ import type { Paths } from './paths.ts';
3
+ export type EntryKind = 'export' | 'default' | 'fetch' | 'method' | 'procedure' | 'tool';
4
+ export type Entry = {
5
+ kind: EntryKind;
6
+ name: string;
7
+ key: string;
8
+ };
9
+ export declare const declaredFunctionsOf: (declaration: Node) => {
10
+ name: string;
11
+ node: Node;
12
+ }[];
13
+ export declare const entriesOf: (source: string, parsed: Parsed, paths: Paths) => Entry[];