functionalscript 0.45.0 → 0.46.1

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 (296) hide show
  1. package/README.md +5 -3
  2. package/fjs/asn.1/module.f.mjs +8 -1
  3. package/fjs/asn.1/proof.f.d.mts +10 -0
  4. package/fjs/asn.1/proof.f.mjs +16 -0
  5. package/fjs/basen/base128/module.f.mjs +22 -5
  6. package/fjs/bnf/data/module.f.d.mts +32 -6
  7. package/fjs/bnf/data/module.f.mjs +112 -7
  8. package/fjs/bnf/data/proof.f.d.mts +2 -0
  9. package/fjs/bnf/data/proof.f.mjs +74 -3
  10. package/fjs/bnf/data/types.d.ts +20 -2
  11. package/fjs/bnf/descent/module.f.d.mts +28 -14
  12. package/fjs/bnf/descent/module.f.mjs +122 -77
  13. package/fjs/bnf/descent/proof.f.d.mts +2 -0
  14. package/fjs/bnf/descent/proof.f.mjs +117 -31
  15. package/fjs/bnf/descent/types.d.ts +12 -14
  16. package/fjs/bnf/ll1/module.f.d.mts +64 -22
  17. package/fjs/bnf/ll1/module.f.mjs +214 -154
  18. package/fjs/bnf/ll1/proof.f.d.mts +15 -2
  19. package/fjs/bnf/ll1/proof.f.mjs +323 -149
  20. package/fjs/bnf/ll1/types.d.ts +16 -24
  21. package/fjs/bnf/matcher/module.f.d.mts +66 -0
  22. package/fjs/bnf/matcher/module.f.mjs +81 -0
  23. package/fjs/bnf/matcher/proof.f.d.mts +10 -0
  24. package/fjs/bnf/matcher/proof.f.mjs +79 -0
  25. package/fjs/bnf/matcher/types.d.ts +54 -0
  26. package/fjs/bnf/testlib.f.d.mts +31 -0
  27. package/fjs/bnf/testlib.f.mjs +80 -0
  28. package/fjs/cas/cli/module.f.d.mts +1 -1
  29. package/fjs/cas/cli/module.f.mjs +14 -20
  30. package/fjs/cas/cli/proof.f.d.mts +1 -3
  31. package/fjs/cas/cli/proof.f.mjs +44 -33
  32. package/fjs/cas/evo/module.f.d.mts +64 -18
  33. package/fjs/cas/evo/module.f.mjs +148 -70
  34. package/fjs/cas/evo/proof.f.d.mts +10 -1
  35. package/fjs/cas/evo/proof.f.mjs +305 -223
  36. package/fjs/cas/evo/types.d.ts +45 -9
  37. package/fjs/cas/module.f.d.mts +18 -32
  38. package/fjs/cas/module.f.mjs +129 -128
  39. package/fjs/cas/proof.f.d.mts +11 -8
  40. package/fjs/cas/proof.f.mjs +259 -147
  41. package/fjs/cas/types.d.ts +24 -10
  42. package/fjs/ci/config/module.f.d.mts +2 -2
  43. package/fjs/ci/config/module.f.mjs +2 -2
  44. package/fjs/ci/module.f.d.mts +5 -5
  45. package/fjs/ci/module.f.mjs +8 -7
  46. package/fjs/ci/nix/module.f.d.mts +7 -5
  47. package/fjs/ci/nix/module.f.mjs +13 -12
  48. package/fjs/ci/nix/proof.f.mjs +2 -2
  49. package/fjs/ci/proof.f.mjs +9 -5
  50. package/fjs/cli/module.f.d.mts +4 -6
  51. package/fjs/cli/module.f.mjs +4 -8
  52. package/fjs/cli/proof.f.mjs +17 -16
  53. package/fjs/cli/types.d.ts +2 -3
  54. package/fjs/common/monoid/types.d.ts +1 -1
  55. package/fjs/crypto/hmac/module.f.mjs +2 -2
  56. package/fjs/crypto/sha2/module.f.mjs +3 -1
  57. package/fjs/crypto/sha2/proof.f.d.mts +1 -0
  58. package/fjs/crypto/sha2/proof.f.mjs +24 -0
  59. package/fjs/crypto/sha2/types.d.ts +11 -0
  60. package/fjs/crypto/sign/module.f.mjs +2 -2
  61. package/fjs/dev/module.f.d.mts +13 -4
  62. package/fjs/dev/module.f.mjs +56 -27
  63. package/fjs/dev/update/module.f.d.mts +9 -4
  64. package/fjs/dev/update/module.f.mjs +14 -10
  65. package/fjs/dev/update/proof.f.d.mts +1 -3
  66. package/fjs/dev/update/proof.f.mjs +10 -5
  67. package/fjs/djs/module.f.d.mts +13 -5
  68. package/fjs/djs/module.f.mjs +31 -16
  69. package/fjs/djs/parser/module.f.d.mts +13 -3
  70. package/fjs/djs/parser/module.f.mjs +117 -16
  71. package/fjs/djs/parser/proof.f.d.mts +5 -1
  72. package/fjs/djs/parser/proof.f.mjs +274 -12
  73. package/fjs/djs/parser/types.d.ts +7 -1
  74. package/fjs/djs/proof.f.d.mts +18 -2
  75. package/fjs/djs/proof.f.mjs +187 -12
  76. package/fjs/djs/serializer/module.f.d.mts +25 -8
  77. package/fjs/djs/serializer/module.f.mjs +61 -15
  78. package/fjs/djs/serializer/proof.f.d.mts +5 -0
  79. package/fjs/djs/serializer/proof.f.mjs +23 -1
  80. package/fjs/djs/tokenizer/module.f.d.mts +17 -5
  81. package/fjs/djs/tokenizer/module.f.mjs +99 -60
  82. package/fjs/djs/tokenizer/proof.f.d.mts +1 -1
  83. package/fjs/djs/tokenizer/proof.f.mjs +74 -67
  84. package/fjs/djs/transpiler/module.f.d.mts +12 -7
  85. package/fjs/djs/transpiler/module.f.mjs +82 -56
  86. package/fjs/djs/transpiler/types.d.ts +7 -3
  87. package/fjs/djs/types.d.ts +7 -1
  88. package/fjs/effects/list/module.f.d.mts +14 -11
  89. package/fjs/effects/list/module.f.mjs +13 -11
  90. package/fjs/effects/list/types.d.ts +27 -7
  91. package/fjs/effects/memory/module.f.d.mts +2 -1
  92. package/fjs/effects/memory/module.f.mjs +3 -4
  93. package/fjs/effects/memory/proof.f.mjs +13 -7
  94. package/fjs/effects/memory/types.d.ts +4 -3
  95. package/fjs/effects/mock/module.f.d.mts +20 -4
  96. package/fjs/effects/mock/module.f.mjs +37 -5
  97. package/fjs/effects/mock/types.d.ts +10 -1
  98. package/fjs/effects/module.d.mts +4 -2
  99. package/fjs/effects/module.f.d.mts +466 -280
  100. package/fjs/effects/module.f.mjs +537 -299
  101. package/fjs/effects/module.mjs +2 -1
  102. package/fjs/effects/node/memory/module.d.mts +4 -2
  103. package/fjs/effects/node/memory/module.mjs +6 -3
  104. package/fjs/effects/node/memory/proof.mjs +10 -4
  105. package/fjs/effects/node/module.d.mts +4 -3
  106. package/fjs/effects/node/module.f.d.mts +168 -33
  107. package/fjs/effects/node/module.f.mjs +256 -52
  108. package/fjs/effects/node/module.mjs +57 -34
  109. package/fjs/effects/node/proof.f.d.mts +28 -2
  110. package/fjs/effects/node/proof.f.mjs +161 -42
  111. package/fjs/effects/node/types.d.ts +106 -18
  112. package/fjs/effects/node/virtual/module.f.d.mts +18 -4
  113. package/fjs/effects/node/virtual/module.f.mjs +110 -68
  114. package/fjs/effects/node/virtual/proof.f.d.mts +28 -2
  115. package/fjs/effects/node/virtual/proof.f.mjs +190 -9
  116. package/fjs/effects/proof.f.d.mts +69 -37
  117. package/fjs/effects/proof.f.mjs +410 -130
  118. package/fjs/effects/types.d.ts +161 -33
  119. package/fjs/emergent_testing/module.f.d.mts +19 -12
  120. package/fjs/emergent_testing/module.f.mjs +93 -33
  121. package/fjs/emergent_testing/proof.f.d.mts +21 -7
  122. package/fjs/emergent_testing/proof.f.mjs +166 -32
  123. package/fjs/emergent_testing/types.d.ts +22 -4
  124. package/fjs/fsm/module.f.d.mts +14 -4
  125. package/fjs/fsm/module.f.mjs +54 -37
  126. package/fjs/fsm/proof.f.d.mts +2 -0
  127. package/fjs/fsm/proof.f.mjs +83 -114
  128. package/fjs/js/keywords/module.f.d.mts +52 -0
  129. package/fjs/js/keywords/module.f.mjs +72 -0
  130. package/fjs/js/keywords/proof.f.d.mts +3 -0
  131. package/fjs/js/keywords/proof.f.mjs +13 -0
  132. package/fjs/js/tokenizer/module.f.d.mts +26 -6
  133. package/fjs/js/tokenizer/module.f.mjs +145 -159
  134. package/fjs/js/tokenizer/proof.f.d.mts +1 -0
  135. package/fjs/js/tokenizer/proof.f.mjs +54 -24
  136. package/fjs/js/tokenizer/types.d.ts +33 -24
  137. package/fjs/mcp/cas/module.f.d.mts +1 -6
  138. package/fjs/mcp/cas/module.f.mjs +55 -51
  139. package/fjs/mcp/cas/proof.f.d.mts +15 -0
  140. package/fjs/mcp/cas/proof.f.mjs +174 -0
  141. package/fjs/mcp/evo/module.f.d.mts +19 -10
  142. package/fjs/mcp/evo/module.f.mjs +48 -27
  143. package/fjs/mcp/evo/proof.f.d.mts +6 -1
  144. package/fjs/mcp/evo/proof.f.mjs +115 -31
  145. package/fjs/mcp/module.f.d.mts +4 -4
  146. package/fjs/mcp/module.f.mjs +6 -6
  147. package/fjs/mcp/proof.f.d.mts +5 -3
  148. package/fjs/mcp/proof.f.mjs +112 -46
  149. package/fjs/media/html/module.f.mjs +1 -1
  150. package/fjs/media/json/extended/module.f.d.mts +82 -0
  151. package/fjs/media/json/extended/module.f.mjs +153 -0
  152. package/fjs/media/json/extended/proof.f.d.mts +42 -0
  153. package/fjs/media/json/extended/proof.f.mjs +127 -0
  154. package/fjs/media/json/extended/types.d.ts +23 -0
  155. package/fjs/media/json/module.f.d.mts +8 -2
  156. package/fjs/media/json/module.f.mjs +43 -41
  157. package/fjs/media/json/number/module.f.d.mts +59 -0
  158. package/fjs/media/json/number/module.f.mjs +136 -0
  159. package/fjs/media/json/number/proof.f.d.mts +24 -0
  160. package/fjs/media/json/number/proof.f.mjs +86 -0
  161. package/fjs/media/json/number/types.d.ts +28 -0
  162. package/fjs/media/json/parser/module.f.d.mts +25 -13
  163. package/fjs/media/json/parser/module.f.mjs +114 -70
  164. package/fjs/media/json/parser/proof.f.d.mts +5 -0
  165. package/fjs/media/json/parser/proof.f.mjs +31 -1
  166. package/fjs/media/json/parser/types.d.ts +33 -14
  167. package/fjs/media/json/rtti/module.f.d.mts +1 -1
  168. package/fjs/media/json/rtti/module.f.mjs +1 -1
  169. package/fjs/media/json/rtti/proof.f.mjs +9 -9
  170. package/fjs/media/json/schema/module.f.mjs +3 -13
  171. package/fjs/media/json/schema/proof.f.d.mts +0 -1
  172. package/fjs/media/json/schema/proof.f.mjs +1 -2
  173. package/fjs/media/json/serializer/module.f.d.mts +32 -1
  174. package/fjs/media/json/serializer/module.f.mjs +64 -2
  175. package/fjs/media/json/tokenizer/module.f.mjs +7 -3
  176. package/fjs/media/json/tokenizer/proof.f.d.mts +6 -0
  177. package/fjs/media/json/tokenizer/proof.f.mjs +62 -21
  178. package/fjs/media/json/types.d.ts +36 -10
  179. package/fjs/media/lock/module.f.d.mts +100 -0
  180. package/fjs/media/lock/module.f.mjs +125 -0
  181. package/fjs/media/lock/proof.f.d.mts +33 -0
  182. package/fjs/media/lock/proof.f.mjs +196 -0
  183. package/fjs/media/lock/types.d.ts +15 -0
  184. package/fjs/media/module.f.d.mts +6 -5
  185. package/fjs/media/module.f.mjs +8 -7
  186. package/fjs/media/note/module.f.d.mts +121 -0
  187. package/fjs/media/note/module.f.mjs +131 -0
  188. package/fjs/media/note/proof.f.d.mts +29 -0
  189. package/fjs/media/note/proof.f.mjs +150 -0
  190. package/fjs/media/note/types.d.ts +10 -0
  191. package/fjs/media/proof.f.d.mts +4 -1
  192. package/fjs/media/proof.f.mjs +40 -21
  193. package/fjs/media/revision/module.f.d.mts +78 -7
  194. package/fjs/media/revision/module.f.mjs +119 -12
  195. package/fjs/media/revision/proof.f.d.mts +10 -0
  196. package/fjs/media/revision/proof.f.mjs +88 -0
  197. package/fjs/media/revision/types.d.ts +34 -5
  198. package/fjs/media/type/module.f.d.mts +33 -15
  199. package/fjs/media/type/module.f.mjs +35 -29
  200. package/fjs/media/type/proof.f.d.mts +2 -1
  201. package/fjs/media/type/proof.f.mjs +30 -10
  202. package/fjs/module.f.mjs +29 -8
  203. package/fjs/nanvm/proof.f.mjs +3 -3
  204. package/fjs/nanvm/rust/module.f.mjs +1 -1
  205. package/fjs/nanvm/update/module.f.d.mts +4 -4
  206. package/fjs/nanvm/update/module.f.mjs +8 -9
  207. package/fjs/nanvm/update/proof.f.mjs +4 -3
  208. package/fjs/proof.f.d.mts +3 -3
  209. package/fjs/proof.f.mjs +36 -10
  210. package/fjs/protocol/json_rpc/module.f.d.mts +2 -2
  211. package/fjs/protocol/json_rpc/module.f.mjs +3 -3
  212. package/fjs/protocol/json_rpc/proof.f.mjs +4 -4
  213. package/fjs/protocol/mcp/module.f.d.mts +10 -13
  214. package/fjs/protocol/mcp/module.f.mjs +74 -58
  215. package/fjs/protocol/mcp/proof.f.d.mts +13 -4
  216. package/fjs/protocol/mcp/proof.f.mjs +193 -61
  217. package/fjs/protocol/mcp/stdio/module.f.d.mts +15 -7
  218. package/fjs/protocol/mcp/stdio/module.f.mjs +38 -25
  219. package/fjs/protocol/mcp/stdio/proof.f.d.mts +4 -2
  220. package/fjs/protocol/mcp/stdio/proof.f.mjs +45 -12
  221. package/fjs/protocol/mcp/stdio/types.d.ts +1 -1
  222. package/fjs/protocol/mcp/types.d.ts +17 -6
  223. package/fjs/sul/id/module.f.d.mts +0 -1
  224. package/fjs/sul/id/module.f.mjs +2 -3
  225. package/fjs/sul/level/hash/module.f.mjs +2 -1
  226. package/fjs/sul/level/hash/proof.f.mjs +2 -2
  227. package/fjs/sul/module.f.mjs +18 -13
  228. package/fjs/text/code_point/module.f.d.mts +8 -0
  229. package/fjs/text/code_point/module.f.mjs +8 -1
  230. package/fjs/text/code_point/proof.f.d.mts +1 -0
  231. package/fjs/text/code_point/proof.f.mjs +11 -0
  232. package/fjs/text/sgr/module.f.d.mts +4 -6
  233. package/fjs/text/sgr/module.f.mjs +6 -7
  234. package/fjs/text/utf16/module.f.mjs +7 -2
  235. package/fjs/text/utf16/proof.f.mjs +3 -3
  236. package/fjs/text/utf8/module.f.mjs +4 -2
  237. package/fjs/types/array/module.f.mjs +14 -2
  238. package/fjs/types/bit_vec/module.f.d.mts +0 -2
  239. package/fjs/types/bit_vec/module.f.mjs +46 -32
  240. package/fjs/types/bit_vec/proof.f.mjs +2 -2
  241. package/fjs/types/btree/remove/module.f.mjs +1 -1
  242. package/fjs/types/btree/set/module.f.mjs +9 -11
  243. package/fjs/types/btree/set/proof.f.mjs +12 -0
  244. package/fjs/types/byte_set/module.f.d.mts +11 -4
  245. package/fjs/types/byte_set/module.f.mjs +14 -6
  246. package/fjs/types/byte_set/proof.f.mjs +7 -7
  247. package/fjs/types/function/compare/module.f.mjs +10 -3
  248. package/fjs/types/list/module.f.d.mts +1 -1
  249. package/fjs/types/list/module.f.mjs +1 -1
  250. package/fjs/types/nullable/module.f.d.mts +18 -4
  251. package/fjs/types/nullable/module.f.mjs +21 -4
  252. package/fjs/types/nullable/proof.f.d.mts +4 -0
  253. package/fjs/types/nullable/proof.f.mjs +15 -0
  254. package/fjs/types/object/module.f.d.mts +12 -2
  255. package/fjs/types/object/module.f.mjs +11 -1
  256. package/fjs/types/patricia_trie/module.f.mjs +26 -11
  257. package/fjs/types/result/module.f.d.mts +3 -3
  258. package/fjs/types/result/module.f.mjs +3 -3
  259. package/fjs/types/rtti/common/module.f.d.mts +25 -28
  260. package/fjs/types/rtti/common/module.f.mjs +36 -32
  261. package/fjs/types/rtti/common/proof.f.mjs +5 -5
  262. package/fjs/types/rtti/data/module.f.d.mts +14 -0
  263. package/fjs/types/rtti/data/module.f.mjs +25 -2
  264. package/fjs/types/rtti/data/proof.f.d.mts +1 -0
  265. package/fjs/types/rtti/data/proof.f.mjs +25 -2
  266. package/fjs/types/rtti/parse/module.f.d.mts +24 -14
  267. package/fjs/types/rtti/parse/module.f.mjs +37 -28
  268. package/fjs/types/rtti/parse/proof.f.d.mts +3 -2
  269. package/fjs/types/rtti/parse/proof.f.mjs +33 -14
  270. package/fjs/types/rtti/proof.f.mjs +3 -1
  271. package/fjs/types/rtti/ts/module.f.mjs +13 -17
  272. package/fjs/types/rtti/ts/types.d.ts +14 -1
  273. package/fjs/types/rtti/validate/module.f.d.mts +81 -19
  274. package/fjs/types/rtti/validate/module.f.mjs +107 -61
  275. package/fjs/types/rtti/validate/proof.f.d.mts +13 -10
  276. package/fjs/types/rtti/validate/proof.f.mjs +186 -197
  277. package/fjs/types/sorted_set/module.f.d.mts +18 -0
  278. package/fjs/types/sorted_set/module.f.mjs +22 -0
  279. package/fjs/types/sorted_set/proof.f.d.mts +1 -0
  280. package/fjs/types/sorted_set/proof.f.mjs +16 -1
  281. package/fjs/types/uint8array/module.f.d.mts +1 -1
  282. package/fjs/types/uint8array/module.f.mjs +1 -1
  283. package/fjs/website/module.f.d.mts +3 -3
  284. package/fjs/website/module.f.mjs +4 -7
  285. package/fjs/website/proof.f.mjs +2 -1
  286. package/package.json +2 -2
  287. package/fjs/dev/package_json/module.f.d.mts +0 -39
  288. package/fjs/dev/package_json/module.f.mjs +0 -40
  289. package/fjs/dev/package_json/proof.f.d.mts +0 -6
  290. package/fjs/dev/package_json/proof.f.mjs +0 -32
  291. package/fjs/effects/eff/module.f.d.mts +0 -20
  292. package/fjs/effects/eff/module.f.mjs +0 -70
  293. package/fjs/effects/eff/proof.f.d.mts +0 -15
  294. package/fjs/effects/eff/proof.f.mjs +0 -69
  295. package/fjs/effects/eff/types.d.ts +0 -71
  296. package/fjs/types/rtti/validate/types.d.ts +0 -6
