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,1456 @@
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("plans"); return plans; }
5
+ function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("plans"); return __eliscript_const_error(); }
6
+ import "eliscript/runtime/unicode-case.mjs";
7
+ import "eliscript/runtime/math.mjs";
8
+ import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlLnRvU3RyaW5nLFU9TnVtYmVyLG50PU9iamVjdC5jcmVhdGUsaD1CaWdJbnQsZXQ9RGF0YVZpZXcsb3Q9QXJyYXlCdWZmZXIsaXQ9RGF0YVZpZXcucHJvdG90eXBlLnNldEZsb2F0NjQsSj1EYXRhVmlldy5wcm90b3R5cGUuZ2V0VWludDMyLHJ0PVJhbmdlRXJyb3I7ZnVuY3Rpb24gY3QodCxuKXtsZXQgZT1oKG4pLG89aCh0KSxpPSIiO2lmKG88MG4pbz0tbztkb3tsZXQgZj1vJWU7aT0iMDEyMzQ1Njc4OWFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6IltVKGYpXStpLG8vPWV9d2hpbGUobyE9PTBuKTtyZXR1cm4gdDwwPyItIitpOml9ZnVuY3Rpb24gc3QodCxuKXtsZXQgZT1uZXcgZXQobmV3IG90KDgpKTttKGl0LGUsWzAsdCwhMV0pO2xldCBvPW0oSixlLFswLCExXSksaT1tKEosZSxbNCwhMV0pLGY9bz4+PjIwJjIwNDcsYj1vJjEwNDg1NzUscD1vPj4+MzEscj1oKGIpPDwzMm58aChpKTtpZihmIT09MClyKz0xbjw8NTJuO3I8PD0ybjtsZXQgbD00bix1PWY+MSYmYj09PTAmJmk9PT0wPzFuOjJuLGs9Mm47aWYoZj49MTA3NSl7bGV0IGM9aChmLTEwNzUpO3I8PD1jLHU8PD1jLGs8PD1jfWVsc2UgbDw8PWgoZj09PTA/MTA3NDoxMDc1LWYpO2xldCBkPWgobiksZz1udChudWxsKSxhPTAsUz0wLEQ9MDtpZihyPGwpd2hpbGUocjxsKXtpZihyKjJuPmwmJnIraz5sKWJyZWFrO3IqPWQsdSo9ZCxrKj1kLFMtLX1lbHNlIHdoaWxlKHI+PWwqZClsKj1kLFMrKztmb3IoOzspe2xldCBjPVUoci9sKTtyJT1sO2xldCBJPXI8dSx4PXIraz5sO2dbYSsrXT1jLEQ9RCoobiYxKStjJjE7bGV0IHE9cioybixQPXE+bHx8cT09PWwmJkQ9PT0xO2lmKFAmJnh8fCFQJiZJKXtpZihQKXtsZXQgUj1hLEI9ITA7d2hpbGUoUj4wJiZCKXtSLS07bGV0IEg9Z1tSXSsxO2lmKEg9PT1uKWdbUl09MDtlbHNlIGdbUl09SCxCPSExfWlmKEIpZ1swXT0xLFMrK31icmVha31pZihhPj02NCl0aHJvdyBuZXcgcnQoIm51bWJlciByYWRpeCBmb3JtYXR0aW5nIGRpZCBub3QgY29udmVyZ2UiKTtyKj1kLHUqPWQsayo9ZH13aGlsZShhPjEmJmdbYS0xXT09PTApYS0tO2xldCB3PSIiO2lmKFM8MCl7dz0iMC4iO2ZvcihsZXQgYz0wO2M8LTEtUztjKyspdys9IjAiO2ZvcihsZXQgYz0wO2M8YTtjKyspdys9IjAxMjM0NTY3ODlhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eiJbZ1tjXV19ZWxzZXtsZXQgYz1TKzEsST1jPmE/YzphO2ZvcihsZXQgeD0wO3g8STt4Kyspe2lmKHg9PT1jJiZjPGEpdys9Ii4iO3crPXg8YT8iMDEyMzQ1Njc4OWFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6IltnW3hdXToiMCJ9fXJldHVybiBwPyItIit3Ond9ZnVuY3Rpb24gRyh0LG4pe2xldCBlO3RyeXtlPW0odHQsdCxbXSl9Y2F0Y2h7cmV0dXJuIG0oaix0LFtuXSl9bGV0IG89MTA7aWYobiE9PXZvaWQgMCl7bGV0IGk9K247aWYobz1pIT09aT8wOmktaSUxLG88Mnx8bz4zNnx8byE9PW8pcmV0dXJuIG0oaixlLFtvXSl9aWYobz09PTEwfHxlPT09MHx8ZSE9PWV8fGU9PT0xLzB8fGU9PT0tMS8wKXJldHVybiBtKGosZSxbMTBdKTtyZXR1cm4gZSUxPT09MD9jdChlLG8pOnN0KGUsbyl9dmFyIHM9UmVmbGVjdC5hcHBseSxNPUZ1bmN0aW9uLnByb3RvdHlwZS5jYWxsLE49RnVuY3Rpb24ucHJvdG90eXBlLmFwcGx5LEU9RnVuY3Rpb24ucHJvdG90eXBlLmJpbmQsVD1PYmplY3QuZGVmaW5lUHJvcGVydHksbHQ9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcixmdD1PYmplY3QuZ2V0UHJvdG90eXBlT2YsdXQ9T2JqZWN0LnNldFByb3RvdHlwZU9mLGF0PVJlZmxlY3Qub3duS2V5cyxwdD1TeW1ib2wuaGFzSW5zdGFuY2UsVj1BcnJheS5pc0FycmF5LEs9QXJyYXkucHJvdG90eXBlLmpvaW4sej1BcnJheS5wcm90b3R5cGUudG9TdHJpbmcseXQ9T2JqZWN0LnByb3RvdHlwZS50b1N0cmluZyxidD1TdHJpbmcsQz1UeXBlRXJyb3IsZHQ9U3ltYm9sLnRvUHJpbWl0aXZlLGd0PVdlYWtTZXQucHJvdG90eXBlLmhhcyx3dD1XZWFrU2V0LnByb3RvdHlwZS5hZGQseHQ9V2Vha1NldC5wcm90b3R5cGUuZGVsZXRlLEY9bmV3IFdlYWtTZXQsTz1udWxsLFc9KHQpPT50IT09bnVsbCYmKHR5cGVvZiB0PT09Im9iamVjdCJ8fHR5cGVvZiB0PT09ImZ1bmN0aW9uInx8dHlwZW9mIHQ+InUiJiZ0IT09dm9pZCAwKSxBPSh0KT0+dHlwZW9mIHQ9PT0iZnVuY3Rpb24ifHx0eXBlb2YgdD4idSImJnQhPT12b2lkIDA7ZnVuY3Rpb24gaHQoKXtsZXQgbj1uZXcgQygiY3ljbGljIGFycmF5IHRleHQgY29udmVyc2lvbiIpO3Rocm93IG4uZWxpc2NyaXB0RGlhZ25vc3RpYz17Zm9ybWF0OiJlbGlzY3JpcHQtZGlhZ25vc3RpYyIsdmVyc2lvbjoxLGNvZGU6IkVMSS1SVDAwMDkiLHNldmVyaXR5OiJlcnJvciIscGhhc2U6InJ1bnRpbWUiLG1lc3NhZ2U6ImN5Y2xpYyBhcnJheSB0ZXh0IGNvbnZlcnNpb24ifSxufWZ1bmN0aW9uIG10KHQpe2lmKCFXKHQpKXJldHVybiB0O2xldCBuPXRbZHRdO2lmKG4hPT12b2lkIDAmJm4hPT1udWxsKXtsZXQgZT1zKG4sdCxbInN0cmluZyJdKTtpZighVyhlKSlyZXR1cm4gZTt0aHJvdyBuZXcgQygiQ2Fubm90IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfWZvcihsZXQgZT0wO2U8MjtlKyspe2xldCBvPXRbZT09PTA/InRvU3RyaW5nIjoidmFsdWVPZiJdO2lmKEEobykpe2xldCBpPW89PT16JiZWKHQpP3YodCk6cyhvLHQsW10pO2lmKCFXKGkpKXJldHVybiBpfX10aHJvdyBuZXcgQygiQ2Fubm90IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfWZ1bmN0aW9uIFEodCl7bGV0IG49bXQodCk7aWYodHlwZW9mIG49PT0ic3ltYm9sIil0aHJvdyBuZXcgQygiQ2Fubm90IGNvbnZlcnQgYSBTeW1ib2wgdmFsdWUgdG8gYSBzdHJpbmciKTtyZXR1cm4gYnQobil9ZnVuY3Rpb24gXyh0LG4pe2xldCBlPSt0Lmxlbmd0aCxvPWUhPT1lfHxlPD0wPzA6ZT49OTAwNzE5OTI1NDc0MDk5MT85MDA3MTk5MjU0NzQwOTkxOmUtZSUxLGk9bj09PXZvaWQgMD8iLCI6UShuKSxmPU89PT1udWxsO2lmKGYpTz10O2Vsc2V7aWYodD09PU98fHMoZ3QsRixbdF0pKWh0KCk7cyh3dCxGLFt0XSl9dHJ5e2xldCBiPSIiO2ZvcihsZXQgcD0wO3A8bztwKyspe2lmKHApYis9aTtsZXQgcj10W3BdO2lmKHIhPT1udWxsJiZyIT09dm9pZCAwKWIrPVEocil9cmV0dXJuIGJ9ZmluYWxseXtpZihmKU89bnVsbDtlbHNlIHMoeHQsRixbdF0pfX1mdW5jdGlvbiB2KHQpe2xldCBuPXQuam9pbjtyZXR1cm4gQShuKT9uPT09Sz9fKHQsdm9pZCAwKTpzKG4sdCxbXSk6cyh5dCx0LFtdKX1mdW5jdGlvbiB5KHQsbil7cmV0dXJuIG48dC5sZW5ndGg/dFtuXTp2b2lkIDB9ZnVuY3Rpb24gWCh0LG4pe2xldCBlPVtdO2ZvcihsZXQgbz1uO288dC5sZW5ndGg7bysrKVQoZSxlLmxlbmd0aCx7dmFsdWU6dFtvXSx3cml0YWJsZTohMCxlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMH0pO3JldHVybiBlfWZ1bmN0aW9uIFN0KHQsbil7bGV0IGU9W107Zm9yKGxldCBvPTA7bzx0Lmxlbmd0aCtuLmxlbmd0aDtvKyspVChlLG8se3ZhbHVlOm88dC5sZW5ndGg/dFtvXTpuW28tdC5sZW5ndGhdLHdyaXRhYmxlOiEwLGVudW1lcmFibGU6ITAsY29uZmlndXJhYmxlOiEwfSk7cmV0dXJuIGV9ZnVuY3Rpb24gWSguLi50KXtyZXR1cm4gdH1mdW5jdGlvbiBaKHQsbil7cmV0dXJuIG4/cyhOLFksW3ZvaWQgMCx0XSk6cyhZLHZvaWQgMCx0KX1mdW5jdGlvbiBMKHQsbixlKXtmb3IoOzspe2lmKHQ9PT1qKXJldHVybiBHKG4seShlLDApKTtpZih0PT09SyYmVihuKSlyZXR1cm4gXyhuLHkoZSwwKSk7aWYodD09PXomJlYobikpcmV0dXJuIHYobik7aWYodD09PU0pe2lmKCFBKG4pKXJldHVybiBzKHQsbixlKTtsZXQgbz1uLGk9eShlLDApO2U9WChlLDEpLHQ9byxuPWk7Y29udGludWV9aWYodD09PU4pe2lmKCFBKG4pKXJldHVybiBzKHQsbixlKTtsZXQgbz1uLGk9eShlLDApO2U9Wih5KGUsMSksITApLHQ9byxuPWk7Y29udGludWV9aWYodD09PXMpe2xldCBvPXkoZSwwKSxpPXkoZSwxKTtpZighQShvKSlyZXR1cm4gcyh0LG4sZSk7ZT1aKHkoZSwyKSwhMSksdD1vLG49aTtjb250aW51ZX1pZih0PT09RSl7bGV0IG89cyh0LG4sZSk7aWYobiE9PWomJm4hPT1LJiZuIT09eiYmbiE9PU0mJm4hPT1OJiZuIT09cyYmbiE9PUUpcmV0dXJuIG87bGV0IGk9bixmPXkoZSwwKSxiPVgoZSwxKSxwPSguLi51KT0+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
9
+ const __eliscript_truthy = (value) => value !== false && value != null;
10
+ const __eliscript_number_intrinsic = globalThis.Number;
11
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
12
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
13
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
14
+ const __eliscript_numeric_error = globalThis.TypeError;
15
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
16
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
17
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
18
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
19
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
20
+ const __eliscript_numeric_primitive = (value) => {
21
+ if (!__eliscript_numeric_object(value)) return value;
22
+ const exotic = value[__eliscript_numeric_symbol];
23
+ if (exotic !== void 0 && exotic !== null) {
24
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
25
+ if (!__eliscript_numeric_object(result)) return result;
26
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
27
+ }
28
+ for (let index = 0; index < 2; index++) {
29
+ const method = value[index === 0 ? "valueOf" : "toString"];
30
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
31
+ const result = __eliscript_numeric_apply(method, value, []);
32
+ if (!__eliscript_numeric_object(result)) return result;
33
+ }
34
+ }
35
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
36
+ };
37
+ const __eliscript_to_number = (value) => {
38
+ const primitive = __eliscript_numeric_primitive(value);
39
+ if (typeof primitive === "string") {
40
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
41
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
42
+ let first = 2;
43
+ while (first < text.length && text[first] === "0") first++;
44
+ if (first === text.length) return 0;
45
+ const prefix = text[1];
46
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
47
+ if (text.length - first > limit) return 1 / 0;
48
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
49
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
50
+ }
51
+ }
52
+ return __eliscript_number_intrinsic(primitive);
53
+ };
54
+ const __eliscript_numeric = (value) => {
55
+ if (typeof value === "number" || typeof value === "bigint") return value;
56
+ const primitive = __eliscript_numeric_primitive(value);
57
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
58
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
59
+ };
60
+ const __eliscript_implicit_number = (value) => {
61
+ if (typeof value === "number") return value;
62
+ const primitive = __eliscript_numeric_primitive(value);
63
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
64
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
65
+ };
66
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
67
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
68
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
69
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
70
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
71
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
72
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
73
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
74
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
75
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
76
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
77
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
78
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
79
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
80
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
81
+ const __eliscript_numeric_relation = (operator, left, right) => {
82
+ if (typeof left === "number" && typeof right === "number") {
83
+ if (operator === "<") return left < right;
84
+ if (operator === "<=") return left <= right;
85
+ if (operator === ">") return left > right;
86
+ return left >= right;
87
+ }
88
+ let a = __eliscript_numeric_primitive(left);
89
+ let b = __eliscript_numeric_primitive(right);
90
+ const x = typeof a, y = typeof b;
91
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
92
+ a = __eliscript_numeric(a);
93
+ b = __eliscript_numeric(b);
94
+ }
95
+ if (operator === "<") return a < b;
96
+ if (operator === "<=") return a <= b;
97
+ if (operator === ">") return a > b;
98
+ return a >= b;
99
+ };
100
+
101
+ import {readOriginalCorpusExecutionContext} from "./compiler-corpus-process.mjs";
102
+ import assert from "node:assert/strict";
103
+ import {createHash} from "node:crypto";
104
+ import {runInNewContext} from "node:vm";
105
+ import {mkdirSync, writeFileSync} from "node:fs";
106
+ import {resolve} from "node:path";
107
+ import {compile_ir_string} from "../../dist/bootstrap/compiler.mjs";
108
+ import {emit_expression} from "../../dist/bootstrap/emitter.mjs";
109
+ import {raw_scope} from "./compiler-corpus-raw-fixture-observer.mjs";
110
+ const plans = [({"family": "empty-bindings", "hostOnlyGroups": []}), ({"family": "exceptions", "hostOnlyGroups": []}), ({"family": "catch-destructuring", "hostOnlyGroups": ["host Set iterator input; original catch iterator interoperability suite"]}), ({"family": "builtins", "hostOnlyGroups": []}), ({"family": "typeof", "hostOnlyGroups": ["arbitrary host ()=>1 input; original typeof host interoperability"]}), ({"family": "array-text", "hostOnlyGroups": []}), ({"family": "strings", "hostOnlyGroups": []}), ({"family": "callables", "requiredABI": "managed-module-v1", "hostOnlyGroups": []}), ({"family": "primitive-operators", "hostOnlyGroups": ["host valueOf callbacks and external trace; original primitive operators Node oracle"]}), ({"family": "js-cons", "hostOnlyGroups": ["host Set/Map iterator objects; original js-cons iterator interoperability"]}), ({"family": "json", "hostOnlyGroups": []})];
111
+ __eliscript_tdz_ready_0 = true;
112
+ function originalRawLanguageFixturePlans() {
113
+ return globalThis.structuredClone((__eliscript_tdz_read_0()));
114
+ }
115
+ function oc(oracle, name, ...args) {
116
+ return __eliscript_at(Reflect, "apply")((oracle)[(name)["replaceAll"]("-", "_")], oracle, args);
117
+ }
118
+ function raw_args(scope, args) {
119
+ return (args)["map"](((item) => {
120
+ return (scope)["box"](item);
121
+ }));
122
+ }
123
+ function call(scope, name, args) {
124
+ return __eliscript_at(Reflect, "apply")((scope)["call"], scope, ([name])["concat"](args));
125
+ }
126
+ function value(scope, name, args) {
127
+ return (scope)["read"](call(scope, name, args));
128
+ }
129
+ function scalar(check, oracle, name, args) {
130
+ return check(name, ((scope) => {
131
+ return (assert)["deepStrictEqual"](value(scope, name, raw_args(scope, args)), __eliscript_at(Reflect, "apply")((oracle)[(name)["replaceAll"]("-", "_")], oracle, args));
132
+ }));
133
+ }
134
+ function primitives() {
135
+ return [undefined, null, false, true, -0.0, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity), globalThis.Number.MIN_VALUE, "中😀\ud800"];
136
+ }
137
+ function error_name(action) {
138
+ return (() => {
139
+ try {
140
+ action();
141
+ return undefined;
142
+ } catch (error) {
143
+ return (error)["name"];
144
+ }
145
+ })();
146
+ }
147
+ function data(scope, runtime, input) {
148
+ if (((input == null) || ((__eliscript_value_1, __eliscript_value_2) => (__eliscript_value_1 !== __eliscript_value_2))(((__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; } })(input), "object"))) {
149
+ return (scope)["box"](input);
150
+ } else {
151
+ if (__eliscript_truthy(Array.isArray(input))) {
152
+ {
153
+ const __eliscript_value_3 = new (globalThis.Array)(((input) ?? []).length);
154
+ {
155
+ let items = __eliscript_value_3;
156
+ (Object.keys(input))["forEach"](((key) => {
157
+ return ((items)[key] = data(scope, runtime, (input)[key]));
158
+ }));
159
+ return (scope)["keep"]((runtime)["sourceArray"](items));
160
+ }
161
+ }
162
+ } else {
163
+ if (((Object.getPrototypeOf(input) === globalThis.Object.prototype) || (Object.getPrototypeOf(input) === null))) {
164
+ {
165
+ const __eliscript_value_4 = Object.create(null);
166
+ {
167
+ let items = __eliscript_value_4;
168
+ (Object.keys(input))["forEach"](((key) => {
169
+ {
170
+ const __eliscript_value_5 = Object.getOwnPropertyDescriptor(input, key);
171
+ {
172
+ let descriptor = __eliscript_value_5;
173
+ if ((!__eliscript_truthy(Object.hasOwn(descriptor, "value")))) {
174
+ ((__eliscript_value_6) => { throw __eliscript_value_6; })(new (globalThis.TypeError)("raw fixture input accessor is a host capability"));
175
+ }
176
+ return ((items)[key] = data(scope, runtime, (descriptor)["value"]));
177
+ }
178
+ }
179
+ }));
180
+ return (scope)["keep"]((runtime)["sourceObject"](items));
181
+ }
182
+ }
183
+ } else {
184
+ return ((__eliscript_value_7) => { throw __eliscript_value_7; })(new (globalThis.TypeError)("raw fixture input requires an explicit interoperability capability"));
185
+ }
186
+ }
187
+ }
188
+ }
189
+ function property(scope, runtime, object, key) {
190
+ return (scope)["keep"]((runtime)["objectGet"](object, (scope)["box"](key)));
191
+ }
192
+ function closure(runtime, handle) {
193
+ return (runtime)["toHostValue"](handle);
194
+ }
195
+ function run_empty(check, oracle, runtime) {
196
+ ((primitives())["filter"](((input) => {
197
+ return (!__eliscript_truthy(Object.is(input, __eliscript_numeric_neg(globalThis.Infinity))));
198
+ })))["forEach"](((input) => {
199
+ return (["parallel-value", "sequential-value", "capture-value"])["forEach"](((name) => {
200
+ return scalar(check, oracle, name, [input]);
201
+ }));
202
+ }));
203
+ scalar(check, oracle, "default-value", []);
204
+ ([0, 1, 8, 32])["forEach"](((count) => {
205
+ return scalar(check, oracle, "loop-value", [count]);
206
+ }));
207
+ check("escaped cells", ((s) => {
208
+ {
209
+ let a = closure(runtime, __eliscript_at_direct(s, "call", "escape-value"));
210
+ let b = closure(runtime, __eliscript_at_direct(s, "call", "escape-value"));
211
+ let ra = oc(oracle, "escape-value");
212
+ let rb = oc(oracle, "escape-value");
213
+ return (assert)["deepStrictEqual"]([a(null), a(-0.0), a(null), b(null), a(globalThis.NaN), a(null), b(7), b(null)], [ra(null), ra(-0.0), ra(null), rb(null), ra(globalThis.NaN), ra(null), rb(7), rb(null)]);
214
+ }
215
+ }));
216
+ return check("initializer effects", ((s) => {
217
+ {
218
+ const __eliscript_value_8 = (s)["object"](({}));
219
+ const __eliscript_value_9 = ({});
220
+ {
221
+ let trace = __eliscript_value_8;
222
+ let reference = __eliscript_value_9;
223
+ return (assert)["deepStrictEqual"]([(s)["value"]("effect-value", trace), (s)["read"](trace)], [oc(oracle, "effect-value", reference), reference]);
224
+ }
225
+ }
226
+ }));
227
+ }
228
+ function run_catch(check, oracle, runtime) {
229
+ ([[], [1], [1, 2, 3, 4, 5], "A😀\ud800Z"])["forEach"](((input) => {
230
+ return check("iterator destructuring", ((s) => {
231
+ return (assert)["deepStrictEqual"]((s)["value"]("array", data(s, runtime, input)), oc(oracle, "array", input));
232
+ }));
233
+ }));
234
+ ([({}), ({"left": undefined, "right": null}), ({"left": false, "right": 3})])["forEach"](((input) => {
235
+ return check("object defaults", ((s) => {
236
+ {
237
+ const __eliscript_value_10 = data(s, runtime, input);
238
+ {
239
+ let raw = __eliscript_value_10;
240
+ return (assert)["deepStrictEqual"]([(s)["value"]("object", raw), (s)["value"]("captured", raw), (s)["value"]("tdz", raw)], [oc(oracle, "object", input), oc(oracle, "captured", input), oc(oracle, "tdz", input)]);
241
+ }
242
+ }
243
+ }));
244
+ }));
245
+ ([null, undefined, false, 7, ({})])["forEach"](((input) => {
246
+ return check("invalid iterator", ((s) => {
247
+ return (assert)["deepStrictEqual"]((s)["value"]("invalid", data(s, runtime, input)), oc(oracle, "invalid", input));
248
+ }));
249
+ }));
250
+ return scalar(check, oracle, "protocol", []);
251
+ }
252
+ function run_exceptions(check, oracle, runtime) {
253
+ ((primitives())["concat"]([({}), []]))["forEach"](((input) => {
254
+ return check("source throw identity", ((s) => {
255
+ {
256
+ let raw = data(s, runtime, input);
257
+ let trace = (s)["array"]([]);
258
+ let nested = (s)["array"]([]);
259
+ let ref_trace = [];
260
+ let ref_nested = [];
261
+ (["caught", "indirect"])["forEach"](((name) => {
262
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")(name, raw), raw));
263
+ return (assert)["strictEqual"](oc(oracle, name, input), input);
264
+ }));
265
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("across", (s)["box"](24), raw), raw));
266
+ (assert)["strictEqual"](oc(oracle, "across", 24, input), input);
267
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("call-handler", __eliscript_at(s, "call")("handler-closure", raw)), raw));
268
+ (assert)["strictEqual"](oc(oracle, "call-handler", oc(oracle, "handler-closure", input)), input);
269
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("normal", raw, trace), raw));
270
+ (assert)["strictEqual"](oc(oracle, "normal", input, ref_trace), input);
271
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("nested", raw, nested), raw));
272
+ (assert)["strictEqual"](oc(oracle, "nested", input, ref_nested), input);
273
+ {
274
+ const __eliscript_value_11 = __eliscript_at(s, "call")("shadow", raw);
275
+ const __eliscript_value_12 = oc(oracle, "shadow", input);
276
+ {
277
+ let shadow = __eliscript_value_11;
278
+ let ref_shadow = __eliscript_value_12;
279
+ (assert)["ok"]((s)["same"]((s)["get"](shadow, 0), raw));
280
+ (assert)["strictEqual"]((ref_shadow)[0], input);
281
+ return (assert)["deepStrictEqual"]([(s)["read"](trace), (s)["read"](nested), (s)["read"]((s)["get"](shadow, 1))], [ref_trace, ref_nested, (ref_shadow)[1]]);
282
+ }
283
+ }
284
+ }
285
+ }));
286
+ }));
287
+ check("finally replacement", ((s) => {
288
+ {
289
+ let first = (s)["object"](({}));
290
+ let second = (s)["object"](({}));
291
+ let trace = (s)["array"]([]);
292
+ let seen = false;
293
+ (() => {
294
+ try {
295
+ return __eliscript_at(s, "call")("replaced", first, second, trace);
296
+ } catch (error) {
297
+ {
298
+ const __eliscript_value_13 = (s)["keep"](error);
299
+ {
300
+ let owned = __eliscript_value_13;
301
+ (assert)["ok"]((s)["same"](owned, second));
302
+ return ((seen = true));
303
+ }
304
+ }
305
+ }
306
+ })();
307
+ (assert)["ok"](seen);
308
+ (assert)["ok"]((s)["same"]((s)["get"](trace, 0), first));
309
+ (assert)["strictEqual"]((s)["read"]((s)["get"](trace, 1)), "finally");
310
+ return (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("handler-throw", first, second), second));
311
+ }
312
+ }));
313
+ {
314
+ const __eliscript_value_14 = 0;
315
+ {
316
+ let kind = __eliscript_value_14;
317
+ while (__eliscript_numeric_relation("<", kind, 4)) {
318
+ ([undefined, "", "中😀\ud800"])["forEach"](((message) => {
319
+ return check("Error constructors", ((s) => {
320
+ {
321
+ let marker = (s)["object"](({}));
322
+ let options = (s)["keep"]((runtime)["sourceObject"](({"cause": marker})));
323
+ let error = __eliscript_at(s, "call")("make-error", (s)["box"](kind), (s)["box"](message), options);
324
+ let ref_marker = ({});
325
+ let ref = oc(oracle, "make-error", kind, message, ({"cause": ref_marker}));
326
+ (assert)["ok"]((s)["same"](property(s, runtime, error, "cause"), marker));
327
+ (assert)["strictEqual"]((ref)["cause"], ref_marker);
328
+ (assert)["deepStrictEqual"]((s)["value"]("error-summary", error), oc(oracle, "error-summary", ref));
329
+ return (assert)["deepStrictEqual"]((s)["read"]((s)["keep"]((runtime)["objectKeys"](error))), Object.keys(ref));
330
+ }
331
+ }));
332
+ }));
333
+ ((kind = (kind + 1)));
334
+ }
335
+ return null;
336
+ }
337
+ }
338
+ }
339
+ function failure(scope, runtime, action) {
340
+ return (() => {
341
+ try {
342
+ action();
343
+ return undefined;
344
+ } catch (error) {
345
+ if (((error)["kind"] === 13)) {
346
+ return (scope)["read"](property(scope, runtime, (scope)["keep"](error), "name"));
347
+ } else {
348
+ return (error)["name"];
349
+ }
350
+ }
351
+ })();
352
+ }
353
+ function run_builtins(check, oracle, runtime) {
354
+ {
355
+ const __eliscript_value_15 = [undefined, null, false, true, 0, -0.0, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity), globalThis.Number.MIN_VALUE, globalThis.Number.MAX_VALUE, "", " ", "12", "-0", "x", "中😀\ud800", [], ({}), [1]];
356
+ {
357
+ let values = __eliscript_value_15;
358
+ (values)["forEach"](((input) => {
359
+ (["number-call", "string-call", "boolean-call", "finite-call", "nan-call", "integer-call", "safe-call", "array-call", "coercive-finite", "coercive-nan", "math-round-call", "math-floor-call", "math-ceil-call", "math-trunc-call"])["forEach"](((name) => {
360
+ return check(name, ((s) => {
361
+ return (assert)["deepStrictEqual"]((s)["value"](name, data(s, runtime, input)), oc(oracle, name, input));
362
+ }));
363
+ }));
364
+ check("apply and held builtins", ((s) => {
365
+ {
366
+ const __eliscript_value_16 = data(s, runtime, input);
367
+ {
368
+ let raw = __eliscript_value_16;
369
+ return (assert)["deepStrictEqual"]([(s)["value"]("number-apply", (s)["keep"]((runtime)["sourceArray"]([raw]))), (s)["value"]("invoke-one", __eliscript_at_direct(s, "call", "held-number"), raw)], [oc(oracle, "number-apply", [input]), oc(oracle, "invoke-one", oc(oracle, "held-number"), input)]);
370
+ }
371
+ }
372
+ }));
373
+ return (values)["forEach"](((right) => {
374
+ return check("Object.is exact", ((s) => {
375
+ {
376
+ let left_value = data(s, runtime, input);
377
+ let right_value = (__eliscript_truthy(Object.is(input, right)) ? left_value : data(s, runtime, right));
378
+ return (assert)["deepStrictEqual"]([(s)["value"]("object-same", left_value, right_value), (s)["value"]("object-same-alias", left_value, right_value)], [oc(oracle, "object-same", input, right), oc(oracle, "object-same-alias", input, right)]);
379
+ }
380
+ }));
381
+ }));
382
+ }));
383
+ (["number-empty", "string-empty", "boolean-empty", "same-number", "same-finite", "math-empty", "same-round", "object-same-empty", "same-object-is", "freeze-empty", "frozen-empty", "same-freeze"])["forEach"](((name) => {
384
+ return scalar(check, oracle, name, []);
385
+ }));
386
+ check("extra argument effects", ((s) => {
387
+ {
388
+ const __eliscript_value_17 = (s)["object"](({}));
389
+ const __eliscript_value_18 = ({});
390
+ {
391
+ let trace = __eliscript_value_17;
392
+ let ref = __eliscript_value_18;
393
+ return (assert)["deepStrictEqual"]([(s)["value"]("number-extra", (s)["box"]("12"), trace), (s)["read"](trace)], [oc(oracle, "number-extra", "12", ref), ref]);
394
+ }
395
+ }
396
+ }));
397
+ check("callback firstclass", ((s) => {
398
+ return (assert)["deepStrictEqual"]([(s)["value"]("number-map", (s)["array"](["1", "2", "x"])), (s)["value"]("finite-map", (s)["array"]([1, globalThis.NaN, "2"]))], [oc(oracle, "number-map", ["1", "2", "x"]), oc(oracle, "finite-map", [1, globalThis.NaN, "2"])]);
399
+ }));
400
+ ([undefined, null, false, 1, "x"])["forEach"](((input) => {
401
+ return check("primitive integrity", ((s) => {
402
+ {
403
+ const __eliscript_value_19 = (s)["box"](input);
404
+ {
405
+ let raw = __eliscript_value_19;
406
+ return (assert)["deepStrictEqual"]([(s)["value"]("freeze-call", raw), (s)["value"]("frozen-call", raw)], [oc(oracle, "freeze-call", input), oc(oracle, "frozen-call", input)]);
407
+ }
408
+ }
409
+ }));
410
+ }));
411
+ return check("frozen source object", ((s) => {
412
+ {
413
+ const __eliscript_value_20 = (s)["object"](({"tag": 1}));
414
+ const __eliscript_value_21 = ({"tag": 1});
415
+ {
416
+ let object = __eliscript_value_20;
417
+ let ref = __eliscript_value_21;
418
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("freeze-alias", object), object));
419
+ (assert)["strictEqual"](oc(oracle, "freeze-alias", ref), ref);
420
+ return (assert)["deepStrictEqual"]([(s)["value"]("frozen-call", object), failure(s, runtime, (() => {
421
+ return __eliscript_at(s, "call")("integrity-write", object);
422
+ }))], [oc(oracle, "frozen-call", ref), error_name((() => {
423
+ return oc(oracle, "integrity-write", ref);
424
+ }))]);
425
+ }
426
+ }
427
+ }));
428
+ }
429
+ }
430
+ }
431
+ function run_typeof(check, oracle, runtime) {
432
+ {
433
+ const __eliscript_value_22 = [undefined, null, false, true, 0, -0.0, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity), globalThis.Number.MIN_VALUE, globalThis.Number.MAX_VALUE, "", "中😀\ud800", ({}), []];
434
+ {
435
+ let values = __eliscript_value_22;
436
+ (values)["forEach"](((input) => {
437
+ check("typeof and captured member", ((s) => {
438
+ {
439
+ let raw = data(s, runtime, input);
440
+ let object = (s)["keep"]((runtime)["sourceObject"](({"item": raw})));
441
+ let deep = (s)["keep"]((runtime)["sourceObject"](({"child": object})));
442
+ return (assert)["deepStrictEqual"]([(s)["value"]("type-value", raw), (s)["value"]("type-underscore", raw), (s)["value"]("type-member", object), (s)["value"]("type-deep", deep), (s)["value"]("type-shadow", raw), (s)["value"]("invoke", __eliscript_at(s, "call")("capture", raw))], [oc(oracle, "type-value", input), oc(oracle, "type-underscore", input), oc(oracle, "type-member", ({"item": input})), oc(oracle, "type-deep", ({"child": ({"item": input})})), oc(oracle, "type-shadow", input), oc(oracle, "invoke", oc(oracle, "capture", input))]);
443
+ }
444
+ }));
445
+ return check("existing predicates and imported paths", ((s) => {
446
+ {
447
+ let raw = data(s, runtime, input);
448
+ let items = (s)["keep"]((runtime)["sourceArray"]([(s)["keep"]((runtime)["sourceObject"](({"item": raw})))]));
449
+ let keys = (s)["keep"]((runtime)["sourceArray"]([(s)["keep"]((runtime)["sourceObject"](Object.fromEntries([["a.b", raw]])))]));
450
+ return (assert)["deepStrictEqual"]([(s)["value"]("type-intrinsic", raw), (s)["value"]("is-nil", raw), (s)["value"]("is-undefined", raw), (s)["value"]("is-null", raw), (s)["value"]("is-nullish", raw), (s)["value"]("type-index", items), (s)["value"]("type-index-key", keys), (s)["value"]("invoke", __eliscript_at(s, "call")("capture-index", items))], [oc(oracle, "type-intrinsic", input), oc(oracle, "is-nil", input), oc(oracle, "is-undefined", input), oc(oracle, "is-null", input), oc(oracle, "is-nullish", input), oc(oracle, "type-index", [({"item": input})]), oc(oracle, "type-index-key", [Object.fromEntries([["a.b", input]])]), oc(oracle, "invoke", oc(oracle, "capture-index", [({"item": input})]))]);
451
+ }
452
+ }));
453
+ }));
454
+ ([undefined, null, false, -0.0, globalThis.NaN, "中😀\ud800"])["forEach"](((input) => {
455
+ return check("module typeof writes", ((s) => {
456
+ return (assert)["deepStrictEqual"]([(s)["value"]("write-global", (s)["box"](input)), (s)["value"]("type-global")], [oc(oracle, "write-global", input), oc(oracle, "type-global")]);
457
+ }));
458
+ }));
459
+ check("missing member", ((s) => {
460
+ return (assert)["strictEqual"]((s)["value"]("type-member", (s)["object"](({}))), oc(oracle, "type-member", ({})));
461
+ }));
462
+ ([null, undefined])["forEach"](((input) => {
463
+ return check("member error", ((s) => {
464
+ return (assert)["strictEqual"](failure(s, runtime, (() => {
465
+ return __eliscript_at(s, "call")("type-member", input);
466
+ })), error_name((() => {
467
+ return oc(oracle, "type-member", input);
468
+ })));
469
+ }));
470
+ }));
471
+ {
472
+ const __eliscript_value_23 = 693068247;
473
+ const __eliscript_value_24 = new (globalThis.DataView)(new (globalThis.ArrayBuffer)(8));
474
+ const __eliscript_value_25 = 0;
475
+ {
476
+ let state = __eliscript_value_23;
477
+ let bits = __eliscript_value_24;
478
+ let index = __eliscript_value_25;
479
+ while (__eliscript_numeric_relation("<", index, 1024)) {
480
+ ((state = __eliscript_numeric_ushr((Math.imul(state, 1664525) + 1013904223), 0)));
481
+ (bits)["setUint32"](0, state);
482
+ ((state = __eliscript_numeric_ushr((Math.imul(state, 1664525) + 1013904223), 0)));
483
+ (bits)["setUint32"](4, state);
484
+ {
485
+ const __eliscript_value_26 = (bits)["getFloat64"](0);
486
+ {
487
+ let input = __eliscript_value_26;
488
+ check("IEEE type identity", ((s) => {
489
+ {
490
+ let raw = (s)["box"](input);
491
+ let box = __eliscript_at(s, "call")("make-box", raw);
492
+ return (assert)["deepStrictEqual"]([(s)["value"]("type-value", raw), Object.is((s)["read"](property(s, runtime, box, "item")), input)], [oc(oracle, "type-value", input), Object.is((oc(oracle, "make-box", input))["item"], input)]);
493
+ }
494
+ }));
495
+ }
496
+ }
497
+ ((index = (index + 1)));
498
+ }
499
+ return null;
500
+ }
501
+ }
502
+ }
503
+ }
504
+ }
505
+ function run_cons(check, oracle, runtime) {
506
+ {
507
+ const __eliscript_value_27 = new (globalThis.Array)(3);
508
+ {
509
+ let sparse = __eliscript_value_27;
510
+ ((sparse)[0] = undefined);
511
+ ((sparse)[2] = false);
512
+ ([null, undefined, [], sparse, "A😀\ud800Z", false, true, 1, ({})])["forEach"](((tail) => {
513
+ return check("js-cons spread", ((s) => {
514
+ {
515
+ const __eliscript_value_28 = data(s, runtime, tail);
516
+ {
517
+ let raw = __eliscript_value_28;
518
+ return (assert)["deepStrictEqual"]([(s)["value"]("safe", (s)["box"]("head"), raw), (s)["value"]("raw-nullish", raw)], [oc(oracle, "safe", "head", tail), oc(oracle, "raw-nullish", tail)]);
519
+ }
520
+ }
521
+ }));
522
+ }));
523
+ }
524
+ }
525
+ {
526
+ const __eliscript_value_29 = 0;
527
+ {
528
+ let mode = __eliscript_value_29;
529
+ while (__eliscript_numeric_relation("<", mode, 3)) {
530
+ scalar(check, oracle, "effects", [mode]);
531
+ ((mode = (mode + 1)));
532
+ }
533
+ ((mode = 0));
534
+ while (__eliscript_numeric_relation("<", mode, 8)) {
535
+ scalar(check, oracle, "protocol", [mode]);
536
+ ((mode = (mode + 1)));
537
+ }
538
+ }
539
+ }
540
+ return check("js-cons own dense indices", ((s) => {
541
+ {
542
+ let sparse = new (globalThis.Array)(2);
543
+ let unused = ((sparse)[1] = undefined);
544
+ let out = __eliscript_at(s, "call")("prepend", (s)["box"]("head"), data(s, runtime, sparse));
545
+ let ref = oc(oracle, "prepend", "head", sparse);
546
+ return (assert)["deepStrictEqual"]([(s)["read"](out), (s)["value"]("own", out, (s)["box"]("0")), (s)["value"]("own", out, (s)["box"]("1")), (s)["value"]("own", out, (s)["box"]("2")), (s)["value"]("recover")], [ref, oc(oracle, "own", ref, "0"), oc(oracle, "own", ref, "1"), oc(oracle, "own", ref, "2"), oc(oracle, "recover")]);
547
+ }
548
+ }));
549
+ }
550
+ function run_primitive(check, oracle, runtime) {
551
+ {
552
+ const __eliscript_value_30 = [null, false, true, undefined, 0, -0.0, 1, -1, globalThis.NaN, globalThis.Infinity, globalThis.Number.MIN_VALUE, 0.5, "", "0", "-0", "1.5", " 0x10 ", "0b101", "0o77", "invalid", "中😀\ud800"];
553
+ const __eliscript_value_31 = "0xbcf8f9bdba22840724d028768a8a77b3e6b0f283670085477910eccc4e9d6b278a11db79c280d4e9c237774812029ac7ce82daaafca38";
554
+ {
555
+ let inputs = __eliscript_value_30;
556
+ let hex = __eliscript_value_31;
557
+ (inputs)["forEach"](((left) => {
558
+ (["negate", "reciprocal", "increment", "decrement", "signed", "unsigned", "invert", "identity-add", "identity-multiply"])["forEach"](((name) => {
559
+ return scalar(check, oracle, name, [left]);
560
+ }));
561
+ return (inputs)["forEach"](((right) => {
562
+ return (["add", "subtract", "multiply", "divide", "remainder", "mask", "union", "exclusive", "shift-left", "shift-right", "logical-right", "product-word", "equal", "less", "less-equal", "greater", "greater-equal"])["forEach"](((name) => {
563
+ return scalar(check, oracle, name, [left, right]);
564
+ }));
565
+ }));
566
+ }));
567
+ ([["1", 2, 3], [1, 2, "3"], [null, false, "x"], ["invalid", 1, 2], ["10", "2", 3], [-0.0, "0", null], [undefined, 1, "x"]])["forEach"](((values) => {
568
+ (["ordered-add", "ordered-subtract", "comparison-snapshot"])["forEach"](((name) => {
569
+ return scalar(check, oracle, name, values);
570
+ }));
571
+ return (["snapshot", "comparison-effects"])["forEach"](((name) => {
572
+ return scalar(check, oracle, name, (values)["slice"](0, 2));
573
+ }));
574
+ }));
575
+ (["identity-add", "identity-multiply"])["forEach"](((name) => {
576
+ return check("opaque identity", ((s) => {
577
+ {
578
+ const __eliscript_value_32 = (s)["object"](({}));
579
+ const __eliscript_value_33 = ({});
580
+ {
581
+ let raw = __eliscript_value_32;
582
+ let ref = __eliscript_value_33;
583
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")(name, raw), raw));
584
+ return (assert)["strictEqual"](oc(oracle, name, ref), ref);
585
+ }
586
+ }
587
+ }));
588
+ }));
589
+ (["subtract", "multiply", "divide", "remainder", "less", "less-equal", "greater", "greater-equal"])["forEach"](((name) => {
590
+ return scalar(check, oracle, name, [hex, globalThis.Number(globalThis.BigInt(hex))]);
591
+ }));
592
+ {
593
+ const __eliscript_value_34 = 1470339873;
594
+ const __eliscript_value_35 = new (globalThis.DataView)(new (globalThis.ArrayBuffer)(8));
595
+ const __eliscript_value_36 = 0;
596
+ {
597
+ let state = __eliscript_value_34;
598
+ let bits = __eliscript_value_35;
599
+ let index = __eliscript_value_36;
600
+ {
601
+ const __eliscript_value_37 = null;
602
+ {
603
+ let next = __eliscript_value_37;
604
+ (next = (() => {
605
+ ((state = __eliscript_numeric_xor(state, __eliscript_numeric_shl(state, 13))));
606
+ ((state = __eliscript_numeric_xor(state, __eliscript_numeric_ushr(state, 17))));
607
+ ((state = __eliscript_numeric_xor(state, __eliscript_numeric_shl(state, 5))));
608
+ return __eliscript_numeric_ushr(state, 0);
609
+ }));
610
+ while (__eliscript_numeric_relation("<", index, 512)) {
611
+ (bits)["setUint32"](0, next(), true);
612
+ (bits)["setUint32"](4, next(), true);
613
+ {
614
+ let input = (bits)["getFloat64"](0, true);
615
+ let text = globalThis.String(input);
616
+ (["add", "subtract", "multiply", "remainder", "less", "greater-equal"])["forEach"](((name) => {
617
+ return scalar(check, oracle, name, [text, input]);
618
+ }));
619
+ }
620
+ ((index = (index + 1)));
621
+ }
622
+ }
623
+ }
624
+ }
625
+ }
626
+ ([0, 1, 3, -0.0, globalThis.NaN, -1, 2.5, "3"])["forEach"](((count) => {
627
+ return ([-0.0, globalThis.NaN, globalThis.Infinity, 0.123, "0.123", hex])["forEach"](((seed) => {
628
+ return scalar(check, oracle, "scalar-loop", [count, seed]);
629
+ }));
630
+ }));
631
+ return check("source bigint", ((s) => {
632
+ {
633
+ const __eliscript_value_38 = (s)["box"](globalThis.BigInt(5));
634
+ const __eliscript_value_39 = (s)["box"](globalThis.BigInt(2));
635
+ {
636
+ let five = __eliscript_value_38;
637
+ let two = __eliscript_value_39;
638
+ return (assert)["deepStrictEqual"]([(s)["value"]("subtract", five, two), (s)["value"]("negate", five), (s)["value"]("shift-left", five, two), failure(s, runtime, (() => {
639
+ return __eliscript_at(s, "call")("subtract", five, (s)["box"](2));
640
+ })), failure(s, runtime, (() => {
641
+ return __eliscript_at(s, "call")("product-word", five, two);
642
+ }))], [oc(oracle, "subtract", globalThis.BigInt(5), globalThis.BigInt(2)), oc(oracle, "negate", globalThis.BigInt(5)), oc(oracle, "shift-left", globalThis.BigInt(5), globalThis.BigInt(2)), error_name((() => {
643
+ return oc(oracle, "subtract", globalThis.BigInt(5), 2);
644
+ })), error_name((() => {
645
+ return oc(oracle, "product-word", globalThis.BigInt(5), globalThis.BigInt(2));
646
+ }))]);
647
+ }
648
+ }
649
+ }));
650
+ }
651
+ }
652
+ }
653
+ function run_callables(check, oracle, runtime) {
654
+ check("escaping nested recursive closures", ((s) => {
655
+ {
656
+ const __eliscript_value_40 = null;
657
+ {
658
+ let source_callable = __eliscript_value_40;
659
+ (source_callable = ((name, ...args) => {
660
+ return closure(runtime, call(s, name, raw_args(s, args)));
661
+ }));
662
+ return (assert)["deepStrictEqual"]([(source_callable("make-adder", 4))(5), ((source_callable("nested", 4))(5))(6), (source_callable("recursive"))(24), (source_callable("outer-write", 4))(), (source_callable("shadow", 4))()], [(oc(oracle, "make-adder", 4))(5), ((oc(oracle, "nested", 4))(5))(6), (oc(oracle, "recursive"))(24), (oc(oracle, "outer-write", 4))(), (oc(oracle, "shadow", 4))()]);
663
+ }
664
+ }
665
+ }));
666
+ check("shared sibling cells", ((s) => {
667
+ {
668
+ let pair = __eliscript_at(s, "call")("make-pair", (s)["box"](4));
669
+ let ref = oc(oracle, "make-pair", 4);
670
+ let left = closure(runtime, (s)["get"](pair, 0));
671
+ let right = closure(runtime, (s)["get"](pair, 1));
672
+ let actual = [];
673
+ let expected = [];
674
+ let index = 0;
675
+ while (__eliscript_numeric_relation("<", index, 32)) {
676
+ (actual)["push"](left(), right());
677
+ (expected)["push"](((ref)[0])(), ((ref)[1])());
678
+ ((index = (index + 1)));
679
+ }
680
+ (assert)["strictEqual"]((s)["value"]("from-slot", pair), 37);
681
+ (assert)["strictEqual"](oc(oracle, "from-slot", ref), 37);
682
+ {
683
+ let functions = __eliscript_at(s, "call")("capture-each", (s)["box"](4));
684
+ let values = [];
685
+ let i = 0;
686
+ while (__eliscript_numeric_relation("<", i, (runtime)["length"](functions))) {
687
+ (values)["push"]((closure(runtime, (s)["get"](functions, i)))());
688
+ ((i = (i + 1)));
689
+ }
690
+ return (assert)["deepStrictEqual"]([actual, values, (s)["value"]("named-same"), (s)["value"]("fresh-same"), (s)["value"]("repeated-same")], [expected, (oc(oracle, "capture-each", 4))["map"](((fn) => {
691
+ return fn();
692
+ })), oc(oracle, "named-same"), oc(oracle, "fresh-same"), oc(oracle, "repeated-same")]);
693
+ }
694
+ }
695
+ }));
696
+ check("function identity", ((s) => {
697
+ {
698
+ const __eliscript_value_41 = __eliscript_at_direct(s, "call", "named-value");
699
+ {
700
+ let named = __eliscript_value_41;
701
+ (assert)["ok"]((s)["same"](named, __eliscript_at_direct(s, "call", "named-value")));
702
+ (assert)["ok"]((!__eliscript_truthy((s)["same"](__eliscript_at_direct(s, "call", "fresh-function"), __eliscript_at_direct(s, "call", "fresh-function")))));
703
+ (assert)["strictEqual"](oc(oracle, "named-value"), oc(oracle, "named-value"));
704
+ (assert)["notStrictEqual"](oc(oracle, "fresh-function"), oc(oracle, "fresh-function"));
705
+ return (assert)["deepStrictEqual"]([(s)["value"]("apply-one", named, (s)["box"](4)), (s)["value"]("from-slot", __eliscript_at(s, "call")("make-pair", (s)["box"](4))), (s)["value"]("callee-order")], [oc(oracle, "apply-one", oc(oracle, "named-value"), 4), oc(oracle, "from-slot", oc(oracle, "make-pair", 4)), oc(oracle, "callee-order")]);
706
+ }
707
+ }
708
+ }));
709
+ check("callee and argument order", ((s) => {
710
+ {
711
+ let marker = (s)["array"]([false]);
712
+ let ref = [false];
713
+ let actual_error = failure(s, runtime, (() => {
714
+ return __eliscript_at(s, "call")("invoke-order", false, marker);
715
+ }));
716
+ let ref_error = error_name((() => {
717
+ return oc(oracle, "invoke-order", false, ref);
718
+ }));
719
+ let before = (s)["read"](marker);
720
+ let ref_before = (ref)["slice"]();
721
+ return (assert)["deepStrictEqual"]([actual_error, before, (s)["value"]("apply-extra", __eliscript_at_direct(s, "call", "named-value"), marker), (s)["read"](marker)], [ref_error, ref_before, oc(oracle, "apply-extra", oc(oracle, "named-value"), ref), (ref)["slice"]()]);
722
+ }
723
+ }));
724
+ check("parallel and sequential captures", ((s) => {
725
+ {
726
+ let functions = __eliscript_at(s, "call")("sequential-captures", (s)["box"](4));
727
+ let values = [];
728
+ let index = 0;
729
+ while (__eliscript_numeric_relation("<", index, (runtime)["length"](functions))) {
730
+ (values)["push"]((closure(runtime, (s)["get"](functions, index)))());
731
+ ((index = (index + 1)));
732
+ }
733
+ return (assert)["deepStrictEqual"]([(closure(runtime, __eliscript_at(s, "call")("parallel-capture", (s)["box"](4))))(), values, (closure(runtime, call(s, "hygienic-capture", raw_args(s, [1, 2, 3, 4, 5]))))(), (s)["value"]("captured-arguments", (s)["box"](4))], [(oc(oracle, "parallel-capture", 4))(), (oc(oracle, "sequential-captures", 4))["map"](((fn) => {
734
+ return fn();
735
+ })), (oc(oracle, "hygienic-capture", 1, 2, 3, 4, 5))(), oc(oracle, "captured-arguments", 4)]);
736
+ }
737
+ }));
738
+ check("twelve arguments and discarded extras", ((s) => {
739
+ {
740
+ const __eliscript_value_42 = (s)["array"]([false]);
741
+ const __eliscript_value_43 = [false];
742
+ {
743
+ let marker = __eliscript_value_42;
744
+ let ref = __eliscript_value_43;
745
+ return (assert)["deepStrictEqual"]([value(s, "many", raw_args(s, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])), (s)["value"]("many-extra", __eliscript_at_direct(s, "call", "many-value"), marker), (s)["read"](marker), (s)["value"]("many-extra", __eliscript_at_direct(s, "call", "many-lambda"), marker)], [oc(oracle, "many", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), oc(oracle, "many-extra", oc(oracle, "many-value"), ref), (ref)["slice"](), oc(oracle, "many-extra", oc(oracle, "many-lambda"), ref)]);
746
+ }
747
+ }
748
+ }));
749
+ return check("funcall exact values", ((s) => {
750
+ {
751
+ const __eliscript_value_44 = (s)["array"]([false]);
752
+ const __eliscript_value_45 = [false];
753
+ {
754
+ let marker = __eliscript_value_44;
755
+ let ref = __eliscript_value_45;
756
+ return (assert)["deepStrictEqual"]([(s)["value"]("funcall-one", __eliscript_at_direct(s, "call", "named-value"), (s)["box"](-0.0)), (s)["value"]("funcall-order", (s)["export"]("ordered-values"), marker), (s)["read"](marker)], [oc(oracle, "funcall-one", oc(oracle, "named-value"), -0.0), oc(oracle, "funcall-order", (oracle)["ordered_values"], ref), ref]);
757
+ }
758
+ }
759
+ }));
760
+ }
761
+ function run_array_text(check, oracle, runtime) {
762
+ {
763
+ let shared = [1, null, "中😀\ud800"];
764
+ let samples = [[], new (globalThis.Array)(4), [null, undefined, false, true, -0.0, 0.5, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity), globalThis.Number.MIN_VALUE, "中😀\ud800"], [shared, shared]];
765
+ (samples)["forEach"](((input) => {
766
+ return ([undefined, null, false, -0.0, 0.5, "", ",", "😀\ud800"])["forEach"](((separator) => {
767
+ return check("join primitives and holes", ((s) => {
768
+ {
769
+ const __eliscript_value_46 = ((input === (samples)[3]) ? ((child) => {
770
+ return (s)["keep"]((runtime)["sourceArray"]([child, child]));
771
+ })(data(s, runtime, shared)) : data(s, runtime, input));
772
+ {
773
+ let raw = __eliscript_value_46;
774
+ return (assert)["strictEqual"]((s)["value"]("join-value", raw, (s)["box"](separator)), oc(oracle, "join-value", input, separator));
775
+ }
776
+ }
777
+ }));
778
+ }));
779
+ }));
780
+ }
781
+ ([undefined, null, false, -0.0, globalThis.NaN, globalThis.Number.MIN_VALUE, "中😀\ud800"])["forEach"](((input) => {
782
+ return (["custom-value", "fallback-value"])["forEach"](((factory) => {
783
+ return check("join conversion hooks", ((s) => {
784
+ {
785
+ let trace = (s)["object"](({}));
786
+ let ref = ({});
787
+ let item = __eliscript_at(s, "call")(factory, trace, (s)["box"](input));
788
+ let items = (s)["keep"]((runtime)["sourceArray"]([item]));
789
+ return (assert)["deepStrictEqual"]([(s)["value"]("default-value", items), (s)["read"](trace)], [oc(oracle, "default-value", [oc(oracle, factory, ref, input)]), ref]);
790
+ }
791
+ }));
792
+ }));
793
+ }));
794
+ ([["x"], []])["forEach"](((input) => {
795
+ return check(((((input) ?? []).length === 0) ? "empty separator conversion" : "separator length snapshot"), ((s) => {
796
+ {
797
+ const __eliscript_value_47 = data(s, runtime, input);
798
+ const __eliscript_value_48 = (s)["object"](({}));
799
+ const __eliscript_value_49 = (input)["slice"]();
800
+ const __eliscript_value_50 = ({});
801
+ {
802
+ let items = __eliscript_value_47;
803
+ let trace = __eliscript_value_48;
804
+ let ref = __eliscript_value_49;
805
+ let ref_trace = __eliscript_value_50;
806
+ return (assert)["deepStrictEqual"]([(s)["value"]("join-value", items, __eliscript_at(s, "call")("growing-separator", items, trace)), (s)["read"](items), (s)["read"](trace)], [oc(oracle, "join-value", ref, oc(oracle, "growing-separator", ref, ref_trace)), ref, ref_trace]);
807
+ }
808
+ }
809
+ }));
810
+ }));
811
+ check("live values", ((s) => {
812
+ {
813
+ const __eliscript_value_51 = (s)["array"]([null, "old"]);
814
+ const __eliscript_value_52 = [null, "old"];
815
+ {
816
+ let items = __eliscript_value_51;
817
+ let ref = __eliscript_value_52;
818
+ (runtime)["set"](items, 0, __eliscript_at(s, "call")("live-element", items));
819
+ ((ref)[0] = oc(oracle, "live-element", ref));
820
+ return (assert)["deepStrictEqual"]([(s)["value"]("join-value", items, (s)["box"]("|")), (s)["read"]((s)["get"](items, 1))], [oc(oracle, "join-value", ref, "|"), (ref)[1]]);
821
+ }
822
+ }
823
+ }));
824
+ check("shrinking values", ((s) => {
825
+ {
826
+ const __eliscript_value_53 = (s)["array"]([null, null, null]);
827
+ const __eliscript_value_54 = [null, null, null];
828
+ {
829
+ let items = __eliscript_value_53;
830
+ let ref = __eliscript_value_54;
831
+ (runtime)["set"](items, 0, __eliscript_at(s, "call")("shrinking-element", items));
832
+ ((ref)[0] = oc(oracle, "shrinking-element", ref));
833
+ return (assert)["deepStrictEqual"]([(s)["value"]("join-value", items, (s)["box"]("|")), (runtime)["length"](items)], [oc(oracle, "join-value", ref, "|"), ((ref) ?? []).length]);
834
+ }
835
+ }
836
+ }));
837
+ check("custom result identity", ((s) => {
838
+ {
839
+ const __eliscript_value_55 = (s)["object"](({}));
840
+ const __eliscript_value_56 = (s)["object"](({}));
841
+ const __eliscript_value_57 = (s)["array"]([]);
842
+ const __eliscript_value_58 = ({});
843
+ const __eliscript_value_59 = ({});
844
+ {
845
+ let input = __eliscript_value_55;
846
+ let trace = __eliscript_value_56;
847
+ let items = __eliscript_value_57;
848
+ let ref = __eliscript_value_58;
849
+ let ref_trace = __eliscript_value_59;
850
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("text-order", items, input, trace), input));
851
+ (assert)["ok"]((s)["same"](__eliscript_at(s, "call")("text-value", __eliscript_at(s, "call")("own-join", items, input)), input));
852
+ (assert)["strictEqual"](oc(oracle, "text-order", [], ref, ref_trace), ref);
853
+ (assert)["strictEqual"](oc(oracle, "text-value", oc(oracle, "own-join", [], ref)), ref);
854
+ return (assert)["deepStrictEqual"]((s)["read"](trace), ref_trace);
855
+ }
856
+ }
857
+ }));
858
+ check("reentrant cycle recovery", ((s) => {
859
+ {
860
+ const __eliscript_value_60 = (s)["array"]([null]);
861
+ const __eliscript_value_61 = (s)["object"](({}));
862
+ const __eliscript_value_62 = [null];
863
+ const __eliscript_value_63 = ({});
864
+ {
865
+ let items = __eliscript_value_60;
866
+ let trace = __eliscript_value_61;
867
+ let ref = __eliscript_value_62;
868
+ let ref_trace = __eliscript_value_63;
869
+ (runtime)["set"](items, 0, __eliscript_at(s, "call")("reentrant-element", items, trace));
870
+ ((ref)[0] = oc(oracle, "reentrant-element", ref, ref_trace));
871
+ {
872
+ const __eliscript_value_64 = failure(s, runtime, (() => {
873
+ return __eliscript_at(s, "call")("default-value", items);
874
+ }));
875
+ const __eliscript_value_65 = error_name((() => {
876
+ return oc(oracle, "default-value", ref);
877
+ }));
878
+ {
879
+ let actual = __eliscript_value_64;
880
+ let expected = __eliscript_value_65;
881
+ (runtime)["resize"](items, 0);
882
+ ((ref)["length"] = 0);
883
+ return (assert)["deepStrictEqual"]([actual, (s)["value"]("default-value", items)], [expected, oc(oracle, "default-value", ref)]);
884
+ }
885
+ }
886
+ }
887
+ }
888
+ }));
889
+ check("selected cyclic join error", ((s) => {
890
+ {
891
+ const __eliscript_value_66 = (s)["array"]([1]);
892
+ const __eliscript_value_67 = [1];
893
+ {
894
+ let items = __eliscript_value_66;
895
+ let ref = __eliscript_value_67;
896
+ (runtime)["resize"](items, 3);
897
+ (runtime)["set"](items, 1, items);
898
+ (runtime)["set"](items, 2, (s)["box"](3));
899
+ (ref)["push"](ref, 3);
900
+ return (assert)["strictEqual"](failure(s, runtime, (() => {
901
+ return __eliscript_at(s, "call")("join-value", items, (s)["box"](":"));
902
+ })), error_name((() => {
903
+ return oc(oracle, "join-value", ref, ":");
904
+ })));
905
+ }
906
+ }
907
+ }));
908
+ return check("ignored arguments", ((s) => {
909
+ {
910
+ const __eliscript_value_68 = (s)["object"](({}));
911
+ const __eliscript_value_69 = ({});
912
+ {
913
+ let trace = __eliscript_value_68;
914
+ let ref = __eliscript_value_69;
915
+ return (assert)["deepStrictEqual"]([(s)["value"]("extra-value", (s)["array"]([1, 2]), (s)["box"](":"), trace), (s)["read"](trace)], [oc(oracle, "extra-value", [1, 2], ":", ref), ref]);
916
+ }
917
+ }
918
+ }));
919
+ }
920
+ function run_strings(check, oracle, runtime) {
921
+ {
922
+ const __eliscript_value_70 = ["", "x", "a\u0000b", "中😀\ud800x\udfff", "ababa", "😀", "\ud83dx\ude00"];
923
+ const __eliscript_value_71 = [null, false, true, undefined, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity), 0, -0.0, 0.5, -0.5, 1, -1, 3.5, -3.5, globalThis.Number.MIN_VALUE, __eliscript_numeric_neg(globalThis.Number.MIN_VALUE), globalThis.Number.MAX_VALUE, __eliscript_numeric_neg(globalThis.Number.MAX_VALUE), 4294967295, 4294967296];
924
+ {
925
+ let texts = __eliscript_value_70;
926
+ let positions = __eliscript_value_71;
927
+ (texts)["forEach"](((text) => {
928
+ (["size", "identity", "value", "trim", "trim-start", "trim-end", "well-formed", "repair", "scan", "concat-empty", "char-empty", "at-empty", "slice-empty", "substring-empty", "substr-empty", "find-empty", "repeat-empty"])["forEach"](((name) => {
929
+ return scalar(check, oracle, name, [text]);
930
+ }));
931
+ ([0, -0.0, 1, 2, 99, -1, 0.5, globalThis.NaN, globalThis.Infinity, "0", "1", "01", "", "length"])["forEach"](((key) => {
932
+ return (["read-value", "default-value"])["forEach"](((name) => {
933
+ return scalar(check, oracle, name, ((name === "default-value") ? [text, key, "fallback"] : [text, key]));
934
+ }));
935
+ }));
936
+ (["0", "1", "length"])["forEach"](((key) => {
937
+ return scalar(check, oracle, "nth-value", [key, text]);
938
+ }));
939
+ (positions)["forEach"](((position) => {
940
+ return (["at", "char-at", "char-code", "code-point"])["forEach"](((name) => {
941
+ return scalar(check, oracle, name, [text, position]);
942
+ }));
943
+ }));
944
+ (positions)["forEach"](((start) => {
945
+ return (positions)["forEach"](((end) => {
946
+ return (["slice", "substring", "substr"])["forEach"](((name) => {
947
+ return scalar(check, oracle, name, [text, start, end]);
948
+ }));
949
+ }));
950
+ }));
951
+ (["", "x", "a", "aba", "\u0000", "😀", "\ud800", null, false, true, undefined, 0, -0.0, -1, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity)])["forEach"](((search) => {
952
+ return (positions)["forEach"](((position) => {
953
+ return (["find", "last", "includes", "starts", "ends"])["forEach"](((name) => {
954
+ return scalar(check, oracle, name, [text, search, position]);
955
+ }));
956
+ }));
957
+ }));
958
+ ([null, false, true, undefined, globalThis.NaN, -0.0, -0.5, 0, 0.5, 1, 3.5])["forEach"](((count) => {
959
+ return scalar(check, oracle, "repeat", [text, count]);
960
+ }));
961
+ ([null, false, true, undefined, 0, -0.0, 4294967295, -1, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity), "中😀"])["forEach"](((input) => {
962
+ return scalar(check, oracle, "concat", [text, input, "!", input]);
963
+ }));
964
+ check("ignored string arguments", ((s) => {
965
+ {
966
+ const __eliscript_value_72 = (s)["object"](({}));
967
+ const __eliscript_value_73 = ({});
968
+ {
969
+ let trace = __eliscript_value_72;
970
+ let ref = __eliscript_value_73;
971
+ return (assert)["deepStrictEqual"]([(s)["value"]("ignored", (s)["box"](text), trace), (s)["read"](trace), (s)["value"]("ignored-identity", (s)["box"](text), (s)["object"](({})))], [oc(oracle, "ignored", text, ref), ref, oc(oracle, "ignored-identity", text, ({}))]);
972
+ }
973
+ }
974
+ }));
975
+ return check("constructor and receiver capture", ((s) => {
976
+ return (assert)["deepStrictEqual"]([value(s, "capture", raw_args(s, [text, 1, "xy"])), value(s, "concat-capture", raw_args(s, [text, 1, 2])), value(s, "default-order", raw_args(s, [text, 0]))], [oc(oracle, "capture", text, 1, "xy"), oc(oracle, "concat-capture", text, 1, 2), oc(oracle, "default-order", text, 0)]);
977
+ }));
978
+ }));
979
+ ([[0, 65, 65535], [-0.0, 55296, 56320], [128512, 128513, 65], [globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity)], ["65", null, true]])["forEach"](((values) => {
980
+ scalar(check, oracle, "from-units", values);
981
+ return check("fromCodePoint", ((s) => {
982
+ {
983
+ const __eliscript_value_74 = undefined;
984
+ const __eliscript_value_75 = undefined;
985
+ {
986
+ let actual = __eliscript_value_74;
987
+ let expected = __eliscript_value_75;
988
+ (assert)["strictEqual"](failure(s, runtime, (() => {
989
+ return ((actual = value(s, "from-points", raw_args(s, values))));
990
+ })), error_name((() => {
991
+ return ((expected = __eliscript_at(Reflect, "apply")((oracle)["from_points"], oracle, values)));
992
+ })));
993
+ return (assert)["deepStrictEqual"](actual, expected);
994
+ }
995
+ }
996
+ }));
997
+ }));
998
+ ([-1, -0.0, 0, 65, 55296, 65535, 65536, 128512, 1114111, 1114112, 1.5, globalThis.NaN, globalThis.Infinity, __eliscript_numeric_neg(globalThis.Infinity)])["forEach"](((input) => {
999
+ return check("single character constructors", ((s) => {
1000
+ {
1001
+ const __eliscript_value_76 = (s)["box"](input);
1002
+ {
1003
+ let raw = __eliscript_value_76;
1004
+ (assert)["deepStrictEqual"]([(s)["value"]("from-unit", raw), (s)["value"]("global-unit", raw), (s)["value"]("constructor-capture", raw)], [oc(oracle, "from-unit", input), oc(oracle, "global-unit", input), oc(oracle, "constructor-capture", input)]);
1005
+ return (["from-point", "global-point"])["forEach"](((name) => {
1006
+ {
1007
+ const __eliscript_value_77 = undefined;
1008
+ const __eliscript_value_78 = undefined;
1009
+ {
1010
+ let actual = __eliscript_value_77;
1011
+ let expected = __eliscript_value_78;
1012
+ (assert)["strictEqual"](failure(s, runtime, (() => {
1013
+ return ((actual = (s)["value"](name, raw)));
1014
+ })), error_name((() => {
1015
+ return ((expected = oc(oracle, name, input)));
1016
+ })));
1017
+ return (assert)["deepStrictEqual"](actual, expected);
1018
+ }
1019
+ }
1020
+ }));
1021
+ }
1022
+ }
1023
+ }));
1024
+ }));
1025
+ check("empty character constructors", ((s) => {
1026
+ return (assert)["deepStrictEqual"]([(s)["value"]("empty-units"), (s)["value"]("empty-points")], [oc(oracle, "empty-units"), oc(oracle, "empty-points")]);
1027
+ }));
1028
+ check("constructor effects", ((s) => {
1029
+ {
1030
+ const __eliscript_value_79 = (s)["object"](({}));
1031
+ const __eliscript_value_80 = ({});
1032
+ {
1033
+ let trace = __eliscript_value_79;
1034
+ let ref = __eliscript_value_80;
1035
+ return (assert)["deepStrictEqual"]([(s)["value"]("constructor-effects", (s)["box"](65), trace), (s)["read"](trace)], [oc(oracle, "constructor-effects", 65, ref), ref]);
1036
+ }
1037
+ }
1038
+ }));
1039
+ check("format split callback", ((s) => {
1040
+ return (assert)["deepStrictEqual"]([value(s, "format-symbol", raw_args(s, ["HELLO-WORLD", 255])), (s)["value"]("split-fields", (s)["box"]("a,b; c d")), (s)["value"]("replace-callback", (s)["box"]("a中a"))], [oc(oracle, "format-symbol", "HELLO-WORLD", 255), oc(oracle, "split-fields", "a,b; c d"), oc(oracle, "replace-callback", "a中a")]);
1041
+ }));
1042
+ {
1043
+ const __eliscript_value_81 = 139443610;
1044
+ const __eliscript_value_82 = new (globalThis.DataView)(new (globalThis.ArrayBuffer)(8));
1045
+ const __eliscript_value_83 = 0;
1046
+ {
1047
+ let state = __eliscript_value_81;
1048
+ let bits = __eliscript_value_82;
1049
+ let index = __eliscript_value_83;
1050
+ {
1051
+ const __eliscript_value_84 = null;
1052
+ {
1053
+ let next = __eliscript_value_84;
1054
+ (next = (() => {
1055
+ ((state = __eliscript_numeric_xor(state, __eliscript_numeric_shl(state, 13))));
1056
+ ((state = __eliscript_numeric_xor(state, __eliscript_numeric_ushr(state, 17))));
1057
+ ((state = __eliscript_numeric_xor(state, __eliscript_numeric_shl(state, 5))));
1058
+ return __eliscript_numeric_ushr(state, 0);
1059
+ }));
1060
+ while (__eliscript_numeric_relation("<", index, 1024)) {
1061
+ {
1062
+ let count = __eliscript_numeric_rem(next(), 64);
1063
+ let units = [];
1064
+ let i = 0;
1065
+ while (__eliscript_numeric_relation("<", i, count)) {
1066
+ (units)["push"](__eliscript_numeric_rem(next(), 65536));
1067
+ ((i = (i + 1)));
1068
+ }
1069
+ {
1070
+ let text = __eliscript_at(Reflect, "apply")(globalThis.String.fromCharCode, undefined, units);
1071
+ let needle = (((__eliscript_value_85, __eliscript_value_86) => (__eliscript_value_85 !== __eliscript_value_86))(__eliscript_numeric_rem(index, 3), 0) ? (text)["slice"](__eliscript_numeric_rem(next(), (((text) ?? []).length + 1)), __eliscript_numeric_rem(next(), (((text) ?? []).length + 1))) : globalThis.String.fromCharCode(__eliscript_numeric_rem(next(), 65536)));
1072
+ (bits)["setUint32"](0, next(), true);
1073
+ (bits)["setUint32"](4, next(), true);
1074
+ {
1075
+ const __eliscript_value_87 = (bits)["getFloat64"](0, true);
1076
+ {
1077
+ let position = __eliscript_value_87;
1078
+ (["at", "char-at", "char-code", "code-point"])["forEach"](((name) => {
1079
+ return scalar(check, oracle, name, [text, position]);
1080
+ }));
1081
+ (["find", "last", "includes", "starts", "ends"])["forEach"](((name) => {
1082
+ return scalar(check, oracle, name, [text, needle, position]);
1083
+ }));
1084
+ (["slice", "substring", "substr"])["forEach"](((name) => {
1085
+ return scalar(check, oracle, name, [text, position, __eliscript_numeric_sub(__eliscript_numeric_rem(next(), 65), 32)]);
1086
+ }));
1087
+ (["well-formed", "repair"])["forEach"](((name) => {
1088
+ return scalar(check, oracle, name, [text]);
1089
+ }));
1090
+ }
1091
+ }
1092
+ }
1093
+ }
1094
+ ((index = (index + 1)));
1095
+ }
1096
+ return null;
1097
+ }
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+ }
1103
+ }
1104
+ function loadOriginalRawLanguageModels(input) {
1105
+ {
1106
+ let source = (input)["source"];
1107
+ let digest = ((createHash("sha256"))["update"](source))["digest"]("hex");
1108
+ let start = (source)["indexOf"]("const valid =");
1109
+ let end = (source)["indexOf"]("test(", start);
1110
+ if ((!((digest === (input)["sourceSha256"]) && __eliscript_numeric_relation(">=", start, 0) && __eliscript_numeric_relation(">", end, start) && ((source)["indexOf"]("const valid =", (start + 1)) === -1)))) {
1111
+ ((__eliscript_value_88) => { throw __eliscript_value_88; })(new (globalThis.TypeError)("original JSON fixture model source differs from authenticated suite"));
1112
+ }
1113
+ {
1114
+ let program = compile_ir_string("(js-object :valid (js* \"valid\") :invalid (js* \"invalid\"))", "original-json-models.eli");
1115
+ let expression = (emit_expression(((((program)["body"])[0])["children"])[0]))["text"];
1116
+ return runInNewContext((String((source)["slice"](start, end)) + String("\n(") + String(expression) + String(")")), ({}));
1117
+ }
1118
+ }
1119
+ }
1120
+ function run_json(check, oracle, runtime, models) {
1121
+ ((models)["valid"])["forEach"](((text) => {
1122
+ return scalar(check, oracle, "canonical-value", [text]);
1123
+ }));
1124
+ ((models)["invalid"])["forEach"](((text) => {
1125
+ return check("invalid JSON and effects", ((s) => {
1126
+ {
1127
+ const __eliscript_value_89 = (s)["object"](({}));
1128
+ const __eliscript_value_90 = ({});
1129
+ {
1130
+ let trace = __eliscript_value_89;
1131
+ let ref = __eliscript_value_90;
1132
+ return (assert)["deepStrictEqual"]([failure(s, runtime, (() => {
1133
+ return __eliscript_at(s, "call")("parse-extra", (s)["box"](text), trace);
1134
+ })), (s)["read"](trace)], [error_name((() => {
1135
+ return oc(oracle, "parse-extra", text, ref);
1136
+ })), ref]);
1137
+ }
1138
+ }
1139
+ }));
1140
+ }));
1141
+ check("JSON omission and sparse arrays", ((s) => {
1142
+ {
1143
+ let items = [undefined, globalThis.NaN, "中😀\ud800\u0000\n\"\\", -0.0];
1144
+ let unused = ((items)["length"] = 6);
1145
+ let input = Object.fromEntries([["2", "中😀\ud800\u0000\n\"\\"], ["b", items], ["a", undefined], ["nan", globalThis.NaN], ["zero", -0.0]]);
1146
+ let raw = data(s, runtime, input);
1147
+ return (assert)["deepStrictEqual"]([(s)["value"]("stringify-value", raw), (s)["value"]("pretty-value", raw, (s)["box"](2)), (s)["value"]("select-value", raw, (s)["array"](["b", "nan", "b"]), (s)["box"]("😀abcdefghijk")), (s)["value"]("stringify-value", undefined), (s)["value"]("same-parser")], [oc(oracle, "stringify-value", input), oc(oracle, "pretty-value", input, 2), oc(oracle, "select-value", input, ["b", "nan", "b"], "😀abcdefghijk"), oc(oracle, "stringify-value", undefined), oc(oracle, "same-parser")]);
1148
+ }
1149
+ }));
1150
+ (["-0", "-1e-9999", "5e-324", "2.2250738585072014e-308", "1.7976931348623157e308", "1e9999", "9007199254740993"])["forEach"](((text) => {
1151
+ return scalar(check, oracle, "parse-value", [text]);
1152
+ }));
1153
+ (["", "x", "\ud800", "123456789😀", "😀abcdefghijk", -0.0, __eliscript_numeric_neg(globalThis.Infinity), globalThis.Infinity, globalThis.NaN, -2, 1.9, 12])["forEach"](((space) => {
1154
+ return check("JSON indentation", ((s) => {
1155
+ return (assert)["strictEqual"]((s)["value"]("pretty-value", (s)["object"](({"a": 1})), (s)["box"](space)), oc(oracle, "pretty-value", ({"a": 1}), space));
1156
+ }));
1157
+ }));
1158
+ {
1159
+ const __eliscript_value_91 = 1762688499;
1160
+ const __eliscript_value_92 = ["", "中😀", "\ud800", "\udc00", "\u0000\b\n", "\"\\/
", "__proto__"];
1161
+ const __eliscript_value_93 = 0;
1162
+ {
1163
+ let seed = __eliscript_value_91;
1164
+ let texts = __eliscript_value_92;
1165
+ let index = __eliscript_value_93;
1166
+ {
1167
+ const __eliscript_value_94 = null;
1168
+ const __eliscript_value_95 = null;
1169
+ {
1170
+ let next = __eliscript_value_94;
1171
+ let tree = __eliscript_value_95;
1172
+ (next = (() => {
1173
+ ((seed = __eliscript_numeric_ushr((Math.imul(seed, 1664525) + 1013904223), 0)));
1174
+ return seed;
1175
+ }));
1176
+ (tree = ((depth) => {
1177
+ {
1178
+ const __eliscript_value_96 = __eliscript_numeric_rem(next(), (__eliscript_numeric_relation(">", depth, 0) ? 7 : 5));
1179
+ {
1180
+ let choice = __eliscript_value_96;
1181
+ if ((choice === 0)) {
1182
+ return null;
1183
+ } else {
1184
+ if ((choice === 1)) {
1185
+ return ((__eliscript_value_97, __eliscript_value_98) => (__eliscript_value_97 !== __eliscript_value_98))(__eliscript_numeric_and(next(), 1), 0);
1186
+ } else {
1187
+ if ((choice === 2)) {
1188
+ return (texts)[__eliscript_numeric_rem(next(), ((texts) ?? []).length)];
1189
+ } else {
1190
+ if (__eliscript_numeric_relation("<", choice, 5)) {
1191
+ return __eliscript_numeric_mul(__eliscript_numeric_sub(next(), 2147483648), Math.pow(10, __eliscript_numeric_sub(__eliscript_numeric_rem(next(), 601), 300)));
1192
+ } else {
1193
+ if ((choice === 5)) {
1194
+ {
1195
+ const __eliscript_value_99 = __eliscript_numeric_rem(next(), 4);
1196
+ const __eliscript_value_100 = [];
1197
+ const __eliscript_value_101 = 0;
1198
+ {
1199
+ let count = __eliscript_value_99;
1200
+ let out = __eliscript_value_100;
1201
+ let i = __eliscript_value_101;
1202
+ while (__eliscript_numeric_relation("<", i, count)) {
1203
+ (out)["push"](tree(__eliscript_numeric_decrement(depth)));
1204
+ ((i = (i + 1)));
1205
+ }
1206
+ return out;
1207
+ }
1208
+ }
1209
+ } else {
1210
+ {
1211
+ const __eliscript_value_102 = __eliscript_numeric_rem(next(), 4);
1212
+ const __eliscript_value_103 = [];
1213
+ {
1214
+ let count = __eliscript_value_102;
1215
+ let entries = __eliscript_value_103;
1216
+ while (__eliscript_numeric_relation(">", count, 0)) {
1217
+ (entries)["push"]([(["a", "2", "1", "__proto__", ""])[__eliscript_numeric_rem(next(), 5)], tree(__eliscript_numeric_decrement(depth))]);
1218
+ ((count = __eliscript_numeric_decrement(count)));
1219
+ }
1220
+ return Object.fromEntries(entries);
1221
+ }
1222
+ }
1223
+ }
1224
+ }
1225
+ }
1226
+ }
1227
+ }
1228
+ }
1229
+ }
1230
+ }));
1231
+ while (__eliscript_numeric_relation("<", index, 256)) {
1232
+ {
1233
+ const __eliscript_value_104 = JSON.stringify(tree(4));
1234
+ {
1235
+ let text = __eliscript_value_104;
1236
+ check("seeded JSON tree", ((s) => {
1237
+ return (assert)["deepStrictEqual"]([(s)["value"]("canonical-value", (s)["box"](text)), failure(s, runtime, (() => {
1238
+ return __eliscript_at(s, "call")("parse-value", (s)["box"]((String(text) + String("#"))));
1239
+ }))], [oc(oracle, "canonical-value", text), error_name((() => {
1240
+ return oc(oracle, "parse-value", (String(text) + String("#")));
1241
+ }))]);
1242
+ }));
1243
+ }
1244
+ }
1245
+ ((index = (index + 1)));
1246
+ }
1247
+ }
1248
+ }
1249
+ }
1250
+ }
1251
+ check("JSON cycles and repeated aliases", ((s) => {
1252
+ {
1253
+ let shared = (s)["object"](({"a": 1}));
1254
+ let cycle = (s)["object"](({}));
1255
+ let items = (s)["keep"]((runtime)["sourceArray"]([shared, shared]));
1256
+ let ref = ({"a": 1});
1257
+ let ref_cycle = ({});
1258
+ (runtime)["objectSet"](cycle, (s)["box"]("self"), cycle);
1259
+ ((ref_cycle)["self"] = ref_cycle);
1260
+ return (assert)["deepStrictEqual"]([(s)["value"]("stringify-value", items), failure(s, runtime, (() => {
1261
+ return __eliscript_at(s, "call")("stringify-value", cycle);
1262
+ }))], [oc(oracle, "stringify-value", [ref, ref]), error_name((() => {
1263
+ return oc(oracle, "stringify-value", ref_cycle);
1264
+ }))]);
1265
+ }
1266
+ }));
1267
+ return check("JSON proto own descriptor", ((s) => {
1268
+ {
1269
+ let object = __eliscript_at(s, "call")("parse-value", (s)["box"]("{\"__proto__\":7}"));
1270
+ let ref = oc(oracle, "parse-value", "{\"__proto__\":7}");
1271
+ (assert)["ok"]((s)["value"]("own-value", object, (s)["box"]("__proto__")));
1272
+ (assert)["ok"](oc(oracle, "own-value", ref, "__proto__"));
1273
+ return (assert)["deepStrictEqual"]([(s)["value"]("key-value", object, (s)["box"]("__proto__")), (s)["read"]((s)["keep"]((runtime)["objectKeys"](object)))], [oc(oracle, "key-value", ref, "__proto__"), Object.keys(ref)]);
1274
+ }
1275
+ }));
1276
+ }
1277
+ function runOriginalRawLanguageFixtureHost(configuration) {
1278
+ {
1279
+ let family = (configuration)["family"];
1280
+ let plan = ((__eliscript_tdz_read_0()))["find"](((item) => {
1281
+ return ((item)["family"] === family);
1282
+ }));
1283
+ let runtime = (configuration)["runtime"];
1284
+ let oracle = (configuration)["oracle"];
1285
+ let observations = 0;
1286
+ let groups = Object.create(null);
1287
+ if ((!__eliscript_truthy(plan))) {
1288
+ ((__eliscript_value_105) => { throw __eliscript_value_105; })(new (globalThis.TypeError)("unknown original raw language fixture family"));
1289
+ }
1290
+ {
1291
+ const __eliscript_value_106 = null;
1292
+ {
1293
+ let check = __eliscript_value_106;
1294
+ (check = ((label, body) => {
1295
+ {
1296
+ const __eliscript_value_107 = raw_scope(runtime, family);
1297
+ const __eliscript_value_108 = false;
1298
+ {
1299
+ let scope = __eliscript_value_107;
1300
+ let failed = __eliscript_value_108;
1301
+ return (() => {
1302
+ try {
1303
+ body(scope);
1304
+ ((observations = (observations + 1)));
1305
+ return ((groups)[label] = (((__eliscript_value_109) => (__eliscript_truthy(__eliscript_value_109) ? __eliscript_value_109 : 0))((groups)[label]) + 1));
1306
+ } catch (error) {
1307
+ ((failed = true));
1308
+ if (((!(error == null)) && ((((__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; } })(error) === "object") || (((__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; } })(error) === "function")))) {
1309
+ (() => {
1310
+ try {
1311
+ if (__eliscript_truthy(((__eliscript_value_110) => (__eliscript_truthy(__eliscript_value_110) ? (!__eliscript_truthy(Object.hasOwn(error, "originalRawFixture"))) : __eliscript_value_110))(Object.isExtensible(error)))) {
1312
+ return Object.defineProperty(error, "originalRawFixture", ({"configurable": true, "value": Object.freeze(({"family": family, "label": label, "completedObservations": observations}))}));
1313
+ } else {
1314
+ return null;
1315
+ }
1316
+ } catch (ignored) {
1317
+ return null;
1318
+ }
1319
+ })();
1320
+ }
1321
+ return ((__eliscript_value_111) => { throw __eliscript_value_111; })(error);
1322
+ } finally {
1323
+ (() => {
1324
+ try {
1325
+ return (scope)["close"]();
1326
+ } catch (error) {
1327
+ if ((!__eliscript_truthy(failed))) {
1328
+ return ((__eliscript_value_112) => { throw __eliscript_value_112; })(error);
1329
+ } else {
1330
+ return null;
1331
+ }
1332
+ }
1333
+ })();
1334
+ }
1335
+ })();
1336
+ }
1337
+ }
1338
+ }));
1339
+ if ((family === "empty-bindings")) {
1340
+ run_empty(check, oracle, runtime);
1341
+ } else {
1342
+ if ((family === "exceptions")) {
1343
+ run_exceptions(check, oracle, runtime);
1344
+ } else {
1345
+ if ((family === "catch-destructuring")) {
1346
+ run_catch(check, oracle, runtime);
1347
+ } else {
1348
+ if ((family === "builtins")) {
1349
+ run_builtins(check, oracle, runtime);
1350
+ } else {
1351
+ if ((family === "typeof")) {
1352
+ run_typeof(check, oracle, runtime);
1353
+ } else {
1354
+ if ((family === "array-text")) {
1355
+ run_array_text(check, oracle, runtime);
1356
+ } else {
1357
+ if ((family === "strings")) {
1358
+ run_strings(check, oracle, runtime);
1359
+ } else {
1360
+ if ((family === "callables")) {
1361
+ run_callables(check, oracle, runtime);
1362
+ } else {
1363
+ if ((family === "primitive-operators")) {
1364
+ run_primitive(check, oracle, runtime);
1365
+ } else {
1366
+ if ((family === "js-cons")) {
1367
+ run_cons(check, oracle, runtime);
1368
+ } else {
1369
+ if ((family === "json")) {
1370
+ run_json(check, oracle, runtime, ((__eliscript_value_113) => (__eliscript_truthy(__eliscript_value_113) ? __eliscript_value_113 : loadOriginalRawLanguageModels(configuration)))((configuration)["models"]));
1371
+ } else {
1372
+
1373
+ }
1374
+ }
1375
+ }
1376
+ }
1377
+ }
1378
+ }
1379
+ }
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ return ({"observations": observations, "groups": groups, "hostOnlyGroups": (plan)["hostOnlyGroups"]});
1385
+ }
1386
+ }
1387
+ }
1388
+ }
1389
+ function finishOriginalFixtureObservation(configuration, observations, groups) {
1390
+ {
1391
+ let family = (configuration)["family"];
1392
+ let portable = observations;
1393
+ let excluded = [];
1394
+ let context = readOriginalCorpusExecutionContext(((globalThis.process)["env"])["ELISCRIPT_ORIGINAL_EXECUTION_CONTEXT"]);
1395
+ let directory = (context)["directory"];
1396
+ if ((!__eliscript_truthy(((__eliscript_value_114) => (__eliscript_truthy(__eliscript_value_114) ? ((__eliscript_value_115) => (__eliscript_truthy(__eliscript_value_115) ? ((__eliscript_value_116) => (__eliscript_truthy(__eliscript_value_116) ? ((__eliscript_value_117) => (__eliscript_truthy(__eliscript_value_117) ? ((__eliscript_value_118) => (__eliscript_truthy(__eliscript_value_118) ? ((__eliscript_value_119) => (__eliscript_truthy(__eliscript_value_119) ? ((__eliscript_value_120) => (__eliscript_truthy(__eliscript_value_120) ? ((__eliscript_value_121) => (__eliscript_truthy(__eliscript_value_121) ? ((__eliscript_value_122) => (__eliscript_truthy(__eliscript_value_122) ? (Object.values(groups))["every"](((count) => {
1397
+ return ((__eliscript_value_123) => (__eliscript_truthy(__eliscript_value_123) ? __eliscript_numeric_relation(">=", count, 0) : __eliscript_value_123))(Number.isInteger(count));
1398
+ })) : __eliscript_value_122))((!(groups == null))) : __eliscript_value_121))((((__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; } })(groups) === "object")) : __eliscript_value_120))(__eliscript_numeric_relation(">", ((directory) ?? []).length, 0)) : __eliscript_value_119))((((__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; } })(directory) === "string")) : __eliscript_value_118))((new (globalThis.RegExp)("^[0-9a-f]{64}$"))["test"]((configuration)["originalHostSha256"])) : __eliscript_value_117))(__eliscript_numeric_relation(">", ((Object.keys((context)["sourceIdentity"])) ?? []).length, 0)) : __eliscript_value_116))((!((context)["sourceIdentity"] == null))) : __eliscript_value_115))((((__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; } })((context)["sourceIdentity"]) === "object")) : __eliscript_value_114))((["javascript", "wasm", "native"])["includes"]((context)["target"]))))) {
1399
+ ((__eliscript_value_124) => { throw __eliscript_value_124; })(new (globalThis.TypeError)("original fixture receipt requires actual target source identity and integral group counts"));
1400
+ }
1401
+ if ((!__eliscript_truthy(((__eliscript_value_125) => (__eliscript_truthy(__eliscript_value_125) ? (__eliscript_numeric_relation(">", observations, 0) && (observations === ((Object.values(groups))["reduce"](((total, count) => {
1402
+ return (total + count);
1403
+ }), 0) + ((family === "primitive-operators") ? 8 : 0)))) : __eliscript_value_125))(Number.isInteger(observations))))) {
1404
+ ((__eliscript_value_126) => { throw __eliscript_value_126; })(new (globalThis.TypeError)("original fixture complete observation count differs from actual compare calls"));
1405
+ }
1406
+ {
1407
+ const __eliscript_value_127 = null;
1408
+ {
1409
+ let exclude = __eliscript_value_127;
1410
+ (exclude = ((label, original_count, count, boundary) => {
1411
+ if ((!((groups)[label] === original_count))) {
1412
+ ((__eliscript_value_128) => { throw __eliscript_value_128; })(new (globalThis.TypeError)((String("original fixture group count changed: ") + String(family) + String("/") + String(label))));
1413
+ }
1414
+ ((portable = __eliscript_numeric_sub(portable, count)));
1415
+ return (excluded)["push"](({"label": label, "actualOriginalCalls": original_count, "hostOnlyCalls": count, "boundary": boundary}));
1416
+ }));
1417
+ if ((family === "catch-destructuring")) {
1418
+ exclude("iterator destructuring", 5, 1, "external Set iterator is not a zero-import source input");
1419
+ } else {
1420
+ if ((family === "typeof")) {
1421
+ exclude("typeof and captured member", 16, 1, "arbitrary host function requires explicit interoperability");
1422
+ exclude("existing predicates and imported paths", 16, 1, "arbitrary host function requires explicit interoperability");
1423
+ } else {
1424
+ if ((family === "js-cons")) {
1425
+ exclude("js-cons spread", 11, 2, "external Set and Map iterators require explicit interoperability");
1426
+ } else {
1427
+ if ((family === "object-properties")) {
1428
+ exclude("assign effects and partial mutation", 1, 1, "host accessors require explicit interoperability");
1429
+ exclude("own property key hook", 1, 1, "host Symbol.toPrimitive callback requires explicit interoperability");
1430
+ } else {
1431
+ if ((family === "array-construction")) {
1432
+ exclude("Array.from", 7, 1, "external iterator object requires explicit interoperability");
1433
+ } else {
1434
+ if ((family === "primitive-operators")) {
1435
+ exclude("source hooks and bigint", 1, 0, "host valueOf callbacks are separate; the same group retains all raw BigInt checks");
1436
+ } else {
1437
+ if ((family === "objects")) {
1438
+ exclude("own order and prototypes", 1, 0, "raw prototype identities replace host-view prototype reflection");
1439
+ } else {
1440
+
1441
+ }
1442
+ }
1443
+ }
1444
+ }
1445
+ }
1446
+ }
1447
+ }
1448
+ }
1449
+ }
1450
+ mkdirSync(directory, ({"recursive": true}));
1451
+ writeFileSync(resolve(directory, "original-fixture-observations.json"), JSON.stringify(({"version": 1, "family": family, "target": (context)["target"], "sourceIdentity": (context)["sourceIdentity"], "originalHostSha256": (configuration)["originalHostSha256"], "completeOriginalObservations": observations, "portableObservations": portable, "groups": groups, "hostOnlyGroups": excluded})));
1452
+ return (globalThis.console)["log"](JSON.stringify(({"observations": portable})));
1453
+ }
1454
+ }
1455
+ export {finishOriginalFixtureObservation, originalRawLanguageFixturePlans, loadOriginalRawLanguageModels, runOriginalRawLanguageFixtureHost};
1456
+ //# sourceMappingURL=compiler-corpus-raw-language-fixtures.mjs.map