eliscript 0.0.1 → 0.0.3

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 (417) hide show
  1. package/README.md +61 -0
  2. package/bootstrap/README.md +26 -0
  3. package/bootstrap/backends/README.md +515 -0
  4. package/bootstrap/backends/async.eli +230 -0
  5. package/bootstrap/backends/binary.eli +173 -0
  6. package/bootstrap/backends/capabilities.eli +74 -0
  7. package/bootstrap/backends/elf.eli +246 -0
  8. package/bootstrap/backends/managed.eli +5976 -0
  9. package/bootstrap/backends/memory.eli +100 -0
  10. package/bootstrap/backends/native.eli +2000 -0
  11. package/bootstrap/backends/numeric.eli +1362 -0
  12. package/bootstrap/backends/optimize.eli +79 -0
  13. package/bootstrap/backends/regexp.eli +2263 -0
  14. package/bootstrap/backends/sha256.eli +138 -0
  15. package/bootstrap/backends/wasm.eli +1161 -0
  16. package/bootstrap/compiler/analyzer.eli +165 -77
  17. package/bootstrap/compiler/compiler.eli +43 -19
  18. package/bootstrap/compiler/emitter.eli +780 -170
  19. package/bootstrap/compiler/expander.eli +136 -45
  20. package/bootstrap/compiler/formatter.eli +8 -1
  21. package/bootstrap/compiler/ir.eli +148 -45
  22. package/bootstrap/compiler/lower.eli +29 -2
  23. package/bootstrap/compiler/project.eli +51 -21
  24. package/bootstrap/compiler/reader.eli +128 -36
  25. package/bootstrap/compiler/source-map.eli +46 -4
  26. package/bootstrap/compiler/symbol.eli +2 -1
  27. package/bootstrap/compiler/syntax.eli +47 -12
  28. package/bootstrap/compiler/transient-analysis.eli +40 -4
  29. package/bootstrap/host/check-cli-legacy.mjs +163 -0
  30. package/bootstrap/host/check-cli.mjs +59 -158
  31. package/bootstrap/host/check-cli.mjs.map +1 -0
  32. package/bootstrap/host/compiler-session.eli +1579 -0
  33. package/bootstrap/host/compiler-tools.eli +513 -0
  34. package/bootstrap/host/eliscript-cli.mjs +53 -33
  35. package/bootstrap/host/eliscript-cli.mjs.map +1 -0
  36. package/bootstrap/host/project-cli-legacy.mjs +295 -0
  37. package/bootstrap/host/project-cli.mjs +74 -289
  38. package/bootstrap/host/project-cli.mjs.map +1 -0
  39. package/bootstrap/host/project-legacy.mjs +1080 -0
  40. package/bootstrap/host/project.mjs +210 -1060
  41. package/bootstrap/host/project.mjs.map +1 -0
  42. package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
  43. package/bootstrap/runtime/memory.eli +30379 -0
  44. package/browser/host.mjs +732 -11
  45. package/browser/worker.mjs +6 -3
  46. package/compiler/eliscript-analyzer.el +371 -4
  47. package/compiler/eliscript-cli.el +84 -1
  48. package/compiler/eliscript-emitter.el +1189 -256
  49. package/compiler/eliscript-expander.el +147 -10
  50. package/compiler/eliscript-ir-emitter.el +725 -208
  51. package/compiler/eliscript-lower.el +127 -1
  52. package/compiler/eliscript-portable.el +177 -51
  53. package/compiler/eliscript-project.el +20 -2
  54. package/compiler/eliscript-reader.el +141 -57
  55. package/compiler/eliscript-source-map.el +26 -12
  56. package/compiler/eliscript-transient-analysis.el +382 -19
  57. package/dist/backends/async.mjs +561 -0
  58. package/dist/backends/async.mjs.macro-origins.json +1 -0
  59. package/dist/backends/async.mjs.map +1 -0
  60. package/dist/backends/binary.mjs +381 -0
  61. package/dist/backends/binary.mjs.macro-origins.json +1 -0
  62. package/dist/backends/binary.mjs.map +1 -0
  63. package/dist/backends/capabilities.mjs +237 -0
  64. package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
  65. package/dist/backends/capabilities.mjs.map +1 -0
  66. package/dist/backends/elf.mjs +540 -0
  67. package/dist/backends/elf.mjs.macro-origins.json +1 -0
  68. package/dist/backends/elf.mjs.map +1 -0
  69. package/dist/backends/managed.mjs +10616 -0
  70. package/dist/backends/managed.mjs.macro-origins.json +1 -0
  71. package/dist/backends/managed.mjs.map +1 -0
  72. package/dist/backends/memory.mjs +278 -0
  73. package/dist/backends/memory.mjs.macro-origins.json +1 -0
  74. package/dist/backends/memory.mjs.map +1 -0
  75. package/dist/backends/native.mjs +4099 -0
  76. package/dist/backends/native.mjs.macro-origins.json +1 -0
  77. package/dist/backends/native.mjs.map +1 -0
  78. package/dist/backends/numeric.mjs +2458 -0
  79. package/dist/backends/numeric.mjs.macro-origins.json +1 -0
  80. package/dist/backends/numeric.mjs.map +1 -0
  81. package/dist/backends/optimize.mjs +204 -0
  82. package/dist/backends/optimize.mjs.macro-origins.json +1 -0
  83. package/dist/backends/optimize.mjs.map +1 -0
  84. package/dist/backends/regexp.mjs +2033 -0
  85. package/dist/backends/regexp.mjs.macro-origins.json +1 -0
  86. package/dist/backends/regexp.mjs.map +1 -0
  87. package/dist/backends/sha256.mjs +310 -0
  88. package/dist/backends/sha256.mjs.macro-origins.json +1 -0
  89. package/dist/backends/sha256.mjs.map +1 -0
  90. package/dist/backends/wasm.mjs +2258 -0
  91. package/dist/backends/wasm.mjs.macro-origins.json +1 -0
  92. package/dist/backends/wasm.mjs.map +1 -0
  93. package/dist/bootstrap/analyzer.mjs +1908 -776
  94. package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
  95. package/dist/bootstrap/analyzer.mjs.map +1 -1
  96. package/dist/bootstrap/compiler.mjs +450 -142
  97. package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
  98. package/dist/bootstrap/compiler.mjs.map +1 -1
  99. package/dist/bootstrap/emitter.mjs +3083 -909
  100. package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
  101. package/dist/bootstrap/emitter.mjs.map +1 -1
  102. package/dist/bootstrap/expander.mjs +2887 -1233
  103. package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
  104. package/dist/bootstrap/expander.mjs.map +1 -1
  105. package/dist/bootstrap/formatter.mjs +582 -218
  106. package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
  107. package/dist/bootstrap/formatter.mjs.map +1 -1
  108. package/dist/bootstrap/ir.mjs +670 -116
  109. package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
  110. package/dist/bootstrap/ir.mjs.map +1 -1
  111. package/dist/bootstrap/lower.mjs +866 -257
  112. package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
  113. package/dist/bootstrap/lower.mjs.map +1 -1
  114. package/dist/bootstrap/package.json +1 -0
  115. package/dist/bootstrap/project.mjs +1168 -498
  116. package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
  117. package/dist/bootstrap/project.mjs.map +1 -1
  118. package/dist/bootstrap/reader.mjs +674 -175
  119. package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
  120. package/dist/bootstrap/reader.mjs.map +1 -1
  121. package/dist/bootstrap/runtime/math.mjs +1117 -0
  122. package/dist/bootstrap/runtime/math.mjs.map +1 -0
  123. package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
  124. package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
  125. package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
  126. package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
  127. package/dist/bootstrap/source-map.mjs +430 -119
  128. package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
  129. package/dist/bootstrap/source-map.mjs.map +1 -1
  130. package/dist/bootstrap/symbol.mjs +229 -53
  131. package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
  132. package/dist/bootstrap/symbol.mjs.map +1 -1
  133. package/dist/bootstrap/syntax.mjs +205 -7
  134. package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
  135. package/dist/bootstrap/syntax.mjs.map +1 -1
  136. package/dist/bootstrap/transient-analysis.mjs +1185 -489
  137. package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
  138. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  139. package/dist/browser/compiler.js +199 -6478
  140. package/dist/browser/host.mjs +1078 -0
  141. package/dist/browser/loader.js +1 -0
  142. package/dist/browser/loader.mjs +231 -0
  143. package/dist/browser/worker.mjs +63 -0
  144. package/dist/compiler-artifact.json +1 -0
  145. package/dist/host/compiler-session.mjs +2980 -0
  146. package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
  147. package/dist/host/compiler-session.mjs.map +1 -0
  148. package/dist/host/compiler-tools.mjs +1084 -0
  149. package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
  150. package/dist/host/compiler-tools.mjs.map +1 -0
  151. package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
  152. package/dist/literal-sources/runtime/core/collection.eli +639 -0
  153. package/dist/literal-sources/runtime/core/data-text.eli +290 -0
  154. package/dist/literal-sources/runtime/core/data.eli +22 -0
  155. package/dist/literal-sources/runtime/core/identifier.eli +44 -0
  156. package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
  157. package/dist/literal-sources/runtime/core/list.eli +19 -0
  158. package/dist/literal-sources/runtime/core/map.eli +9 -0
  159. package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
  160. package/dist/literal-sources/runtime/core/metadata.eli +40 -0
  161. package/dist/literal-sources/runtime/core/object.eli +8 -0
  162. package/dist/literal-sources/runtime/core/order.eli +123 -0
  163. package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
  164. package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
  165. package/dist/literal-sources/runtime/core/protocol.eli +28 -0
  166. package/dist/literal-sources/runtime/core/queue.eli +9 -0
  167. package/dist/literal-sources/runtime/core/record.eli +191 -0
  168. package/dist/literal-sources/runtime/core/regex.eli +158 -0
  169. package/dist/literal-sources/runtime/core/sequence.eli +305 -0
  170. package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
  171. package/dist/literal-sources/runtime/core/set.eli +9 -0
  172. package/dist/literal-sources/runtime/core/sorted.eli +408 -0
  173. package/dist/literal-sources/runtime/core/text.eli +14 -0
  174. package/dist/literal-sources/runtime/core/transducer.eli +268 -0
  175. package/dist/literal-sources/runtime/core/transient.eli +17 -0
  176. package/dist/literal-sources/runtime/core/truth.eli +4 -0
  177. package/dist/literal-sources/runtime/core/type.eli +232 -0
  178. package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
  179. package/dist/literal-sources/runtime/core/value.eli +19 -0
  180. package/dist/literal-sources/runtime/core/vector.eli +25 -0
  181. package/dist/literal-sources/runtime/literals.eli +23 -0
  182. package/dist/literal-sources/runtime/testing/value.eli +6 -0
  183. package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
  184. package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
  185. package/dist/literal-sources/runtime/wire/schema.eli +193 -0
  186. package/dist/literal-sources/stdlib/bit.eli +36 -0
  187. package/dist/literal-sources/stdlib/core/data.eli +306 -0
  188. package/dist/literal-sources/stdlib/core/object.eli +89 -0
  189. package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
  190. package/dist/literal-sources/stdlib/core/set.eli +312 -0
  191. package/dist/literal-sources/stdlib/core/text.eli +103 -0
  192. package/dist/literal-sources/stdlib/managed-literal-protocols.eli +494 -0
  193. package/dist/literal-sources/stdlib/managed-literals.eli +1469 -0
  194. package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
  195. package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
  196. package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
  197. package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
  198. package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
  199. package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
  200. package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
  201. package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
  202. package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
  203. package/dist/literal-sources/stdlib/value.eli +325 -0
  204. package/dist/package.json +10 -0
  205. package/dist/runtime/math.mjs +1116 -0
  206. package/dist/runtime/math.mjs.macro-origins.json +1 -0
  207. package/dist/runtime/math.mjs.map +1 -0
  208. package/dist/runtime/unicode-case-data.mjs +10124 -0
  209. package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
  210. package/dist/runtime/unicode-case-data.mjs.map +1 -0
  211. package/dist/runtime/unicode-case.mjs +280 -0
  212. package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
  213. package/dist/runtime/unicode-case.mjs.map +1 -0
  214. package/dist/runtime.eli +30379 -0
  215. package/dist/stage3-release.json +1 -0
  216. package/editor/README.md +1 -1
  217. package/editor/eliscript-mode.el +1 -1
  218. package/editor/eliscript-repl.el +1 -1
  219. package/package.json +106 -11
  220. package/platform/http.mjs +20 -0
  221. package/runtime/array-text.mjs +159 -0
  222. package/runtime/core/map-internals.mjs +27 -9
  223. package/runtime/core/object-impl.mjs +26 -17
  224. package/runtime/core/object-impl.mjs.map +1 -1
  225. package/runtime/core/protocol-impl.mjs +682 -255
  226. package/runtime/core/protocol-impl.mjs.map +1 -1
  227. package/runtime/core/protocol.mjs +4 -0
  228. package/runtime/core/record.mjs +23 -2
  229. package/runtime/core/regex.mjs +4 -0
  230. package/runtime/core/sorted.mjs +53 -0
  231. package/runtime/core/text-impl.mjs +167 -48
  232. package/runtime/core/text-impl.mjs.map +1 -1
  233. package/runtime/core/type.mjs +75 -3
  234. package/runtime/core/vector.mjs +6 -0
  235. package/runtime/math.eli +429 -0
  236. package/runtime/math.mjs +1116 -0
  237. package/runtime/math.mjs.map +1 -0
  238. package/runtime/number-radix.mjs +105 -0
  239. package/runtime/unicode-case-data.eli +29 -0
  240. package/runtime/unicode-case-data.mjs +10124 -0
  241. package/runtime/unicode-case-data.mjs.map +1 -0
  242. package/runtime/unicode-case.eli +100 -0
  243. package/runtime/unicode-case.mjs +280 -0
  244. package/runtime/unicode-case.mjs.map +1 -0
  245. package/runtime/wire/http-rpc.mjs +168 -0
  246. package/runtime/wire/markdown.mjs +196 -0
  247. package/runtime/wire/schema.mjs +109 -0
  248. package/stdlib/README.md +54 -0
  249. package/stdlib/core/protocol.eli +81 -17
  250. package/stdlib/core/seq.eli +1 -1
  251. package/stdlib/core/zipper.eli +172 -72
  252. package/stdlib/gepo.eli +12 -0
  253. package/stdlib/interop/js.eli +56 -15
  254. package/stdlib/managed-literal-protocols.eli +494 -0
  255. package/stdlib/managed-literals.eli +1469 -0
  256. package/stdlib/managed-protocol-error.eli +32 -0
  257. package/stdlib/managed-queue-state.eli +65 -0
  258. package/stdlib/managed-runtime-collection-internals.eli +60 -0
  259. package/stdlib/managed-runtime-collection.eli +639 -0
  260. package/stdlib/managed-runtime-data-text.eli +290 -0
  261. package/stdlib/managed-runtime-data.eli +22 -0
  262. package/stdlib/managed-runtime-identifier.eli +44 -0
  263. package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
  264. package/stdlib/managed-runtime-list.eli +19 -0
  265. package/stdlib/managed-runtime-literals.eli +23 -0
  266. package/stdlib/managed-runtime-map.eli +9 -0
  267. package/stdlib/managed-runtime-metadata-internals.eli +6 -0
  268. package/stdlib/managed-runtime-metadata.eli +40 -0
  269. package/stdlib/managed-runtime-object.eli +8 -0
  270. package/stdlib/managed-runtime-order.eli +123 -0
  271. package/stdlib/managed-runtime-persistent-kind.eli +28 -0
  272. package/stdlib/managed-runtime-protocol.eli +28 -0
  273. package/stdlib/managed-runtime-queue.eli +9 -0
  274. package/stdlib/managed-runtime-record.eli +191 -0
  275. package/stdlib/managed-runtime-regex.eli +158 -0
  276. package/stdlib/managed-runtime-sequence.eli +305 -0
  277. package/stdlib/managed-runtime-set-algebra.eli +28 -0
  278. package/stdlib/managed-runtime-set.eli +9 -0
  279. package/stdlib/managed-runtime-sorted.eli +408 -0
  280. package/stdlib/managed-runtime-text.eli +14 -0
  281. package/stdlib/managed-runtime-transducer.eli +268 -0
  282. package/stdlib/managed-runtime-transient.eli +17 -0
  283. package/stdlib/managed-runtime-truth.eli +4 -0
  284. package/stdlib/managed-runtime-type.eli +232 -0
  285. package/stdlib/managed-runtime-value-internals.eli +13 -0
  286. package/stdlib/managed-runtime-value.eli +19 -0
  287. package/stdlib/managed-runtime-vector.eli +25 -0
  288. package/stdlib/managed-sorted-state.eli +233 -0
  289. package/stdlib/managed-testing-value.eli +6 -0
  290. package/stdlib/managed-transient-state.eli +348 -0
  291. package/stdlib/managed-value-state.eli +153 -0
  292. package/stdlib/managed-vector-view-state.eli +102 -0
  293. package/stdlib/managed-wire-http-rpc.eli +362 -0
  294. package/stdlib/managed-wire-markdown.eli +275 -0
  295. package/stdlib/managed-wire-schema.eli +193 -0
  296. package/stdlib/mdp.eli +7 -0
  297. package/stdlib/mds.eli +4 -0
  298. package/stdlib/persistent-vector.eli +23 -6
  299. package/tools/acceptance/check-legacy.mjs +687 -0
  300. package/tools/acceptance/check.eli +431 -0
  301. package/tools/acceptance/compile-evidence.el +49 -0
  302. package/tools/acceptance/finalize-legacy.mjs +498 -0
  303. package/tools/acceptance/finalize.eli +270 -0
  304. package/tools/backends/benchmark.mjs +175 -0
  305. package/tools/backends/build.mjs +135 -0
  306. package/tools/backends/compile.mjs +94 -0
  307. package/tools/backends/compiler-bootstrap.mjs +1001 -0
  308. package/tools/backends/compiler-browser.mjs +361 -0
  309. package/tools/backends/compiler-build.mjs +1628 -0
  310. package/tools/backends/compiler-cli-legacy.mjs +334 -0
  311. package/tools/backends/compiler-cli.mjs +29 -0
  312. package/tools/backends/compiler-corpus-bit.mjs +234 -0
  313. package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
  314. package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
  315. package/tools/backends/compiler-corpus-debugging.mjs +221 -0
  316. package/tools/backends/compiler-corpus-emitter.mjs +324 -0
  317. package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
  318. package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
  319. package/tools/backends/compiler-corpus-execution.mjs +3324 -0
  320. package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
  321. package/tools/backends/compiler-corpus-generations.mjs +208 -0
  322. package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
  323. package/tools/backends/compiler-corpus-host-context.mjs +550 -0
  324. package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
  325. package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
  326. package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
  327. package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
  328. package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
  329. package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
  330. package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
  331. package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
  332. package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
  333. package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
  334. package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
  335. package/tools/backends/compiler-corpus-matchers.mjs +173 -0
  336. package/tools/backends/compiler-corpus-original-program.mjs +612 -0
  337. package/tools/backends/compiler-corpus-process.mjs +765 -0
  338. package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
  339. package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
  340. package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
  341. package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
  342. package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
  343. package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
  344. package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
  345. package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
  346. package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
  347. package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
  348. package/tools/backends/compiler-corpus-reference.mjs +241 -0
  349. package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
  350. package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
  351. package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
  352. package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
  353. package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
  354. package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
  355. package/tools/backends/compiler-corpus.mjs +2054 -0
  356. package/tools/backends/compiler-debug.mjs +142 -0
  357. package/tools/backends/compiler-matrix.mjs +1955 -0
  358. package/tools/backends/compiler-metadata.mjs +203 -0
  359. package/tools/backends/compiler-package-browser.mjs +120 -0
  360. package/tools/backends/compiler-package-legacy.mjs +654 -0
  361. package/tools/backends/compiler-package.mjs +464 -0
  362. package/tools/backends/compiler-project.mjs +126 -0
  363. package/tools/backends/compiler-session.mjs +843 -0
  364. package/tools/backends/compiler-sha256.mjs +152 -0
  365. package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
  366. package/tools/backends/compiler-worker.mjs +573 -0
  367. package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
  368. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
  369. package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
  370. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
  371. package/tools/backends/dist/record-grid.mjs +1256 -0
  372. package/tools/backends/dist/record-grid.mjs.map +1 -0
  373. package/tools/backends/dist/release-cli.mjs +462 -0
  374. package/tools/backends/dist/release-cli.mjs.map +1 -0
  375. package/tools/backends/dist/run-artifact.mjs +517 -0
  376. package/tools/backends/dist/run-artifact.mjs.map +1 -0
  377. package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
  378. package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
  379. package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
  380. package/tools/backends/managed-foreign-binding.mjs +497 -0
  381. package/tools/backends/managed-host-legacy.mjs +1181 -0
  382. package/tools/backends/managed-host-lifecycle.mjs +310 -0
  383. package/tools/backends/managed-host-object-provider.mjs +155 -0
  384. package/tools/backends/managed-host-object-realm.mjs +797 -0
  385. package/tools/backends/managed-host-proxy.mjs +71 -0
  386. package/tools/backends/managed-host-runtime.mjs +5868 -0
  387. package/tools/backends/managed-host.mjs +716 -0
  388. package/tools/backends/managed-module-graph-legacy.mjs +308 -0
  389. package/tools/backends/managed-module-graph.mjs +694 -0
  390. package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
  391. package/tools/backends/managed-runtime.mjs +939 -0
  392. package/tools/backends/managed-source-view-legacy.mjs +332 -0
  393. package/tools/backends/managed-source-view.mjs +959 -0
  394. package/tools/backends/memory-runtime.mjs +100 -0
  395. package/tools/backends/native-benchmark.mjs +88 -0
  396. package/tools/backends/native-managed-runtime.mjs +677 -0
  397. package/tools/backends/native-memory.mjs +768 -0
  398. package/tools/backends/native-node-memory.mjs +142 -0
  399. package/tools/backends/native-node-runner.mjs +99 -0
  400. package/tools/backends/native-node-watchdog.mjs +19 -0
  401. package/tools/backends/native-node-worker.mjs +75 -0
  402. package/tools/backends/stage3-targets.mjs +493 -0
  403. package/tools/bootstrap-command.el +13 -0
  404. package/tools/bootstrap-runtime.el +101 -0
  405. package/tools/bootstrap-seed.el +55 -0
  406. package/tools/project/check-cli.eli +31 -0
  407. package/tools/project/project-cli.eli +42 -0
  408. package/tools/project/project.eli +122 -0
  409. package/tools/runtime/unicode-case-profiles.mjs +13 -0
  410. package/tools/runtime/unicode-case-runtime.el +57 -0
  411. package/tools/testing/source-debugging-corpus-host.eli +16 -0
  412. package/tools/testing/source-debugging.eli +139 -0
  413. package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
  414. package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
  415. package/tools/testing/stdlib-bit.eli +104 -0
  416. package/tools/testing/stdlib-bit.mjs +255 -0
  417. package/bin/eliscript-bootstrap +0 -15