@@ -1,11 +1,10 @@
1
1
  /**
2
- * @import { Unknown } from '../types.ts'
3
2
  */
4
3
 
5
- import { descentParser } from '../../bnf/descent/module.f.mjs'
4
+ import { isRepeat, toData } from '../../bnf/data/module.f.mjs'
6
5
  import { stringToCodePointList, stringToList } from '../../text/utf16/module.f.mjs'
7
6
  import { toArray } from '../../types/list/module.f.mjs'
8
- import { jsGrammar, tokenizeString, descentParserCpOnly, tokenizeJs, tokenize } from './module.f.mjs'
7
+ import { jsGrammar, jsMatcher, tokenizeString, descentParserCpOnly, tokenizeJs, tokenize } from './module.f.mjs'
9
8
  import { assert, assertEq } from '../../asserts/module.f.mjs'
10
9
  import { stringifyAsTree } from '../serializer/module.f.mjs'
11
10
  import { sort } from '../../types/object/module.f.mjs'
@@ -25,13 +24,21 @@ const errorAt = s => {
25
24
  }
26
25
 
27
26
  export const proof = {
27
+ // The whole-file grammar is one repetition of a token, and `toData` records
28
+ // that rather than leaving it as the right-recursive variant `repeat0Plus`
29
+ // builds — which is why the tokenizer reads its entry name from `jsMatcher`
30
+ // instead of naming a rule: the rules that encoded the repetition are gone.
31
+ jsGrammar: () => {
32
+ const [ruleSet, entry] = toData(jsGrammar())
33
+ assert(isRepeat(ruleSet[entry]), JSON.stringify([ruleSet[entry], entry]))
34
+ },
28
35
  isValid: [() => {
29
- const m = descentParser(jsGrammar())
36
+ const [m, entry] = jsMatcher()
30
37
 
31
38
  /** @type {(s: string, expected: boolean) => void} */
32
39
  const expect = (s, expected) => {
33
40
  const cp = toArray(stringToCodePointList(s))
34
- const mr = descentParserCpOnly(m, '', cp)
41
+ const mr = descentParserCpOnly(m, entry, cp)
35
42
  const success = mr.success && mr.idx === cp.length
36
43
  assertEq(success, expected, JSON.stringify([s, mr]))
37
44
  }
@@ -67,121 +74,121 @@ export const proof = {
67
74
  ],
68
75
  tokenizer: [
69
76
  () => {
70
- const m = descentParser(jsGrammar())
77
+ const [m, entry] = jsMatcher()
71
78
  const cp = toArray(stringToCodePointList('tr'))
72
- const mr = descentParserCpOnly(m, '', cp)
79
+ const mr = descentParserCpOnly(m, entry, cp)
73
80
  const seq = mr.ast.sequence[0]
74
81
  assert(!(seq instanceof Array), JSON.stringify(mr))
75
82
  assertEq(seq.tag, 'id', JSON.stringify(mr))
76
83
  },
77
84
  () => {
78
- const m = descentParser(jsGrammar())
85
+ const [m, entry] = jsMatcher()
79
86
  const cp = toArray(stringToCodePointList('"tr"'))
80
- const mr = descentParserCpOnly(m, '', cp)
87
+ const mr = descentParserCpOnly(m, entry, cp)
81
88
  const seq = mr.ast.sequence[0]
82
89
  assert(!(seq instanceof Array), JSON.stringify(mr))
83
90
  assertEq(seq.tag, 'string', JSON.stringify(mr))
84
91
  },
85
92
  () => {
86
- const m = descentParser(jsGrammar())
93
+ const [m, entry] = jsMatcher()
87
94
  const cp = toArray(stringToCodePointList('56.7e+5'))
88
- const mr = descentParserCpOnly(m, '', cp)
95
+ const mr = descentParserCpOnly(m, entry, cp)
89
96
  const seq = mr.ast.sequence[0]
90
97
  assert(!(seq instanceof Array), JSON.stringify(mr))
91
98
  assertEq(seq.tag, 'number', JSON.stringify(mr))
92
99
  },
93
100
  () => {
94
- const m = descentParser(jsGrammar())
101
+ const [m, entry] = jsMatcher()
95
102
  const cp = toArray(stringToCodePointList('56n'))
96
- const mr = descentParserCpOnly(m, '', cp)
103
+ const mr = descentParserCpOnly(m, entry, cp)
97
104
  const seq = mr.ast.sequence[0]
98
105
  assert(!(seq instanceof Array), JSON.stringify(mr))
99
106
  assertEq(seq.tag, 'number', JSON.stringify(mr))
100
107
  },
101
108
  () => {
102
- const m = descentParser(jsGrammar())
109
+ const [m, entry] = jsMatcher()
103
110
  const cp = toArray(stringToCodePointList('*'))
104
- const mr = descentParserCpOnly(m, '', cp)
111
+ const mr = descentParserCpOnly(m, entry, cp)
105
112
  const seq = mr.ast.sequence[0]
106
113
  assert(!(seq instanceof Array), JSON.stringify(mr))
107
114
  assertEq(seq.tag, '*', JSON.stringify(mr))
108
115
  },
109
116
  () => {
110
- const m = descentParser(jsGrammar())
117
+ const [m, entry] = jsMatcher()
111
118
  const cp = toArray(stringToCodePointList('**'))
112
- const mr = descentParserCpOnly(m, '', cp)
119
+ const mr = descentParserCpOnly(m, entry, cp)
113
120
  const seq = mr.ast.sequence[0]
114
121
  assert(!(seq instanceof Array), JSON.stringify(mr))
115
122
  assertEq(seq.tag, '**', JSON.stringify(mr))
116
123
  },
117
124
  () => {
118
- const m = descentParser(jsGrammar())
125
+ const [m, entry] = jsMatcher()
119
126
  const cp = toArray(stringToCodePointList('=>'))
120
- const mr = descentParserCpOnly(m, '', cp)
127
+ const mr = descentParserCpOnly(m, entry, cp)
121
128
  const seq = mr.ast.sequence[0]
122
129
  assert(!(seq instanceof Array), JSON.stringify(mr))
123
130
  assertEq(seq.tag, '=>', JSON.stringify(mr))
124
131
  },
125
132
  () => {
126
- const m = descentParser(jsGrammar())
133
+ const [m, entry] = jsMatcher()
127
134
  const cp = toArray(stringToCodePointList('=='))
128
- const mr = descentParserCpOnly(m, '', cp)
135
+ const mr = descentParserCpOnly(m, entry, cp)
129
136
  const seq = mr.ast.sequence[0]
130
137
  assert(!(seq instanceof Array), JSON.stringify(mr))
131
138
  assert(!(seq.tag !== '=='), JSON.stringify(mr))
132
139
  },
133
140
  () => {
134
- const m = descentParser(jsGrammar())
141
+ const [m, entry] = jsMatcher()
135
142
  const cp = toArray(stringToCodePointList('==='))
136
- const mr = descentParserCpOnly(m, '', cp)
143
+ const mr = descentParserCpOnly(m, entry, cp)
137
144
  const seq = mr.ast.sequence[0]
138
145
  assert(!(seq instanceof Array), JSON.stringify(mr))
139
146
  assert(!(seq.tag !== '==='), JSON.stringify(mr))
140
147
  },
141
148
  () => {
142
- const m = descentParser(jsGrammar())
149
+ const [m, entry] = jsMatcher()
143
150
  const cp = toArray(stringToCodePointList('='))
144
- const mr = descentParserCpOnly(m, '', cp)
151
+ const mr = descentParserCpOnly(m, entry, cp)
145
152
  const seq = mr.ast.sequence[0]
146
153
  assert(!(seq instanceof Array), JSON.stringify(mr))
147
154
  assertEq(seq.tag, '=', JSON.stringify(mr))
148
155
  },
149
156
  () => {
150
- const m = descentParser(jsGrammar())
157
+ const [m, entry] = jsMatcher()
151
158
  const cp = toArray(stringToCodePointList(' '))
152
- const mr = descentParserCpOnly(m, '', cp)
159
+ const mr = descentParserCpOnly(m, entry, cp)
153
160
  const seq = mr.ast.sequence[0]
154
161
  assert(!(seq instanceof Array), JSON.stringify(mr))
155
162
  assertEq(seq.tag, ' ', JSON.stringify(mr))
156
163
  },
157
164
  () => {
158
- const m = descentParser(jsGrammar())
165
+ const [m, entry] = jsMatcher()
159
166
  const cp = toArray(stringToCodePointList('\n'))
160
- const mr = descentParserCpOnly(m, '', cp)
167
+ const mr = descentParserCpOnly(m, entry, cp)
161
168
  const seq = mr.ast.sequence[0]
162
169
  assert(!(seq instanceof Array), JSON.stringify(mr))
163
170
  assertEq(seq.tag, '\n', JSON.stringify(mr))
164
171
  },
165
172
  () => {
166
- const m = descentParser(jsGrammar())
173
+ const [m, entry] = jsMatcher()
167
174
  const cp = toArray(stringToCodePointList('/\n'))
168
- const mr = descentParserCpOnly(m, '', cp)
175
+ const mr = descentParserCpOnly(m, entry, cp)
169
176
  const seq = mr.ast.sequence[0]
170
177
  assert(!(seq instanceof Array), JSON.stringify(mr))
171
178
  assertEq(seq.tag, '/', JSON.stringify(mr))
172
179
  },
173
180
  () => {
174
- const m = descentParser(jsGrammar())
181
+ const [m, entry] = jsMatcher()
175
182
  const cp = toArray(stringToCodePointList('//\n'))
176
- const mr = descentParserCpOnly(m, '', cp)
183
+ const mr = descentParserCpOnly(m, entry, cp)
177
184
  const seq = mr.ast.sequence[0]
178
185
  assert(!(seq instanceof Array), JSON.stringify(mr))
179
186
  assertEq(seq.tag, 'comment', JSON.stringify(mr))
180
187
  },
181
188
  () => {
182
- const m = descentParser(jsGrammar())
189
+ const [m, entry] = jsMatcher()
183
190
  const cp = toArray(stringToCodePointList('/*1*/'))
184
- const mr = descentParserCpOnly(m, '', cp)
191
+ const mr = descentParserCpOnly(m, entry, cp)
185
192
  const seq = mr.ast.sequence[0]
186
193
  assert(!(seq instanceof Array), JSON.stringify(mr))
187
194
  assertEq(seq.tag, 'comment', JSON.stringify(mr))
@@ -290,11 +297,11 @@ export const proof = {
290
297
  },
291
298
  () => {
292
299
  const result = tokenizeString('0')
293
- if (result !== '[{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
300
+ if (result !== '[{"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
294
301
  },
295
302
  () => {
296
303
  const result = tokenizeString('[0]')
297
- if (result !== '[{"kind":"["},{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"]"},{"kind":"eof"}]') { throw result }
304
+ if (result !== '[{"kind":"["},{"kind":"number","value":"0"},{"kind":"]"},{"kind":"eof"}]') { throw result }
298
305
  },
299
306
  () => {
300
307
  const result = tokenizeString('00')
@@ -306,15 +313,15 @@ export const proof = {
306
313
  },
307
314
  () => {
308
315
  const result = tokenizeString('123456789012345678901234567890')
309
- if (result !== '[{"bf":[123456789012345678901234567890n,0],"kind":"number","value":"123456789012345678901234567890"},{"kind":"eof"}]') { throw result }
316
+ if (result !== '[{"kind":"number","value":"123456789012345678901234567890"},{"kind":"eof"}]') { throw result }
310
317
  },
311
318
  () => {
312
319
  const result = tokenizeString('{90}')
313
- if (result !== '[{"kind":"{"},{"bf":[90n,0],"kind":"number","value":"90"},{"kind":"}"},{"kind":"eof"}]') { throw result }
320
+ if (result !== '[{"kind":"{"},{"kind":"number","value":"90"},{"kind":"}"},{"kind":"eof"}]') { throw result }
314
321
  },
315
322
  () => {
316
323
  const result = tokenizeString('1 2')
317
- if (result !== '[{"bf":[1n,0],"kind":"number","value":"1"},{"kind":"ws"},{"bf":[2n,0],"kind":"number","value":"2"},{"kind":"eof"}]') { throw result }
324
+ if (result !== '[{"kind":"number","value":"1"},{"kind":"ws"},{"kind":"number","value":"2"},{"kind":"eof"}]') { throw result }
318
325
  },
319
326
  () => {
320
327
  const result = tokenizeString('0. 2')
@@ -322,7 +329,7 @@ export const proof = {
322
329
  },
323
330
  () => {
324
331
  const result = tokenizeString('10-0')
325
- if (result !== '[{"bf":[10n,0],"kind":"number","value":"10"},{"kind":"-"},{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
332
+ if (result !== '[{"kind":"number","value":"10"},{"kind":"-"},{"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
326
333
  },
327
334
  () => {
328
335
  const result = tokenizeString('9a:')
@@ -330,11 +337,11 @@ export const proof = {
330
337
  },
331
338
  () => {
332
339
  const result = tokenizeString('-10')
333
- if (result !== '[{"kind":"-"},{"bf":[10n,0],"kind":"number","value":"10"},{"kind":"eof"}]') { throw result }
340
+ if (result !== '[{"kind":"-"},{"kind":"number","value":"10"},{"kind":"eof"}]') { throw result }
334
341
  },
335
342
  () => {
336
343
  const result = tokenizeString('-0')
337
- if (result !== '[{"kind":"-"},{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
344
+ if (result !== '[{"kind":"-"},{"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
338
345
  },
339
346
  () => {
340
347
  const result = tokenizeString('-00')
@@ -342,15 +349,15 @@ export const proof = {
342
349
  },
343
350
  () => {
344
351
  const result = tokenizeString('-.123')
345
- if (result !== '[{"kind":"-"},{"kind":"."},{"bf":[123n,0],"kind":"number","value":"123"},{"kind":"eof"}]') { throw result }
352
+ if (result !== '[{"kind":"-"},{"kind":"."},{"kind":"number","value":"123"},{"kind":"eof"}]') { throw result }
346
353
  },
347
354
  () => {
348
355
  const result = tokenizeString('0.01')
349
- if (result !== '[{"bf":[1n,-2],"kind":"number","value":"0.01"},{"kind":"eof"}]') { throw result }
356
+ if (result !== '[{"kind":"number","value":"0.01"},{"kind":"eof"}]') { throw result }
350
357
  },
351
358
  () => {
352
359
  const result = tokenizeString('-0.9')
353
- if (result !== '[{"kind":"-"},{"bf":[9n,-1],"kind":"number","value":"0.9"},{"kind":"eof"}]') { throw result }
360
+ if (result !== '[{"kind":"-"},{"kind":"number","value":"0.9"},{"kind":"eof"}]') { throw result }
354
361
  },
355
362
  () => {
356
363
  const result = tokenizeString('-0.')
@@ -362,11 +369,11 @@ export const proof = {
362
369
  },
363
370
  () => {
364
371
  const result = tokenizeString('12.34')
365
- if (result !== '[{"bf":[1234n,-2],"kind":"number","value":"12.34"},{"kind":"eof"}]') { throw result }
372
+ if (result !== '[{"kind":"number","value":"12.34"},{"kind":"eof"}]') { throw result }
366
373
  },
367
374
  () => {
368
375
  const result = tokenizeString('-12.00')
369
- if (result !== '[{"kind":"-"},{"bf":[1200n,-2],"kind":"number","value":"12.00"},{"kind":"eof"}]') { throw result }
376
+ if (result !== '[{"kind":"-"},{"kind":"number","value":"12.00"},{"kind":"eof"}]') { throw result }
370
377
  },
371
378
  () => {
372
379
  const result = tokenizeString('-12.')
@@ -378,27 +385,27 @@ export const proof = {
378
385
  },
379
386
  () => {
380
387
  const result = tokenizeString('0e1')
381
- if (result !== '[{"bf":[0n,1],"kind":"number","value":"0e1"},{"kind":"eof"}]') { throw result }
388
+ if (result !== '[{"kind":"number","value":"0e1"},{"kind":"eof"}]') { throw result }
382
389
  },
383
390
  () => {
384
391
  const result = tokenizeString('0e+2')
385
- if (result !== '[{"bf":[0n,2],"kind":"number","value":"0e+2"},{"kind":"eof"}]') { throw result }
392
+ if (result !== '[{"kind":"number","value":"0e+2"},{"kind":"eof"}]') { throw result }
386
393
  },
387
394
  () => {
388
395
  const result = tokenizeString('0e-0')
389
- if (result !== '[{"bf":[0n,0],"kind":"number","value":"0e-0"},{"kind":"eof"}]') { throw result }
396
+ if (result !== '[{"kind":"number","value":"0e-0"},{"kind":"eof"}]') { throw result }
390
397
  },
391
398
  () => {
392
399
  const result = tokenizeString('12e0000')
393
- if (result !== '[{"bf":[12n,0],"kind":"number","value":"12e0000"},{"kind":"eof"}]') { throw result }
400
+ if (result !== '[{"kind":"number","value":"12e0000"},{"kind":"eof"}]') { throw result }
394
401
  },
395
402
  () => {
396
403
  const result = tokenizeString('-12e-0001')
397
- if (result !== '[{"kind":"-"},{"bf":[12n,-1],"kind":"number","value":"12e-0001"},{"kind":"eof"}]') { throw result }
404
+ if (result !== '[{"kind":"-"},{"kind":"number","value":"12e-0001"},{"kind":"eof"}]') { throw result }
398
405
  },
399
406
  () => {
400
407
  const result = tokenizeString('-12.34e1234')
401
- if (result !== '[{"kind":"-"},{"bf":[1234n,1232],"kind":"number","value":"12.34e1234"},{"kind":"eof"}]') { throw result }
408
+ if (result !== '[{"kind":"-"},{"kind":"number","value":"12.34e1234"},{"kind":"eof"}]') { throw result }
402
409
  },
403
410
  () => {
404
411
  const result = tokenizeString('0e')
@@ -418,11 +425,11 @@ export const proof = {
418
425
  },
419
426
  () => {
420
427
  const result = tokenizeString('123 _123')
421
- if (result !== '[{"bf":[123n,0],"kind":"number","value":"123"},{"kind":"ws"},{"kind":"id","value":"_123"},{"kind":"eof"}]') { throw result }
428
+ if (result !== '[{"kind":"number","value":"123"},{"kind":"ws"},{"kind":"id","value":"_123"},{"kind":"eof"}]') { throw result }
422
429
  },
423
430
  () => {
424
431
  const result = tokenizeString('123 $123')
425
- if (result !== '[{"bf":[123n,0],"kind":"number","value":"123"},{"kind":"ws"},{"kind":"id","value":"$123"},{"kind":"eof"}]') { throw result }
432
+ if (result !== '[{"kind":"number","value":"123"},{"kind":"ws"},{"kind":"id","value":"$123"},{"kind":"eof"}]') { throw result }
426
433
  },
427
434
  () => {
428
435
  const result = tokenizeString('123_123')
@@ -477,7 +484,7 @@ export const proof = {
477
484
  },
478
485
  () => {
479
486
  const result = tokenizeString('1*2')
480
- if (result !== '[{"bf":[1n,0],"kind":"number","value":"1"},{"kind":"*"},{"bf":[2n,0],"kind":"number","value":"2"},{"kind":"eof"}]') { throw result }
487
+ if (result !== '[{"kind":"number","value":"1"},{"kind":"*"},{"kind":"number","value":"2"},{"kind":"eof"}]') { throw result }
481
488
  },
482
489
  () => {
483
490
  const result = tokenizeString('( )')
@@ -886,19 +893,19 @@ export const proof = {
886
893
  () => {
887
894
  // keywords other than true/false/null/undefined become plain ids
888
895
  const result = toArray(tokenize(stringToList('break'))(''))
889
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"id","value":"break"}},{"metadata":{"column":6,"line":1,"path":""},"token":{"kind":"eof"}}]')
896
+ assertEq(stringify(result), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"id","value":"break"}},{"metadata":{"column":6,"line":1,"path":""},"token":{"kind":"eof"}}]')
890
897
  },
891
898
  () => {
892
899
  const result = toArray(tokenize(stringToList('-10'))(''))
893
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"bf":[-10n,0],"kind":"number","value":"-10"}},{"metadata":{"column":4,"line":1,"path":""},"token":{"kind":"eof"}}]')
900
+ assertEq(stringify(result), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"number","value":"-10"}},{"metadata":{"column":4,"line":1,"path":""},"token":{"kind":"eof"}}]')
894
901
  },
895
902
  () => {
896
903
  const result = toArray(tokenize(stringToList('-0'))(''))
897
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"bf":[0n,0],"kind":"number","value":"-0"}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"eof"}}]')
904
+ assertEq(stringify(result), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"number","value":"-0"}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"eof"}}]')
898
905
  },
899
906
  () => {
900
907
  const result = toArray(tokenize(stringToList('-1234567890n'))(''))
901
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"bigint","value":-1234567890n}},{"metadata":{"column":13,"line":1,"path":""},"token":{"kind":"eof"}}]')
908
+ assertEq(stringify(result), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"bigint","value":-1234567890n}},{"metadata":{"column":13,"line":1,"path":""},"token":{"kind":"eof"}}]')
902
909
  },
903
910
  () => {
904
911
  // `js/tokenizer` merges '--' into one decrement-operator token, so
@@ -906,31 +913,31 @@ export const proof = {
906
913
  // it's one error straight from the default state's unknown-token
907
914
  // fallback, mapping the whole '--' token to a single error.
908
915
  const result = toArray(tokenize(stringToList('--'))(''))
909
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"eof"}}]')
916
+ assertEq(stringify(result), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"eof"}}]')
910
917
  },
911
918
  () => {
912
919
  const result = toArray(tokenize(stringToList('---'))(''))
913
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":4,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":4,"line":1,"path":""},"token":{"kind":"eof"}}]')
920
+ assertEq(stringify(result), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":4,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":4,"line":1,"path":""},"token":{"kind":"eof"}}]')
914
921
  },
915
922
  () => {
916
923
  // dangling '-' at eof
917
924
  const result = toArray(tokenize(stringToList('-'))(''))
918
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"eof"}}]')
925
+ assertEq(stringify(result), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"eof"}}]')
919
926
  },
920
927
  () => {
921
928
  // '-' followed by neither a number/bigint nor eof: one error for
922
929
  // the dangling '-', then the following token maps through normally.
923
930
  const result = toArray(tokenize(stringToList('-{'))(''))
924
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"{"}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"eof"}}]')
931
+ assertEq(stringify(result), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}},{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"{"}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"eof"}}]')
925
932
  },