@@ -0,0 +1,362 @@
1
+ import {createHash} from 'node:crypto';
2
+ import {resolve} from 'node:path';
3
+ import {pathToFileURL} from 'node:url';
4
+ import {loadCompilerSources} from './compiler-build.mjs';
5
+ import {compilerSourceIdentity} from './compiler-bootstrap.mjs';
6
+ import {originalSourceCaseLocators} from './compiler-corpus-managed-cases.mjs';
7
+
8
+ const sha256 = source => createHash('sha256').update(source).digest('hex');
9
+
10
+ function replaceOriginal(source, before, after, changes) {
11
+ const start = source.indexOf(before);
12
+ if (start < 0 || source.indexOf(before, start + before.length) >= 0) {
13
+ throw new TypeError('original compiler CLI setup boundary changed');
14
+ }
15
+ changes.push({role: 'selected-compiler-transport', beforeSha256: sha256(before), afterSha256: sha256(after)});
16
+ return source.slice(0, start) + after + source.slice(start + before.length);
17
+ }
18
+
19
+ function region(source, before, after) {
20
+ const start = source.indexOf(before), end = start < 0 ? -1 : source.indexOf(after, start + before.length);
21
+ if (start < 0 || end < 0) throw new TypeError('original CLI helper boundary changed');
22
+ return source.slice(start, end);
23
+ }
24
+
25
+ const forwardingTransport = `
26
+ async function __eliscript_install_compiler(source, destination) {
27
+ await __cli_fs.mkdir(destination, {recursive: true});
28
+ for (const name of moduleNames) {
29
+ const path = resolve(source, name + '.mjs');
30
+ await __cli_fs.readFile(path);
31
+ await __cli_fs.writeFile(resolve(destination, name + '.mjs'),
32
+ 'export * from ' + JSON.stringify(__cli_url.pathToFileURL(path).href) + ';\\n');
33
+ await __cli_fs.writeFile(resolve(destination, name + '.mjs.map'),
34
+ await __cli_fs.readFile(path + '.map'));
35
+ }
36
+ }
37
+ `;
38
+
39
+ function generationsTransport(sourceRoot) {
40
+ return `
41
+ import * as __cli_fs from 'node:fs/promises';
42
+ import * as __cli_url from 'node:url';
43
+ const __cli_manifest_path = process.env.ELISCRIPT_ORIGINAL_COMPILER_GENERATIONS;
44
+ if (!__cli_manifest_path) throw new Error('original three-generation CLI requires selected compiler generation artifacts');
45
+ const __cli_manifest = JSON.parse(await __cli_fs.readFile(__cli_manifest_path, 'utf8'));
46
+ if (__cli_manifest.format !== 'eliscript-original-compiler-generations' || __cli_manifest.version !== 1 ||
47
+ !['javascript', 'wasm', 'native'].includes(__cli_manifest.target) ||
48
+ __cli_manifest.target !== process.env.ELISCRIPT_ORIGINAL_TARGET ||
49
+ !Array.isArray(__cli_manifest.generations) || __cli_manifest.generations.length !== 3) {
50
+ throw new TypeError('original CLI requires three actual generations for the selected target');
51
+ }
52
+ const __cli_directories = new Map();
53
+ const __cli_contexts = [];
54
+ try {for (let index = 0; index < 3; index++) {
55
+ const generation = __cli_manifest.generations[index];
56
+ if (generation.generation !== index + 1 || typeof generation.compilerDirectory !== 'string' ||
57
+ typeof generation.javascriptDirectory !== 'string' ||
58
+ !['javascript', 'wasm', 'native'].includes(generation.producerHost) ||
59
+ (index > 0 && generation.producerHost !== __cli_manifest.target)) {
60
+ throw new TypeError('original CLI generation provenance is incomplete');
61
+ }
62
+ if (__cli_manifest.target !== 'javascript') {
63
+ if (typeof generation.context !== 'string') throw new TypeError('binary compiler generation requires its actual runtime context');
64
+ const {openOriginalProgramContext} = await import(${JSON.stringify(pathToFileURL(resolve(sourceRoot, 'tools/backends/compiler-corpus-host-context.mjs')).href)});
65
+ const input = JSON.parse(await __cli_fs.readFile(generation.context, 'utf8'));
66
+ if (input.target !== __cli_manifest.target) throw new Error('compiler generation changed its execution target');
67
+ __cli_contexts.push(await openOriginalProgramContext(input, {identity: generation.context}));
68
+ }
69
+ }} catch (error) {
70
+ for (const context of __cli_contexts.reverse()) {
71
+ try {await context.close();} catch { /* Preserve the construction error. */ }
72
+ }
73
+ throw error;
74
+ }
75
+ ${forwardingTransport}
76
+ async function __cli_place_generation(index, destination) {
77
+ const generation = __cli_manifest.generations[index];
78
+ if (!generation) throw new Error('original CLI requested an unavailable compiler generation');
79
+ await __eliscript_install_compiler(generation.compilerDirectory, destination);
80
+ __cli_directories.set(resolve(destination), generation);
81
+ }
82
+ async function __cli_prepare_command(command, options) {
83
+ if (command[0] === buildPath) {
84
+ if (command.length !== 1 || !options?.env?.ELISCRIPT_BOOTSTRAP_OUT_DIR) {
85
+ throw new TypeError('original bootstrap setup command changed');
86
+ }
87
+ await __cli_place_generation(0, options.env.ELISCRIPT_BOOTSTRAP_OUT_DIR);
88
+ return {exitCode: 0, stdout: '', stderr: ''};
89
+ }
90
+ if (command[0] === publicCliPath || command[0] === portableCliPath) {
91
+ const directory = options?.env?.ELISCRIPT_BOOTSTRAP_MODULE_DIR;
92
+ if (typeof directory !== 'string') throw new TypeError('original public compiler command lost its module directory');
93
+ if (!__cli_directories.has(resolve(directory))) {
94
+ // Automatic setup is supplied by the selected compiler construction,
95
+ // rather than invoking the shell script's independent Emacs bootstrap.
96
+ await __cli_place_generation(0, directory);
97
+ }
98
+ const generation = __cli_directories.get(resolve(directory));
99
+ if (generation.context) options.env.ELISCRIPT_ORIGINAL_PROGRAM_CONTEXT = generation.context;
100
+ }
101
+ return null;
102
+ }
103
+ `;
104
+ }
105
+
106
+ const runOriginalCases = `
107
+ let __cli_failure;
108
+ try {
109
+ for (const {name, body, timeout} of __cli_cases) {
110
+ let timer;
111
+ try {
112
+ await Promise.race([Promise.resolve().then(body), new Promise((_, reject) => {
113
+ timer = setTimeout(() => reject(new Error(name + ' exceeded its original ' + timeout + ' ms timeout')), timeout);
114
+ })]);
115
+ } finally {clearTimeout(timer);}
116
+ }
117
+ } catch (error) {__cli_failure = error; throw error;}
118
+ finally {
119
+ let cleanup;
120
+ for (const context of __cli_contexts.reverse()) {
121
+ try {await context.close();} catch (error) {cleanup ??= error;}
122
+ }
123
+ if (!__cli_failure && cleanup) throw cleanup;
124
+ }
125
+ `;
126
+
127
+ // Define executable recipes only. Loading this module neither constructs a
128
+ // compiler generation nor invokes an original CLI or independent oracle.
129
+ export async function addOriginalCLIPrograms({add, locators, text, file, bootstrapSources, sourceRoot}) {
130
+ if (typeof add !== 'function' || !Array.isArray(locators) || typeof text !== 'function' ||
131
+ typeof file !== 'function' || !Array.isArray(bootstrapSources) || typeof sourceRoot !== 'string') {
132
+ throw new TypeError('original CLI adapter requires source services and its complete compiler manifest');
133
+ }
134
+ const modules = [], names = [], seen = new Set();
135
+ for (const filename of bootstrapSources) {
136
+ if (typeof filename !== 'string' || !/^bootstrap\/compiler\/[a-z][a-z0-9-]*\.eli$/.test(filename) || seen.has(filename)) {
137
+ throw new TypeError('original CLI compiler manifest contains an invalid or duplicate source');
138
+ }
139
+ seen.add(filename); names.push(filename.slice('bootstrap/compiler/'.length, -4));
140
+ modules.push({id: filename.slice(0, -4) + '.mjs', filename, source: await text(filename)});
141
+ }
142
+ if (modules.length !== 13 || !seen.has('bootstrap/compiler/compiler.eli')) {
143
+ throw new TypeError('original CLI requires the complete thirteen-module compiler graph');
144
+ }
145
+ const mapped = [];
146
+ for (const suite of ['tests/bootstrap-compiler.test.mjs', 'tests/cli-test.sh']) {
147
+ const coverage = locators.filter(locator => locator.file === suite);
148
+ if (!coverage.length) continue;
149
+ const original = await text(suite), identity = await file(suite), changes = [];
150
+ for (const locator of coverage) {
151
+ if (typeof locator.contains !== 'string' || !original.includes(locator.contains)) {
152
+ throw new TypeError('original compiler CLI coverage locator is not present in its source');
153
+ }
154
+ }
155
+ let hostSource, generations;
156
+ if (suite.endsWith('.test.mjs')) {
157
+ let transported = replaceOriginal(original, 'import { expect, test } from "bun:test";',
158
+ 'import { expect } from "bun:test";', changes);
159
+ transported = replaceOriginal(transported, 'const projectDirectory = resolve(import.meta.dir, "..");',
160
+ 'const projectDirectory = process.env.ELISCRIPT_ORIGINAL_SOURCE_ROOT;\n' +
161
+ 'if (!projectDirectory) throw new Error("original compiler CLI requires its source root");', changes);
162
+ transported = replaceOriginal(transported, '"../bootstrap/host/bun.mjs"',
163
+ JSON.stringify(pathToFileURL(resolve(sourceRoot, 'bootstrap/host/bun.mjs')).href), changes);
164
+ transported = replaceOriginal(transported, 'async function run(command, options = {}) {\n',
165
+ 'async function run(command, options = {}) {\n' +
166
+ ' const replacement = await __cli_prepare_command(command, options);\n' +
167
+ ' if (replacement) return replacement;\n', changes);
168
+ const build = region(transported, 'async function buildWithPortableCompiler(', '\nasync function expectArtifactDirectoriesEqual(');
169
+ transported = replaceOriginal(transported, build,
170
+ 'async function buildWithPortableCompiler(compilerDirectory, outputDirectory) {\n' +
171
+ ' const previous = __cli_directories.get(resolve(compilerDirectory));\n' +
172
+ ' if (!previous) throw new Error("generation producer is not the selected compiler");\n' +
173
+ ' await __cli_place_generation(previous.generation, outputDirectory);\n}\n', changes);
174
+ transported = replaceOriginal(transported, 'async function expectArtifactDirectoriesEqual(left, right) {\n',
175
+ 'async function expectArtifactDirectoriesEqual(left, right) {\n' +
176
+ ' const leftGeneration = __cli_directories.get(resolve(left));\n' +
177
+ ' const rightGeneration = __cli_directories.get(resolve(right));\n' +
178
+ ' if (!leftGeneration || !rightGeneration) throw new Error("original generation comparison lacks actual products");\n' +
179
+ ' left = leftGeneration.javascriptDirectory;\n' +
180
+ ' right = rightGeneration.javascriptDirectory;\n', changes);
181
+ hostSource = generationsTransport(sourceRoot) +
182
+ '\nconst __cli_cases = [];\nfunction test(name, body, timeout) {\n' +
183
+ ' if (!Number.isSafeInteger(timeout) || timeout <= 0) throw new TypeError("original CLI case lost its timeout");\n' +
184
+ ' __cli_cases.push({name, body, timeout});\n}\n' + transported + runOriginalCases;
185
+ generations = {count: 3, producer: 'previous-generation', target: 'selected-target', completeCompiler: true,
186
+ sourceMaps: true, manifestEnvironment: 'ELISCRIPT_ORIGINAL_COMPILER_GENERATIONS',
187
+ manifestFormat: 'eliscript-original-compiler-generations', manifestVersion: 1,
188
+ javascriptCompanions: 'selected-generation-producer', fixedPoint: 'complete-target-artifacts-and-original-javascript-files'};
189
+ } else {
190
+ // The shell body is executed verbatim from the original source root.
191
+ // Its real public CLI loads the selected target via this prepared module
192
+ // directory. Generated user JavaScript is still executed by its original
193
+ // Bun commands, and every diagnostic/snapshot/map assertion remains.
194
+ hostSource = `import {mkdir,readFile,writeFile} from 'node:fs/promises';
195
+ import {resolve} from 'node:path';
196
+ import {pathToFileURL} from 'node:url';
197
+ const root = process.env.ELISCRIPT_ORIGINAL_SOURCE_ROOT;
198
+ if (!root) throw new Error('original shell CLI requires its source root');
199
+ const directory = resolve(process.argv[2], '__eliscript_original_cli_compiler');
200
+ await mkdir(directory, {recursive: true});
201
+ for (const name of ${JSON.stringify(names)}) {
202
+ const source = resolve(process.argv[2], 'bootstrap/compiler', name + '.mjs');
203
+ await readFile(source);
204
+ await writeFile(resolve(directory, name + '.mjs'), 'export * from ' + JSON.stringify(pathToFileURL(source).href) + ';\\n');
205
+ await writeFile(resolve(directory, name + '.mjs.map'), await readFile(source + '.map'));
206
+ }
207
+ const child = Bun.spawn(['sh', resolve(root, 'tests/cli-test.sh')], {
208
+ cwd: root, env: {...process.env, ELISCRIPT_BOOTSTRAP_MODULE_DIR: directory}, stdout: 'pipe', stderr: 'pipe',
209
+ });
210
+ const [code, stdout, stderr] = await Promise.all([child.exited, new Response(child.stdout).text(), new Response(child.stderr).text()]);
211
+ if (code !== 0) throw new Error(stderr.trim() || stdout.trim() || 'original shell CLI failed: ' + code);
212
+ process.stdout.write(stdout);
213
+ `;
214
+ }
215
+ const setupReplacement = {kind: generations ? 'selected-compiler-generations' : 'selected-compiler-module-directory',
216
+ sourceSha256: identity.sha256, modules: modules.map(module => module.id), changes,
217
+ independentOracle: 'original-emacs-seed', algorithms: 'selected-target-only'};
218
+ add({id: 'original-program:compiler-cli-' + (generations ? 'bootstrap-generations' : 'shell'),
219
+ kind: 'project', coverage: coverage.map(locator => locator.id), modules: structuredClone(modules),
220
+ entry: 'bootstrap/compiler/compiler.mjs',
221
+ request: {operation: 'project', resolveImports: true, phased: true, sourceMap: true, entries: modules.map(module => module.id)},
222
+ execution: {kind: 'original-program', host: 'tests/__eliscript_original_compiler_cli_' + (generations ? 'generations' : 'shell') + '.mjs',
223
+ hostSource, arguments: [{directory: true}], aliases: true, requiresBun: true, compilerSourceMaps: true,
224
+ runtimeLaunchers: true, childProcesses: 'inherit-selected-artifact', runtimeProfile:'compiler', setupReplacement,
225
+ ...(generations ? {compilerGenerations: generations} : {})},
226
+ expected: {kind: 'seed-program', oracleRequired: true,
227
+ stdout: generations ? '' : 'CLI and Bun execution test passed\n'},
228
+ original: {manifest: 'stable-compatibility', suite, fixture: suite, host: suite, sourceSha256: identity.sha256,
229
+ regions: [{start: 0, end: original.length, byteStart: 0, byteEnd: Buffer.byteLength(original), sha256: sha256(original)}],
230
+ setupReplacement},
231
+ });
232
+ mapped.push(suite);
233
+ }
234
+ return mapped;
235
+ }
236
+
237
+ // The worker remains the original Bun process and protocol implementation.
238
+ // Only its compiler setup consumes the selected complete compiler session.
239
+ export async function addOriginalWorkerProgram({add, locators, text, file, sourceRoot}) {
240
+ const suite = 'tests/worker-runtime.test.mjs';
241
+ const title = 'long-lived worker implements the versioned NDJSON protocol and maps failures through project source maps';
242
+ const candidates = locators.filter(locator => locator.file === suite);
243
+ if (!candidates.length) return [];
244
+ const source = await text(suite), identity = await file(suite);
245
+ const cases = originalSourceCaseLocators(suite, source);
246
+ const selected = cases.find(locator => locator.contains === title)?.originalCase;
247
+ if (!selected || selected.timeoutMs !== 20000 || selected.registration !== 'test') {
248
+ throw new TypeError('original worker source mapping registration changed');
249
+ }
250
+ const coverage = candidates.filter(locator => {
251
+ if (typeof locator.contains !== 'string' || !locator.contains.length) return false;
252
+ const matches = cases.filter(item => source.slice(item.originalCase.span.start, item.originalCase.span.end).includes(locator.contains));
253
+ return matches.length === 1 && matches[0].originalCase === selected;
254
+ });
255
+ if (!coverage.length) return [];
256
+ const setupStart = source.indexOf('const projectDirectory =');
257
+ if (setupStart < 0) throw new TypeError('original worker dependency boundary changed');
258
+ const header = source.slice(0, setupStart);
259
+ const expectedImports = ['bun:test', 'node:crypto', 'node:fs/promises', 'node:os', 'node:path',
260
+ '../runtime/core/identifier.mjs', '../runtime/core/list.mjs', '../runtime/core/map.mjs',
261
+ '../runtime/core/vector.mjs', '../runtime/core/value.mjs', '../runtime/worker-value-codec.mjs',
262
+ '../runtime/worker-value-stream.mjs'];
263
+ const importPattern = /^import\s+[\s\S]*?\sfrom\s+(["'])([^"']+)\1;/gm;
264
+ const imports = [...header.matchAll(importPattern)];
265
+ if (imports.length !== expectedImports.length || imports.some((match, index) => match[2] !== expectedImports[index]) ||
266
+ header.replace(importPattern, '').trim()) throw new TypeError('original worker dependencies changed');
267
+ let transportedHeader = header;
268
+ const changes = [];
269
+ transportedHeader = replaceOriginal(transportedHeader, 'import { expect, test } from "bun:test";',
270
+ 'import { expect } from "bun:test";', changes);
271
+ for (const specifier of expectedImports.filter(name => name.startsWith('.'))) {
272
+ transportedHeader = replaceOriginal(transportedHeader, JSON.stringify(specifier),
273
+ JSON.stringify(pathToFileURL(resolve(sourceRoot, 'tests', specifier)).href), changes);
274
+ await file(resolve(sourceRoot, 'tests', specifier).slice(resolve(sourceRoot).length + 1));
275
+ }
276
+ const firstCase = Math.min(...cases.map(locator => locator.originalCase.span.start));
277
+ let helpers = source.slice(setupStart, firstCase);
278
+ helpers = replaceOriginal(helpers, 'const projectDirectory = resolve(import.meta.dir, "..");',
279
+ 'const projectDirectory = configuration.sourceRoot;', changes);
280
+ let body = source.slice(selected.span.start, selected.span.end);
281
+ const originalCompile = ' await runSuccessful(\n' +
282
+ ' [compilerPath, "--source-map", "--output", modulePath, fixturePath],\n' +
283
+ ' { env: { ...process.env, EMACS: emacs } },\n' +
284
+ ' );';
285
+ body = replaceOriginal(body, originalCompile,
286
+ ' const compiler = await openSelected();\n' +
287
+ ' try {\n' +
288
+ ' await compileSelectedWorker({input: fixturePath, output: modulePath, sourceMap: true, compiler: {\n' +
289
+ ' build_operation_request(input) { return compiler.request({operation: "protocol", name: "build-operation-request", input}); },\n' +
290
+ ' compile_string_with_source_map(source, filename, generatedFile, sourceName) {\n' +
291
+ ' return compiler.request({operation: "compile", source, filename, sourceMap: {generatedFile, sourceName}});\n' +
292
+ ' },\n' +
293
+ ' }});\n' +
294
+ ' } finally { compiler.close(); }', changes);
295
+ const sources = await loadCompilerSources({sourceRoot});
296
+ for (const record of [...sources.modules, sources.runtime, ...(sources.literalSources ?? [])]) await file(record.filename);
297
+ const completeSourceIdentity = compilerSourceIdentity(sources);
298
+ const fixture = 'tests/fixtures/worker.eli', fixtureIdentity = await file(fixture);
299
+ await file('bootstrap/host/bun.mjs');
300
+ await file('runtime/worker.mjs');
301
+ const moduleURL = name => JSON.stringify(pathToFileURL(resolve(sourceRoot, name)).href);
302
+ const hostSource = transportedHeader + `
303
+ import {readFile} from 'node:fs/promises';
304
+ import assert from 'node:assert/strict';
305
+ import {pathToFileURL} from 'node:url';
306
+ import {createCompilerSession} from ${moduleURL('tools/backends/compiler-session.mjs')};
307
+ import {readCompilerMetadata} from ${moduleURL('tools/backends/compiler-metadata.mjs')};
308
+ import {loadCompilerSources} from ${moduleURL('tools/backends/compiler-build.mjs')};
309
+ import {compilerSourceIdentity} from ${moduleURL('tools/backends/compiler-bootstrap.mjs')};
310
+ import {compileFile as compileSelectedWorker} from ${moduleURL('bootstrap/host/bun.mjs')};
311
+ const configuration=await readCompilerMetadata(process.env.ELISCRIPT_ORIGINAL_COMPILER_SESSION);
312
+ process.chdir(configuration.sourceRoot);
313
+ assert.deepEqual(compilerSourceIdentity(await loadCompilerSources({sourceRoot:configuration.sourceRoot})),${JSON.stringify(completeSourceIdentity)});
314
+ assert.equal(createHash('sha256').update(await readFile(resolve(configuration.sourceRoot,${JSON.stringify(fixture)}))).digest('hex'),${JSON.stringify(fixtureIdentity.sha256)});
315
+ const selectedDriver=configuration.target==='javascript'?await import(pathToFileURL(configuration.path).href):undefined;
316
+ const selectedBytes=configuration.target==='wasm'?new Uint8Array(await readFile(configuration.path)):undefined;
317
+ async function openSelected(){
318
+ const session=await createCompilerSession({host:configuration.target,compiler:selectedDriver,
319
+ ...(configuration.target==='wasm'?{bytes:selectedBytes}:{}),
320
+ ...(configuration.target==='native'?{path:configuration.path,descriptor:{typed:configuration.typed,descriptor:configuration.descriptor}}:{}),
321
+ memory:configuration.memory,options:configuration.runtimeOptions});
322
+ assert.equal(session.host,configuration.target);return session;
323
+ }
324
+ const cases=[];
325
+ function test(name,run,timeout){
326
+ if(name!==${JSON.stringify(title)}||timeout!==20000)throw new TypeError('original worker case changed its deadline');
327
+ cases.push({name,run,timeout});
328
+ }
329
+ ` + helpers + '\n' + body + `
330
+ assert.equal(cases.length,1);
331
+ for(const record of cases){
332
+ let timer;const start=performance.now();
333
+ try{await Promise.race([Promise.resolve().then(record.run),new Promise((_,reject)=>{
334
+ timer=setTimeout(()=>reject(new Error(record.name+' exceeded its original '+record.timeout+' ms timeout')),record.timeout);
335
+ })]);assert(performance.now()-start<=record.timeout,'original worker case exceeded its deadline');}
336
+ finally{clearTimeout(timer);}
337
+ }
338
+ console.log(JSON.stringify(cases.map(record=>record.name)));
339
+ `;
340
+ const region = {start: selected.span.start, end: selected.span.end, byteStart: selected.byteStart,
341
+ byteEnd: selected.byteEnd, sha256: selected.sha256};
342
+ const id = 'original-tools-artifact:worker-source-mapping:bun';
343
+ add({id, kind: 'project', coverage: coverage.map(locator => locator.id), entry: sources.entry,
344
+ modules: structuredClone(sources.modules), memory: {initialPages: 128, maximumPages: 4096},
345
+ request: {operation: 'project', resolveImports: true, phased: false, sourceMap: true},
346
+ execution: {kind: 'compiler-session-program', host: 'tests/__eliscript_original_worker_source_mapping.mjs',
347
+ hostRuntime: 'bun', hostSource, runtimeProfile: 'compiler', compilerProfile: 'small',
348
+ runtimeOptions: {maxSlots: 131072, initialBytes: 8388608, maxBytes: 67108864, auto: 65536}, timeoutMs: 20000,
349
+ setupReplacement: {kind: 'selected-complete-compiler-worker', producer: 'selected-session', changes,
350
+ sourceIdentity: completeSourceIdentity, originalCaseTimeoutMs: selected.timeoutMs}},
351
+ expected: {kind: 'seed-program', oracleRequired: true},
352
+ original: {suite, host: suite, sourceSha256: identity.sha256, regions: [region],
353
+ completeLocatorCoverage: true,
354
+ cases: coverage.map(locator => ({id: locator.id, ...structuredClone(selected)})),
355
+ helperRegion: {start: setupStart, end: firstCase, sha256: sha256(source.slice(setupStart, firstCase))},
356
+ dependencies: {imports: expectedImports, headerSha256: sha256(header),
357
+ fixture: {file: fixture, sha256: fixtureIdentity.sha256}},
358
+ originalAssertions: [title], completeSourceIdentity,
359
+ setupReplacement: {kind: 'selected-complete-compiler-worker', changes}, coverageScope: 'complete-source-mapping-worker-case-only'},
360
+ });
361
+ return [{suite, coverage: coverage.map(locator => locator.id), regions: [region], recordIds: [id]}];
362
+ }
@@ -0,0 +1,247 @@
1
+ // Generated by Eliscript. Do not edit.
2
+ import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
3
+ var __eliscript_tdz_ready_0;
4
+ function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("addOriginalWorkerProgram"); return addOriginalWorkerProgram; }
5
+ function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("addOriginalWorkerProgram"); return __eliscript_const_error(); }
6
+ var __eliscript_tdz_ready_1;
7
+ function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("generation_suite"); return generation_suite; }
8
+ function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("generation_suite"); return __eliscript_const_error(); }
9
+ var __eliscript_tdz_ready_2;
10
+ function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("generation_archive"); return generation_archive; }
11
+ function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("generation_archive"); return __eliscript_const_error(); }
12
+ var __eliscript_tdz_ready_3;
13
+ function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("generation_maintained"); return generation_maintained; }
14
+ function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("generation_maintained"); return __eliscript_const_error(); }
15
+ import "eliscript/runtime/unicode-case.mjs";
16
+ const __eliscript_truthy = (value) => value !== false && value != null;
17
+ const __eliscript_number_intrinsic = globalThis.Number;
18
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
19
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
20
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
21
+ const __eliscript_numeric_error = globalThis.TypeError;
22
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
23
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
24
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
25
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
26
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
27
+ const __eliscript_numeric_primitive = (value) => {
28
+ if (!__eliscript_numeric_object(value)) return value;
29
+ const exotic = value[__eliscript_numeric_symbol];
30
+ if (exotic !== void 0 && exotic !== null) {
31
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
32
+ if (!__eliscript_numeric_object(result)) return result;
33
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
34
+ }
35
+ for (let index = 0; index < 2; index++) {
36
+ const method = value[index === 0 ? "valueOf" : "toString"];
37
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
38
+ const result = __eliscript_numeric_apply(method, value, []);
39
+ if (!__eliscript_numeric_object(result)) return result;
40
+ }
41
+ }
42
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
43
+ };
44
+ const __eliscript_to_number = (value) => {
45
+ const primitive = __eliscript_numeric_primitive(value);
46
+ if (typeof primitive === "string") {
47
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
48
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
49
+ let first = 2;
50
+ while (first < text.length && text[first] === "0") first++;
51
+ if (first === text.length) return 0;
52
+ const prefix = text[1];
53
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
54
+ if (text.length - first > limit) return 1 / 0;
55
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
56
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
57
+ }
58
+ }
59
+ return __eliscript_number_intrinsic(primitive);
60
+ };
61
+ const __eliscript_numeric = (value) => {
62
+ if (typeof value === "number" || typeof value === "bigint") return value;
63
+ const primitive = __eliscript_numeric_primitive(value);
64
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
65
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
66
+ };
67
+ const __eliscript_implicit_number = (value) => {
68
+ if (typeof value === "number") return value;
69
+ const primitive = __eliscript_numeric_primitive(value);
70
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
71
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
72
+ };
73
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
74
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
75
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
76
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
77
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
78
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
79
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
80
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
81
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
82
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
83
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
84
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
85
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
86
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
87
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
88
+ const __eliscript_numeric_relation = (operator, left, right) => {
89
+ if (typeof left === "number" && typeof right === "number") {
90
+ if (operator === "<") return left < right;
91
+ if (operator === "<=") return left <= right;
92
+ if (operator === ">") return left > right;
93
+ return left >= right;
94
+ }
95
+ let a = __eliscript_numeric_primitive(left);
96
+ let b = __eliscript_numeric_primitive(right);
97
+ const x = typeof a, y = typeof b;
98
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
99
+ a = __eliscript_numeric(a);
100
+ b = __eliscript_numeric(b);
101
+ }
102
+ if (operator === "<") return a < b;
103
+ if (operator === "<=") return a <= b;
104
+ if (operator === ">") return a > b;
105
+ return a >= b;
106
+ };
107
+
108
+ import {createHash} from "node:crypto";
109
+ import {Buffer} from "node:buffer";
110
+ import {isDeepStrictEqual} from "node:util";
111
+ import * as legacy from "./compiler-corpus-cli-adapters-legacy.mjs";
112
+ import {originalSourceCaseLocators} from "./compiler-corpus-managed-cases.mjs";
113
+ const addOriginalWorkerProgram = (legacy)["addOriginalWorkerProgram"];
114
+ __eliscript_tdz_ready_0 = true;
115
+ const generation_suite = "tests/bootstrap-compiler.test.mjs";
116
+ __eliscript_tdz_ready_1 = true;
117
+ const generation_archive = "tests/bootstrap-compiler-test-legacy.mjs";
118
+ __eliscript_tdz_ready_2 = true;
119
+ const generation_maintained = "tests/eliscript/bootstrap-compiler.eli";
120
+ __eliscript_tdz_ready_3 = true;
121
+ function hash(source) {
122
+ return ((createHash("sha256"))["update"](source))["digest"]("hex");
123
+ }
124
+ function generation_fail(message) {
125
+ return ((__eliscript_value_1) => { throw __eliscript_value_1; })(new (globalThis.TypeError)(message));
126
+ }
127
+ async function generation_sources(options) {
128
+ return (await (async (files, assets, sources, identities, index) => {
129
+ (await (async () => {
130
+ while (__eliscript_numeric_relation("<", index, ((files) ?? []).length)) {
131
+ (await (async (filename) => {
132
+ return (await (async (source) => {
133
+ return ((identity) => {
134
+ return (() => {
135
+ if ((!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(source) === "string") && ((identity)["file"] === filename) && (hash(source) === (identity)["sha256"]) && ((Buffer)["byteLength"](source) === (identity)["bytes"])))) {
136
+ generation_fail("original CLI generation source asset identity differs");
137
+ }
138
+ (sources)["push"](source);
139
+ (identities)["push"](identity);
140
+ return (assets)["push"](({"file": filename, "sourceSha256": (identity)["sha256"]}));
141
+ })();
142
+ })(await ((options)["file"](filename)));
143
+ })(await ((options)["text"](filename))));
144
+ })((files)[index]));
145
+ ((index = (index + 1)));
146
+ }
147
+ return null;
148
+ })());
149
+ {
150
+ let source = (sources)[0];
151
+ let cases = originalSourceCaseLocators((__eliscript_tdz_read_1()), source);
152
+ if ((!((((cases) ?? []).length === 1) && ((((cases)[0])["originalCase"])["title"] === "portable compiler driver reaches a reproducible fixed point") && ((((cases)[0])["originalCase"])["timeoutMs"] === 30000)))) {
153
+ generation_fail("original CLI generation assertion registration changed");
154
+ }
155
+ return ({"source": source, "identity": (identities)[0], "assets": assets, "maintainedSource": (sources)[1], "generatedSource": (sources)[2], "case": ((cases)[0])["originalCase"]});
156
+ }
157
+ })([(__eliscript_tdz_read_2()), (__eliscript_tdz_read_3()), (__eliscript_tdz_read_1())], [], [], [], 0));
158
+ }
159
+ function generation_record(record, binding) {
160
+ if (((__eliscript_value_2, __eliscript_value_3) => (__eliscript_value_2 !== __eliscript_value_3))((record)["id"], "original-program:compiler-cli-bootstrap-generations")) {
161
+ return record;
162
+ } else {
163
+ {
164
+ let original = (record)["original"];
165
+ let execution = (record)["execution"];
166
+ let source = (binding)["source"];
167
+ let sha = ((binding)["identity"])["sha256"];
168
+ let region = ({"start": 0, "end": ((source) ?? []).length, "byteStart": 0, "byteEnd": (Buffer)["byteLength"](source), "sha256": sha});
169
+ if ((!__eliscript_truthy(((__eliscript_value_4) => (__eliscript_truthy(__eliscript_value_4) ? ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? ((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? ((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? ((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? ((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? isDeepStrictEqual((original)["regions"], [region]) : __eliscript_value_9))((((execution)["setupReplacement"])["sourceSha256"] === sha)) : __eliscript_value_8))((((original)["setupReplacement"])["sourceSha256"] === sha)) : __eliscript_value_7))(((original)["sourceSha256"] === sha)) : __eliscript_value_6))(((original)["host"] === (__eliscript_tdz_read_1()))) : __eliscript_value_5))(((original)["fixture"] === (__eliscript_tdz_read_1()))) : __eliscript_value_4))(((original)["suite"] === (__eliscript_tdz_read_1())))))) {
170
+ generation_fail("original CLI generation assertion archive binding changed");
171
+ }
172
+ return Object.assign(({}), record, ({"original": Object.assign(({}), original, ({"regions": [Object.assign(({}), region, ({"sourceFile": (__eliscript_tdz_read_2())}))], "assertionSource": ({"file": (__eliscript_tdz_read_2()), "sourceSha256": sha, "bytes": (Buffer)["byteLength"](source), "regions": [region]}), "cases": ((record)["coverage"])["map"](((id) => {
173
+ return Object.assign(({}), (binding)["case"], ({"id": id, "sourceFile": (__eliscript_tdz_read_2())}));
174
+ })), "sourceAssets": (binding)["assets"], "maintainedGate": ({"kind": "maintained-eli-original-js-bootstrap-gate", "logicalSuite": (__eliscript_tdz_read_1()), "sourceFile": (__eliscript_tdz_read_3()), "sourceSha256": hash((binding)["maintainedSource"]), "generatedFile": (__eliscript_tdz_read_1()), "generatedSha256": hash((binding)["generatedSource"]), "finalGate": "make test", "originalTimeoutMs": 30000})}))}));
175
+ }
176
+ }
177
+ }
178
+ function original_shell_stdout(source) {
179
+ {
180
+ let first = "printf 'CLI and Bun execution test passed\\n'";
181
+ let second = "console.log(\"Public Seed RAM bytecode and unchanged small-input path passed\");";
182
+ let start = (source)["indexOf"](first);
183
+ let end = (source)["indexOf"](second);
184
+ if ((!(__eliscript_numeric_relation(">=", start, 0) && __eliscript_numeric_relation(">", end, start) && ((source)["indexOf"](first, (start + 1)) === -1) && ((source)["indexOf"](second, (end + 1)) === -1)))) {
185
+ ((__eliscript_value_10) => { throw __eliscript_value_10; })(new (globalThis.TypeError)("original shell CLI success statement boundary changed"));
186
+ }
187
+ return "CLI and Bun execution test passed\nPublic Seed RAM bytecode and unchanged small-input path passed\n";
188
+ }
189
+ }
190
+ function shell_record(record, source) {
191
+ if (((__eliscript_value_11, __eliscript_value_12) => (__eliscript_value_11 !== __eliscript_value_12))((record)["id"], "original-program:compiler-cli-shell")) {
192
+ return record;
193
+ } else {
194
+ {
195
+ const __eliscript_value_13 = original_shell_stdout(source);
196
+ {
197
+ let stdout = __eliscript_value_13;
198
+ if ((!(((record)["original"])["sourceSha256"] === hash(source)))) {
199
+ ((__eliscript_value_14) => { throw __eliscript_value_14; })(new (globalThis.TypeError)("original shell CLI source identity changed"));
200
+ }
201
+ return Object.assign(({}), record, ({"expected": Object.assign(({}), (record)["expected"], ({"stdout": stdout}))}));
202
+ }
203
+ }
204
+ }
205
+ }
206
+ async function addOriginalCLIPrograms(options) {
207
+ return ((options == null) ? await ((legacy)["addOriginalCLIPrograms"](options)) : (await (async (source, add, text) => {
208
+ return ((((__eliscript_value_15, __eliscript_value_16) => (__eliscript_value_15 !== __eliscript_value_16))(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(add), "function") || ((__eliscript_value_17, __eliscript_value_18) => (__eliscript_value_17 !== __eliscript_value_18))(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(text), "function")) ? await ((legacy)["addOriginalCLIPrograms"](options)) : (await (async (forwarded) => {
209
+ return (await (async (locators) => {
210
+ return (await (async (selected) => {
211
+ return (await (async (binding) => {
212
+ return (await (async (file) => {
213
+ return (await (async (ensure_binding) => {
214
+ return (await (async () => {
215
+ ((forwarded)["text"] = (async (filename) => {
216
+ return (__eliscript_truthy(((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? (filename === (__eliscript_tdz_read_1())) : __eliscript_value_20))(selected)) ? (await (ensure_binding()))["source"] : ((value) => {
217
+ if ((filename === "tests/cli-test.sh")) {
218
+ ((source = value));
219
+ }
220
+ return value;
221
+ })(await (text(filename))));
222
+ }));
223
+ if (__eliscript_truthy(selected)) {
224
+ ((forwarded)["file"] = (async (filename) => {
225
+ return ((filename === (__eliscript_tdz_read_1())) ? (await (ensure_binding()))["identity"] : await (file(filename)));
226
+ }));
227
+ }
228
+ ((forwarded)["add"] = ((record) => {
229
+ return add(generation_record(shell_record(record, source), binding));
230
+ }));
231
+ return await ((legacy)["addOriginalCLIPrograms"](forwarded));
232
+ })());
233
+ })((async () => {
234
+ ((binding === undefined) ? ((binding = await (generation_sources(options)))) : null);
235
+ return binding;
236
+ })));
237
+ })((options)["file"]));
238
+ })(undefined));
239
+ })(((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? (locators)["some"](((locator) => {
240
+ return ((locator)["file"] === (__eliscript_tdz_read_1()));
241
+ })) : __eliscript_value_19))(Array.isArray(locators))));
242
+ })((options)["locators"]));
243
+ })(Object.assign(({}), options))));
244
+ })(undefined, (options)["add"], (options)["text"])));
245
+ }
246
+ export {addOriginalCLIPrograms, addOriginalWorkerProgram};
247
+ //# sourceMappingURL=compiler-corpus-cli-adapters.mjs.map