926
933
  () => {
927
934
  const result = toArray(tokenize(stringToList('[-1234567890n]'))(''))
928
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"["}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"bigint","value":-1234567890n}},{"metadata":{"column":14,"line":1,"path":""},"token":{"kind":"]"}},{"metadata":{"column":15,"line":1,"path":""},"token":{"kind":"eof"}}]')
935
+ assertEq(stringify(result), '[{"metadata":{"column":1,"line":1,"path":""},"token":{"kind":"["}},{"metadata":{"column":3,"line":1,"path":""},"token":{"kind":"bigint","value":-1234567890n}},{"metadata":{"column":14,"line":1,"path":""},"token":{"kind":"]"}},{"metadata":{"column":15,"line":1,"path":""},"token":{"kind":"eof"}}]')
929
936
  },
930
937
  () => {
931
938
  // grammar-level tokenizer error position flows through the DJS wrapper unchanged
932
939
  const result = toArray(tokenize(stringToList('00'))(''))
933
- assertEq(stringify(/** @type {Unknown} */ (result)), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}}]')
940
+ assertEq(stringify(result), '[{"metadata":{"column":2,"line":1,"path":""},"token":{"kind":"error","message":"invalid token"}}]')
934
941
  },
935
942
  ],
936
943
  // Regression coverage for large inputs: both a file with many short tokens and a
@@ -7,25 +7,30 @@
7
7
  * @import { Result } from '../../types/result/types.ts'
8
8
  * @import { ParseError } from '../parser/types.ts'
9
9
  * @import { AstModule } from '../ast/types.ts'
10
+ * @import { Operation } from '../../effects/types.ts'
11
+ * @import { IoChannel } from '../../effects/node/types.ts'
10
12
  * @import { Effect } from '../../effects/types.ts'
11
13
  * @import { ReadFile } from '../../effects/node/types.ts'
12
14
  * @import { ParseContext } from './types.ts'
13
15
  */
14
16
  import type { Unknown } from '../types.ts';
15
- import type { Result } from '../../types/result/types.ts';
16
17
  import type { ParseError } from '../parser/types.ts';
17
18
  import type { Effect } from '../../effects/types.ts';
18
19
  import type { ReadFile } from '../../effects/node/types.ts';
19
20
  /**
20
- * Transpiles a DJS module graph rooted at `path` into a single `Unknown` value.
21
+ * Transpiles the file at `path` into a single `Unknown` value.
21
22
  *
22
- * Reads each file via the `ReadFile` effect, resolves imports recursively, and
23
- * evaluates the AST. Returns `['ok', value]` on success, or `['error', ParseError]`
24
- * on a parse failure or circular dependency.
23
+ * The extension names its language: a `.json` file is a JSON document, read by
24
+ * `fjs/media/json`, and anything else is a FunctionalScript module, whose
25
+ * imports are resolved recursively — each of them a module too, whatever it is
26
+ * called ([spec: the `__proto__` key](../../../spec/README.md#the-__proto__-key)).
25
27
  *
26
- * @type {(path: string) => Effect<ReadFile, Result<Unknown, ParseError>>}
28
+ * Returns `['ok', value]` on success, or `['error', ParseError]` on a parse
29
+ * failure, a missing file, or a circular dependency.
30
+ *
31
+ * @type {(path: string) => Effect<ReadFile, Unknown, ParseError>}
27
32
  */
28
- export declare const transpile: (path: string) => Effect<ReadFile, Result<Unknown, ParseError>>;
33
+ export declare const transpile: (path: string) => Effect<ReadFile, Unknown, ParseError>;
29
34
  export declare const proof: {
30
35
  throw: {
31
36
  mapDjsUnresolvedImport: () => Unknown;