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
@@ -1,207 +1,516 @@
1
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("evaluation_operation_format"); return evaluation_operation_format; }
5
+ function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("evaluation_operation_format"); return __eliscript_const_error(); }
6
+ var __eliscript_tdz_ready_1;
7
+ function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("evaluation_operation_version"); return evaluation_operation_version; }
8
+ function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("evaluation_operation_version"); return __eliscript_const_error(); }
9
+ var __eliscript_tdz_ready_2;
10
+ function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("evaluation_input_format"); return evaluation_input_format; }
11
+ function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("evaluation_input_format"); return __eliscript_const_error(); }
12
+ var __eliscript_tdz_ready_3;
13
+ function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("evaluation_input_version"); return evaluation_input_version; }
14
+ function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("evaluation_input_version"); return __eliscript_const_error(); }
15
+ var __eliscript_tdz_ready_4;
16
+ function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("evaluation_form_format"); return evaluation_form_format; }
17
+ function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("evaluation_form_format"); return __eliscript_const_error(); }
18
+ var __eliscript_tdz_ready_5;
19
+ function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("evaluation_form_version"); return evaluation_form_version; }
20
+ function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("evaluation_form_version"); return __eliscript_const_error(); }
21
+ var __eliscript_tdz_ready_6;
22
+ function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("evaluation_module_format"); return evaluation_module_format; }
23
+ function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("evaluation_module_format"); return __eliscript_const_error(); }
24
+ var __eliscript_tdz_ready_7;
25
+ function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("evaluation_module_version"); return evaluation_module_version; }
26
+ function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("evaluation_module_version"); return __eliscript_const_error(); }
27
+ var __eliscript_tdz_ready_8;
28
+ function __eliscript_tdz_read_8() { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("evaluation_operation_keys"); return evaluation_operation_keys; }
29
+ function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("evaluation_operation_keys"); return __eliscript_const_error(); }
30
+ var __eliscript_tdz_ready_9;
31
+ function __eliscript_tdz_read_9() { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("evaluation_definition_heads"); return evaluation_definition_heads; }
32
+ function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("evaluation_definition_heads"); return __eliscript_const_error(); }
33
+ var __eliscript_tdz_ready_10;
34
+ function __eliscript_tdz_read_10() { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("evaluation_module_heads"); return evaluation_module_heads; }
35
+ function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("evaluation_module_heads"); return __eliscript_const_error(); }
36
+ var __eliscript_tdz_ready_11;
37
+ function __eliscript_tdz_read_11() { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("evaluation_fail"); return evaluation_fail; }
38
+ function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("evaluation_fail"); return __eliscript_const_error(); }
39
+ var __eliscript_tdz_ready_12;
40
+ function __eliscript_tdz_read_12() { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("evaluation_object_p"); return evaluation_object_p; }
41
+ function __eliscript_tdz_write_12(__eliscript_tdz_value_12) { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("evaluation_object_p"); return __eliscript_const_error(); }
42
+ var __eliscript_tdz_ready_13;
43
+ function __eliscript_tdz_read_13() { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("evaluation_id_p"); return evaluation_id_p; }
44
+ function __eliscript_tdz_write_13(__eliscript_tdz_value_13) { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("evaluation_id_p"); return __eliscript_const_error(); }
45
+ var __eliscript_tdz_ready_14;
46
+ function __eliscript_tdz_read_14() { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("evaluation_positive_integer_p"); return evaluation_positive_integer_p; }
47
+ function __eliscript_tdz_write_14(__eliscript_tdz_value_14) { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("evaluation_positive_integer_p"); return __eliscript_const_error(); }
48
+ import "eliscript/runtime/unicode-case.mjs";
2
49
  const __eliscript_truthy = (value) => value !== false && value != null;
50
+ const __eliscript_number_intrinsic = globalThis.Number;
51
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
52
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
53
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
54
+ const __eliscript_numeric_error = globalThis.TypeError;
55
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
56
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
57
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
58
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
59
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
60
+ const __eliscript_numeric_primitive = (value) => {
61
+ if (!__eliscript_numeric_object(value)) return value;
62
+ const exotic = value[__eliscript_numeric_symbol];
63
+ if (exotic !== void 0 && exotic !== null) {
64
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
65
+ if (!__eliscript_numeric_object(result)) return result;
66
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
67
+ }
68
+ for (let index = 0; index < 2; index++) {
69
+ const method = value[index === 0 ? "valueOf" : "toString"];
70
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
71
+ const result = __eliscript_numeric_apply(method, value, []);
72
+ if (!__eliscript_numeric_object(result)) return result;
73
+ }
74
+ }
75
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
76
+ };
77
+ const __eliscript_to_number = (value) => {
78
+ const primitive = __eliscript_numeric_primitive(value);
79
+ if (typeof primitive === "string") {
80
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
81
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
82
+ let first = 2;
83
+ while (first < text.length && text[first] === "0") first++;
84
+ if (first === text.length) return 0;
85
+ const prefix = text[1];
86
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
87
+ if (text.length - first > limit) return 1 / 0;
88
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
89
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
90
+ }
91
+ }
92
+ return __eliscript_number_intrinsic(primitive);
93
+ };
94
+ const __eliscript_numeric = (value) => {
95
+ if (typeof value === "number" || typeof value === "bigint") return value;
96
+ const primitive = __eliscript_numeric_primitive(value);
97
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
98
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
99
+ };
100
+ const __eliscript_implicit_number = (value) => {
101
+ if (typeof value === "number") return value;
102
+ const primitive = __eliscript_numeric_primitive(value);
103
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
104
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
105
+ };
106
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
107
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
108
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
109
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
110
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
111
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
112
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
113
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
114
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
115
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
116
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
117
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
118
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
119
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
120
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
121
+ const __eliscript_numeric_relation = (operator, left, right) => {
122
+ if (typeof left === "number" && typeof right === "number") {
123
+ if (operator === "<") return left < right;
124
+ if (operator === "<=") return left <= right;
125
+ if (operator === ">") return left > right;
126
+ return left >= right;
127
+ }
128
+ let a = __eliscript_numeric_primitive(left);
129
+ let b = __eliscript_numeric_primitive(right);
130
+ const x = typeof a, y = typeof b;
131
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
132
+ a = __eliscript_numeric(a);
133
+ b = __eliscript_numeric(b);
134
+ }
135
+ if (operator === "<") return a < b;
136
+ if (operator === "<=") return a <= b;
137
+ if (operator === ">") return a > b;
138
+ return a >= b;
139
+ };
3
140
 
4
141
  import {read_string} from "./reader.mjs";
5
142
  import {formatter_format, formatter_version, formatter_width, formatter_indent, format_source} from "./formatter.mjs";
6
- import {expand_module} from "./expander.mjs";
143
+ import {expand_module, expand_module_with_origins, expand_owned_module, expand_owned_module_with_origins} from "./expander.mjs";
7
144
  import {analyze_module, select_portable_module} from "./analyzer.mjs";
8
- import {lower_module} from "./lower.mjs";
145
+ import {lower_module, lower_owned_module} from "./lower.mjs";
9
146
  import {ir_format, ir_version, serialize_program, deserialize_program} from "./ir.mjs";
10
147
  import {emit_module, emit_module_with_source_map} from "./emitter.mjs";
11
148
  import {project_plan_format, project_plan_version, project_plan, portable_project_plan, project_build_report_format, project_build_report_version, project_build_report, project_request_format, project_request_version, project_request, project_configuration, build_operation_format, build_operation_version, build_operation_request, check_operation_format, check_operation_version, check_operation_request, project_check_report_format, project_check_report_version, project_check_report, project_cache_format, project_cache_version, project_cache_lookup, project_cache_decision} from "./project.mjs";
12
149
  const evaluation_operation_format = "eliscript-evaluation-operation";
150
+ __eliscript_tdz_ready_0 = true;
13
151
  const evaluation_operation_version = 1;
152
+ __eliscript_tdz_ready_1 = true;
14
153
  const evaluation_input_format = "eliscript-evaluation-input";
154
+ __eliscript_tdz_ready_2 = true;
15
155
  const evaluation_input_version = 1;
156
+ __eliscript_tdz_ready_3 = true;
16
157
  const evaluation_form_format = "eliscript-evaluation-form";
158
+ __eliscript_tdz_ready_4 = true;
17
159
  const evaluation_form_version = 1;
160
+ __eliscript_tdz_ready_5 = true;
18
161
  const evaluation_module_format = "eliscript-evaluation-module";
162
+ __eliscript_tdz_ready_6 = true;
19
163
  const evaluation_module_version = 1;
164
+ __eliscript_tdz_ready_7 = true;
20
165
  const evaluation_operation_keys = ["id", "operation", "source", "filename", "root", "line", "column"];
166
+ __eliscript_tdz_ready_8 = true;
21
167
  const evaluation_definition_heads = ["defasync", "defconst", "defmacro", "defmulti", "defn", "defportable", "defprotocol", "defun", "defvar"];
168
+ __eliscript_tdz_ready_9 = true;
22
169
  const evaluation_module_heads = ["export", "export-default", "import", "import-portable", "module"];
23
- const evaluation_fail = (message, filename) => { const error = new Error(message); error.eliscriptDiagnostic = { format: 'eliscript-diagnostic', version: 1, code: 'ELI-E0001', severity: 'error', phase: 'evaluation-request', message, ...(filename ? { location: { file: filename } } : {}) }; throw error; };
24
- const evaluation_object_p = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
25
- const evaluation_id_p = (value) => value === null || (typeof value === 'string' && value.length > 0) || (Number.isSafeInteger(value) && value >= 0);
26
- const evaluation_positive_integer_p = (value) => Number.isSafeInteger(value) && value >= 1;
170
+ __eliscript_tdz_ready_10 = true;
171
+ const evaluation_fail = ((message, filename) => {
172
+ {
173
+ const __eliscript_value_1 = new (Error)(message);
174
+ {
175
+ let error = __eliscript_value_1;
176
+ {
177
+ const __eliscript_value_2 = ({"format": "eliscript-diagnostic", "version": 1, "code": "ELI-E0001", "severity": "error", "phase": "evaluation-request", "message": message});
178
+ {
179
+ let diagnostic = __eliscript_value_2;
180
+ if (!!filename) {
181
+ ((diagnostic)["location"] = ({"file": filename}));
182
+ }
183
+ ((error)["eliscriptDiagnostic"] = diagnostic);
184
+ return ((__eliscript_value_3) => { throw __eliscript_value_3; })(error);
185
+ }
186
+ }
187
+ }
188
+ }
189
+ });
190
+ __eliscript_tdz_ready_11 = true;
191
+ const evaluation_object_p = ((value) => {
192
+ return ((!(value === null)) && (typeof value === "object") && (!__eliscript_truthy(Array.isArray(value))));
193
+ });
194
+ __eliscript_tdz_ready_12 = true;
195
+ const evaluation_id_p = ((value) => {
196
+ return ((__eliscript_value_4) => (__eliscript_truthy(__eliscript_value_4) ? __eliscript_value_4 : ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? __eliscript_value_5 : ((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? __eliscript_numeric_relation(">=", value, 0) : __eliscript_value_6))(Number.isSafeInteger(value))))(((typeof value === "string") && __eliscript_numeric_relation(">", ((value) ?? []).length, 0)))))((value === null));
197
+ });
198
+ __eliscript_tdz_ready_13 = true;
199
+ const evaluation_positive_integer_p = ((value) => {
200
+ return ((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? __eliscript_numeric_relation(">=", value, 1) : __eliscript_value_7))(Number.isSafeInteger(value));
201
+ });
202
+ __eliscript_tdz_ready_14 = true;
27
203
  function compile_ir_string(source, filename, macro_context = null) {
28
- return ((read_forms) => {
29
- return ((expanded_forms) => {
30
- return (() => {
31
- analyze_module(expanded_forms, filename);
32
- return lower_module(expanded_forms, filename);
33
- })();
34
- })(expand_module(read_forms, filename, macro_context));
35
- })(read_string(source, filename));
204
+ {
205
+ let read_forms = read_string(source, filename);
206
+ let expanded_forms = expand_owned_module(read_forms, filename, macro_context);
207
+ ((read_forms = null));
208
+ analyze_module(expanded_forms, filename);
209
+ return lower_owned_module(expanded_forms, filename);
210
+ }
211
+ }
212
+ function compile_ir_string_with_origins(source, filename, macro_context = null) {
213
+ {
214
+ let expansion = expand_owned_module_with_origins(read_string(source, filename), filename, macro_context);
215
+ let forms = (expansion)["forms"];
216
+ analyze_module(forms, filename);
217
+ return ({"program": lower_owned_module(forms, filename), "macroOrigins": (expansion)["macroOrigins"]});
218
+ }
36
219
  }
37
220
  function evaluation_object_field(value, key, fallback) {
38
- return (__eliscript_truthy((globalThis.Object)["hasOwn"](value, key)) ? (value)[key] : fallback);
221
+ if (__eliscript_truthy((globalThis.Object)["hasOwn"](value, key))) {
222
+ return (value)[key];
223
+ } else {
224
+ return fallback;
225
+ }
39
226
  }
40
227
  function evaluation_require_source(source, filename) {
41
- (__eliscript_truthy((!__eliscript_truthy(((__eliscript_value_1) => (__eliscript_truthy(__eliscript_value_1) ? ((source)["length"] > 0) : __eliscript_value_1))((typeof source === "string"))))) ? evaluation_fail("evaluation source must be a non-empty string", filename) : null);
228
+ if ((!((typeof source === "string") && __eliscript_numeric_relation(">", (source)["length"], 0)))) {
229
+ (__eliscript_tdz_read_11())("evaluation source must be a non-empty string", filename);
230
+ }
42
231
  return source;
43
232
  }
44
233
  function evaluation_require_filename(filename) {
45
- (__eliscript_truthy((!__eliscript_truthy(((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? ((filename)["length"] > 0) : __eliscript_value_2))((typeof filename === "string"))))) ? evaluation_fail("evaluation filename must be a non-empty string", false) : null);
234
+ if ((!((typeof filename === "string") && __eliscript_numeric_relation(">", (filename)["length"], 0)))) {
235
+ (__eliscript_tdz_read_11())("evaluation filename must be a non-empty string", false);
236
+ }
46
237
  return filename;
47
238
  }
48
239
  function evaluation_input_result(status, filename) {
49
- return (globalThis.Object)["freeze"](({"format": evaluation_input_format, "version": evaluation_input_version, "status": status, "filename": filename}));
240
+ return (globalThis.Object)["freeze"](({"format": (__eliscript_tdz_read_2()), "version": (__eliscript_tdz_read_3()), "status": status, "filename": filename}));
50
241
  }
51
242
  function evaluation_input_description(source, filename) {
52
243
  evaluation_require_filename(filename);
53
- (__eliscript_truthy((!__eliscript_truthy((typeof source === "string")))) ? evaluation_fail("evaluation input source must be a string", filename) : null);
244
+ if ((!(typeof source === "string"))) {
245
+ (__eliscript_tdz_read_11())("evaluation input source must be a string", filename);
246
+ }
54
247
  return (() => {
55
248
  try {
56
- return ((forms) => {
57
- return (__eliscript_truthy(((forms)["length"] === 0)) ? evaluation_input_result("empty", filename) : (__eliscript_truthy(((forms)["length"] === 1)) ? evaluation_input_result("complete", filename) : evaluation_fail("interactive input must contain exactly one top-level form", filename)));
58
- })(read_string(source, filename));
249
+ {
250
+ const __eliscript_value_8 = read_string(source, filename);
251
+ {
252
+ let forms = __eliscript_value_8;
253
+ if (((forms)["length"] === 0)) {
254
+ return evaluation_input_result("empty", filename);
255
+ } else {
256
+ if (((forms)["length"] === 1)) {
257
+ return evaluation_input_result("complete", filename);
258
+ } else {
259
+ return (__eliscript_tdz_read_11())("interactive input must contain exactly one top-level form", filename);
260
+ }
261
+ }
262
+ }
263
+ }
59
264
  } catch (error) {
60
- return ((diagnostic) => {
61
- return (__eliscript_truthy(((__eliscript_value_3) => (__eliscript_truthy(__eliscript_value_3) ? ((__eliscript_value_4) => (__eliscript_truthy(__eliscript_value_4) ? (((diagnostic)["message"] ?? null) === "unexpected end of input") : __eliscript_value_4))((((diagnostic)["code"] ?? null) === "ELI-R0001")) : __eliscript_value_3))(diagnostic)) ? evaluation_input_result("incomplete", filename) : ((__eliscript_value_5) => { throw __eliscript_value_5; })(error));
62
- })(((error)["eliscriptDiagnostic"] ?? null));
265
+ {
266
+ const __eliscript_value_9 = ((error)["eliscriptDiagnostic"] ?? null);
267
+ {
268
+ let diagnostic = __eliscript_value_9;
269
+ if (__eliscript_truthy(((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? ((((diagnostic)["code"] ?? null) === "ELI-R0001") && (((diagnostic)["message"] ?? null) === "unexpected end of input")) : __eliscript_value_10))(diagnostic))) {
270
+ return evaluation_input_result("incomplete", filename);
271
+ } else {
272
+ return ((__eliscript_value_11) => { throw __eliscript_value_11; })(error);
273
+ }
274
+ }
275
+ }
63
276
  }
64
277
  })();
65
278
  }
66
279
  function evaluation_operation_request(input) {
67
- (__eliscript_truthy((!__eliscript_truthy(evaluation_object_p(input)))) ? evaluation_fail("evaluation operation request must be an object", false) : null);
68
- ((globalThis.Object)["keys"](input))["forEach"]((key) => {
69
- return (__eliscript_truthy((!__eliscript_truthy((evaluation_operation_keys)["includes"](key)))) ? evaluation_fail((String("unknown evaluation operation key: ") + String(key)), false) : null);
70
- });
71
- return ((id) => {
72
- return ((operation) => {
73
- return (() => {
74
- (__eliscript_truthy((!__eliscript_truthy(evaluation_id_p(id)))) ? evaluation_fail("evaluation operation id must be null, a non-empty string, or a non-negative safe integer", false) : null);
75
- (__eliscript_truthy((!__eliscript_truthy((["describe", "evaluate", "load", "reset"])["includes"](operation)))) ? evaluation_fail("evaluation operation must be describe, evaluate, load, or reset", false) : null);
76
- return (__eliscript_truthy(((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? __eliscript_value_6 : (operation === "load")))((operation === "evaluate"))) ? ((filename) => {
77
- return ((source) => {
78
- return ((root) => {
79
- return ((line) => {
80
- return ((column) => {
81
- return (() => {
82
- (__eliscript_truthy((!__eliscript_truthy(((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? __eliscript_value_7 : ((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? ((root)["length"] > 0) : __eliscript_value_8))((typeof root === "string"))))((root === null))))) ? evaluation_fail("evaluation root must be null or a non-empty string", filename) : null);
83
- (__eliscript_truthy((!__eliscript_truthy(evaluation_positive_integer_p(line)))) ? evaluation_fail("evaluation line must be a positive safe integer", filename) : null);
84
- (__eliscript_truthy((!__eliscript_truthy(evaluation_positive_integer_p(column)))) ? evaluation_fail("evaluation column must be a positive safe integer", filename) : null);
85
- return (globalThis.Object)["freeze"](({"format": evaluation_operation_format, "version": evaluation_operation_version, "id": id, "operation": operation, "source": source, "filename": filename, "root": root, "line": line, "column": column}));
86
- })();
87
- })(evaluation_object_field(input, "column", 1));
88
- })(evaluation_object_field(input, "line", 1));
89
- })(evaluation_object_field(input, "root", null));
90
- })(evaluation_require_source((input)["source"], filename));
91
- })(evaluation_require_filename((input)["filename"])) : (() => {
92
- (__eliscript_truthy(((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? __eliscript_value_9 : ((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? __eliscript_value_10 : ((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? __eliscript_value_11 : ((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? __eliscript_value_12 : (globalThis.Object)["hasOwn"](input, "column")))((globalThis.Object)["hasOwn"](input, "line"))))((globalThis.Object)["hasOwn"](input, "root"))))((globalThis.Object)["hasOwn"](input, "filename"))))((globalThis.Object)["hasOwn"](input, "source"))) ? evaluation_fail((String(operation) + String(" evaluation operation does not accept source fields")), false) : null);
93
- return (globalThis.Object)["freeze"](({"format": evaluation_operation_format, "version": evaluation_operation_version, "id": id, "operation": operation}));
94
- })());
95
- })();
96
- })((input)["operation"]);
97
- })(evaluation_object_field(input, "id", null));
280
+ if ((!__eliscript_truthy((__eliscript_tdz_read_12())(input)))) {
281
+ (__eliscript_tdz_read_11())("evaluation operation request must be an object", false);
282
+ }
283
+ ((globalThis.Object)["keys"](input))["forEach"](((key) => {
284
+ if ((!__eliscript_truthy(((__eliscript_tdz_read_8()))["includes"](key)))) {
285
+ return (__eliscript_tdz_read_11())((String("unknown evaluation operation key: ") + String(key)), false);
286
+ } else {
287
+ return null;
288
+ }
289
+ }));
290
+ {
291
+ let id = evaluation_object_field(input, "id", null);
292
+ let operation = (input)["operation"];
293
+ if ((!__eliscript_truthy((__eliscript_tdz_read_13())(id)))) {
294
+ (__eliscript_tdz_read_11())("evaluation operation id must be null, a non-empty string, or a non-negative safe integer", false);
295
+ }
296
+ if ((!__eliscript_truthy((["describe", "evaluate", "load", "reset"])["includes"](operation)))) {
297
+ (__eliscript_tdz_read_11())("evaluation operation must be describe, evaluate, load, or reset", false);
298
+ }
299
+ if (((operation === "evaluate") || (operation === "load"))) {
300
+ {
301
+ let filename = evaluation_require_filename((input)["filename"]);
302
+ let source = evaluation_require_source((input)["source"], filename);
303
+ let root = evaluation_object_field(input, "root", null);
304
+ let line = evaluation_object_field(input, "line", 1);
305
+ let column = evaluation_object_field(input, "column", 1);
306
+ if ((!((root === null) || ((typeof root === "string") && __eliscript_numeric_relation(">", (root)["length"], 0))))) {
307
+ (__eliscript_tdz_read_11())("evaluation root must be null or a non-empty string", filename);
308
+ }
309
+ if ((!__eliscript_truthy((__eliscript_tdz_read_14())(line)))) {
310
+ (__eliscript_tdz_read_11())("evaluation line must be a positive safe integer", filename);
311
+ }
312
+ if ((!__eliscript_truthy((__eliscript_tdz_read_14())(column)))) {
313
+ (__eliscript_tdz_read_11())("evaluation column must be a positive safe integer", filename);
314
+ }
315
+ return (globalThis.Object)["freeze"](({"format": (__eliscript_tdz_read_0()), "version": (__eliscript_tdz_read_1()), "id": id, "operation": operation, "source": source, "filename": filename, "root": root, "line": line, "column": column}));
316
+ }
317
+ } else {
318
+ if (__eliscript_truthy(((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? __eliscript_value_12 : ((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? __eliscript_value_13 : ((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? __eliscript_value_14 : ((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? __eliscript_value_15 : (globalThis.Object)["hasOwn"](input, "column")))((globalThis.Object)["hasOwn"](input, "line"))))((globalThis.Object)["hasOwn"](input, "root"))))((globalThis.Object)["hasOwn"](input, "filename"))))((globalThis.Object)["hasOwn"](input, "source")))) {
319
+ (__eliscript_tdz_read_11())((String(operation) + String(" evaluation operation does not accept source fields")), false);
320
+ }
321
+ return (globalThis.Object)["freeze"](({"format": (__eliscript_tdz_read_0()), "version": (__eliscript_tdz_read_1()), "id": id, "operation": operation}));
322
+ }
323
+ }
98
324
  }
99
325
  function evaluation_form_head(form) {
100
- return (__eliscript_truthy(((form)["kind"] === "list")) ? ((items) => {
101
- return (__eliscript_truthy(((items)["length"] > 0)) ? ((head) => {
102
- return (__eliscript_truthy(((head)["kind"] === "symbol")) ? (head)["name"] : false);
103
- })(((((items) ?? [])[0]) ?? null)) : false);
104
- })((form)["items"]) : false);
326
+ if (((form)["kind"] === "list")) {
327
+ {
328
+ const __eliscript_value_16 = (form)["items"];
329
+ {
330
+ let items = __eliscript_value_16;
331
+ if (__eliscript_numeric_relation(">", (items)["length"], 0)) {
332
+ {
333
+ const __eliscript_value_17 = ((((items) ?? [])[0]) ?? null);
334
+ {
335
+ let head = __eliscript_value_17;
336
+ if (((head)["kind"] === "symbol")) {
337
+ return (head)["name"];
338
+ } else {
339
+ return false;
340
+ }
341
+ }
342
+ }
343
+ } else {
344
+ return false;
345
+ }
346
+ }
347
+ }
348
+ } else {
349
+ return false;
350
+ }
105
351
  }
106
352
  function evaluation_form_description(source, filename) {
107
353
  evaluation_require_filename(filename);
108
354
  evaluation_require_source(source, filename);
109
- return ((forms) => {
110
- (__eliscript_truthy((!__eliscript_truthy(((forms)["length"] === 1)))) ? evaluation_fail("evaluate requires exactly one top-level form", filename) : null);
111
- return ((form) => {
112
- return ((head) => {
113
- return ((definition) => {
114
- return ((module_form) => {
115
- return ((name) => {
116
- return (() => {
117
- (__eliscript_truthy(((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? (!__eliscript_truthy(name)) : __eliscript_value_15))(definition)) ? evaluation_fail((String(head) + String(" evaluation form requires a symbol name")), filename) : null);
118
- return (globalThis.Object)["freeze"](({"format": evaluation_form_format, "version": evaluation_form_version, "kind": (__eliscript_truthy(definition) ? "definition" : (__eliscript_truthy(module_form) ? "module" : "expression")), "head": ((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? __eliscript_value_16 : null))(head), "name": ((__eliscript_value_17) => (__eliscript_truthy(__eliscript_value_17) ? __eliscript_value_17 : null))(name), "runtimeBinding": ((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? (!__eliscript_truthy((head === "defmacro"))) : __eliscript_value_18))(definition), "filename": filename}));
119
- })();
120
- })((__eliscript_truthy(definition) ? ((items) => {
121
- return (__eliscript_truthy(((items)["length"] > 1)) ? ((candidate) => {
122
- return (__eliscript_truthy(((candidate)["kind"] === "symbol")) ? (candidate)["name"] : false);
123
- })(((((items) ?? [])[1]) ?? null)) : false);
124
- })((form)["items"]) : false));
125
- })(((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? (evaluation_module_heads)["includes"](head) : __eliscript_value_14))(head));
126
- })(((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? (evaluation_definition_heads)["includes"](head) : __eliscript_value_13))(head));
127
- })(evaluation_form_head(form));
128
- })(((((forms) ?? [])[0]) ?? null));
129
- })(read_string(source, filename));
355
+ {
356
+ const __eliscript_value_18 = read_string(source, filename);
357
+ {
358
+ let forms = __eliscript_value_18;
359
+ if ((!((forms)["length"] === 1))) {
360
+ (__eliscript_tdz_read_11())("evaluate requires exactly one top-level form", filename);
361
+ }
362
+ {
363
+ let form = ((((forms) ?? [])[0]) ?? null);
364
+ let head = evaluation_form_head(form);
365
+ let definition = ((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? ((__eliscript_tdz_read_9()))["includes"](head) : __eliscript_value_19))(head);
366
+ let module_form = ((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? ((__eliscript_tdz_read_10()))["includes"](head) : __eliscript_value_20))(head);
367
+ let name = (__eliscript_truthy(definition) ? ((items) => {
368
+ if (__eliscript_numeric_relation(">", (items)["length"], 1)) {
369
+ {
370
+ const __eliscript_value_21 = ((((items) ?? [])[1]) ?? null);
371
+ {
372
+ let candidate = __eliscript_value_21;
373
+ if (((candidate)["kind"] === "symbol")) {
374
+ return (candidate)["name"];
375
+ } else {
376
+ return false;
377
+ }
378
+ }
379
+ }
380
+ } else {
381
+ return false;
382
+ }
383
+ })((form)["items"]) : false);
384
+ if (__eliscript_truthy(((__eliscript_value_22) => (__eliscript_truthy(__eliscript_value_22) ? (!__eliscript_truthy(name)) : __eliscript_value_22))(definition))) {
385
+ (__eliscript_tdz_read_11())((String(head) + String(" evaluation form requires a symbol name")), filename);
386
+ }
387
+ return (globalThis.Object)["freeze"](({"format": (__eliscript_tdz_read_4()), "version": (__eliscript_tdz_read_5()), "kind": (__eliscript_truthy(definition) ? "definition" : (__eliscript_truthy(module_form) ? "module" : "expression")), "head": ((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? __eliscript_value_23 : null))(head), "name": ((__eliscript_value_24) => (__eliscript_truthy(__eliscript_value_24) ? __eliscript_value_24 : null))(name), "runtimeBinding": ((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? (!(head === "defmacro")) : __eliscript_value_25))(definition), "filename": filename}));
388
+ }
389
+ }
390
+ }
130
391
  }
131
392
  function evaluation_add_name(names, seen, value) {
132
- return (__eliscript_truthy(((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? ((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? (!__eliscript_truthy((seen)["has"](value))) : __eliscript_value_20))(((value)["length"] > 0)) : __eliscript_value_19))((typeof value === "string"))) ? (() => {
393
+ if (((typeof value === "string") && __eliscript_numeric_relation(">", (value)["length"], 0) && (!__eliscript_truthy((seen)["has"](value))))) {
133
394
  (seen)["add"](value);
134
395
  return (names)["push"](value);
135
- })() : null);
396
+ } else {
397
+ return null;
398
+ }
136
399
  }
137
400
  function evaluation_collect_ir_names(nodes, bindings, binding_set, exports, export_set) {
138
- return (nodes)["forEach"]((node) => {
139
- return ((kind) => {
140
- return (__eliscript_truthy(((__eliscript_value_21) => (__eliscript_truthy(__eliscript_value_21) ? __eliscript_value_21 : (kind === "variable-declaration")))((kind === "function-declaration"))) ? evaluation_add_name(bindings, binding_set, (node)["value"]) : (__eliscript_truthy((kind === "import-declaration")) ? ((node)["children"])["forEach"]((child) => {
141
- return (__eliscript_truthy(((child)["kind"] === "import-named")) ? evaluation_add_name(bindings, binding_set, (child)["value"]) : null);
142
- }) : (__eliscript_truthy((kind === "export-declaration")) ? ((node)["children"])["forEach"]((child) => {
143
- return evaluation_add_name(exports, export_set, (child)["value"]);
144
- }) : (__eliscript_truthy((kind === "module-declaration")) ? evaluation_collect_ir_names((node)["children"], bindings, binding_set, exports, export_set) : null))));
145
- })((node)["kind"]);
146
- });
401
+ return (nodes)["forEach"](((node) => {
402
+ {
403
+ const __eliscript_value_26 = (node)["kind"];
404
+ {
405
+ let kind = __eliscript_value_26;
406
+ if (((kind === "function-declaration") || (kind === "variable-declaration"))) {
407
+ return evaluation_add_name(bindings, binding_set, (node)["value"]);
408
+ } else {
409
+ if ((kind === "import-declaration")) {
410
+ return ((node)["children"])["forEach"](((child) => {
411
+ if (((child)["kind"] === "import-named")) {
412
+ return evaluation_add_name(bindings, binding_set, (child)["value"]);
413
+ } else {
414
+ return null;
415
+ }
416
+ }));
417
+ } else {
418
+ if ((kind === "export-declaration")) {
419
+ return ((node)["children"])["forEach"](((child) => {
420
+ return evaluation_add_name(exports, export_set, (child)["value"]);
421
+ }));
422
+ } else {
423
+ if ((kind === "module-declaration")) {
424
+ return evaluation_collect_ir_names((node)["children"], bindings, binding_set, exports, export_set);
425
+ } else {
426
+ return null;
427
+ }
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ }));
147
434
  }
148
435
  function evaluation_collect_macro_sources(forms, source, result) {
149
- return (forms)["forEach"]((form) => {
150
- return ((head) => {
151
- return (__eliscript_truthy((head === "defmacro")) ? ((span) => {
152
- return (result)["push"]((source)["slice"]((span)["start"], (span)["end"]));
153
- })((form)["span"]) : (__eliscript_truthy((head === "module")) ? evaluation_collect_macro_sources(((form)["items"])["slice"](2), source, result) : null));
154
- })(evaluation_form_head(form));
155
- });
436
+ return (forms)["forEach"](((form) => {
437
+ {
438
+ const __eliscript_value_27 = evaluation_form_head(form);
439
+ {
440
+ let head = __eliscript_value_27;
441
+ if ((head === "defmacro")) {
442
+ {
443
+ const __eliscript_value_28 = (form)["span"];
444
+ {
445
+ let span = __eliscript_value_28;
446
+ return (result)["push"]((source)["slice"]((span)["start"], (span)["end"]));
447
+ }
448
+ }
449
+ } else {
450
+ if ((head === "module")) {
451
+ return evaluation_collect_macro_sources(((form)["items"])["slice"](2), source, result);
452
+ } else {
453
+ return null;
454
+ }
455
+ }
456
+ }
457
+ }
458
+ }));
156
459
  }
157
460
  function evaluation_module_description(source, filename) {
158
461
  evaluation_require_filename(filename);
159
462
  evaluation_require_source(source, filename);
160
- return ((program) => {
161
- return ((bindings) => {
162
- return ((binding_set) => {
163
- return ((exports) => {
164
- return ((export_set) => {
165
- return ((macro_sources) => {
166
- return (() => {
167
- evaluation_collect_ir_names((program)["body"], bindings, binding_set, exports, export_set);
168
- evaluation_collect_macro_sources(read_string(source, filename), source, macro_sources);
169
- (bindings)["sort"]();
170
- (exports)["sort"]();
171
- (globalThis.Object)["freeze"](bindings);
172
- (globalThis.Object)["freeze"](exports);
173
- (globalThis.Object)["freeze"](macro_sources);
174
- return (globalThis.Object)["freeze"](({"format": evaluation_module_format, "version": evaluation_module_version, "filename": filename, "bindings": bindings, "exports": exports, "macroSources": macro_sources}));
175
- })();
176
- })([]);
177
- })(new globalThis.Set());
178
- })([]);
179
- })(new globalThis.Set());
180
- })([]);
181
- })(compile_ir_string(source, filename));
463
+ {
464
+ let program = compile_ir_string(source, filename);
465
+ let bindings = [];
466
+ let binding_set = new (globalThis.Set)();
467
+ let exports = [];
468
+ let export_set = new (globalThis.Set)();
469
+ let macro_sources = [];
470
+ evaluation_collect_ir_names((program)["body"], bindings, binding_set, exports, export_set);
471
+ evaluation_collect_macro_sources(read_string(source, filename), source, macro_sources);
472
+ (bindings)["sort"]();
473
+ (exports)["sort"]();
474
+ (globalThis.Object)["freeze"](bindings);
475
+ (globalThis.Object)["freeze"](exports);
476
+ (globalThis.Object)["freeze"](macro_sources);
477
+ return (globalThis.Object)["freeze"](({"format": (__eliscript_tdz_read_6()), "version": (__eliscript_tdz_read_7()), "filename": filename, "bindings": bindings, "exports": exports, "macroSources": macro_sources}));
478
+ }
182
479
  }
183
480
  function compile_string(source, filename) {
184
481
  return emit_module(compile_ir_string(source, filename));
185
482
  }
186
483
  function compile_portable_ir_string(source, entries, filename, macro_context = null) {
187
- return ((read_forms) => {
188
- return ((expanded_forms) => {
189
- return (() => {
190
- analyze_module(expanded_forms, filename);
191
- return lower_module(select_portable_module(expanded_forms, entries, filename), filename);
192
- })();
193
- })(expand_module(read_forms, filename, macro_context));
194
- })(read_string(source, filename));
484
+ {
485
+ let read_forms = read_string(source, filename);
486
+ let expanded_forms = expand_owned_module(read_forms, filename, macro_context);
487
+ ((read_forms = null));
488
+ analyze_module(expanded_forms, filename);
489
+ {
490
+ const __eliscript_value_29 = select_portable_module(expanded_forms, entries, filename);
491
+ {
492
+ let selected = __eliscript_value_29;
493
+ ((expanded_forms = null));
494
+ return lower_owned_module(selected, filename);
495
+ }
496
+ }
497
+ }
195
498
  }
196
499
  function compile_project_portable_ir_string(source, entries, filename, macro_context = null) {
197
- return ((read_forms) => {
198
- return ((expanded_forms) => {
199
- return (() => {
200
- analyze_module(expanded_forms, filename);
201
- return lower_module(select_portable_module(expanded_forms, entries, filename, true), filename);
202
- })();
203
- })(expand_module(read_forms, filename, macro_context));
204
- })(read_string(source, filename));
500
+ {
501
+ let read_forms = read_string(source, filename);
502
+ let expanded_forms = expand_owned_module(read_forms, filename, macro_context);
503
+ ((read_forms = null));
504
+ analyze_module(expanded_forms, filename);
505
+ {
506
+ const __eliscript_value_30 = select_portable_module(expanded_forms, entries, filename, true);
507
+ {
508
+ let selected = __eliscript_value_30;
509
+ ((expanded_forms = null));
510
+ return lower_owned_module(selected, filename);
511
+ }
512
+ }
513
+ }
205
514
  }
206
515
  function emit_ir_string(program) {
207
516
  return emit_module(program);
@@ -219,10 +528,9 @@ function compile_portable_string(source, entries, filename) {
219
528
  return emit_module(compile_portable_ir_string(source, entries, filename));
220
529
  }
221
530
  function compile_portable_string_with_source_map(source, entries, filename, generated_name, source_name) {
222
- return emit_module_with_source_map(compile_portable_ir_string(source, entries, filename), source, generated_name, ((__eliscript_value_22) => (__eliscript_truthy(__eliscript_value_22) ? __eliscript_value_22 : ((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? __eliscript_value_23 : "<string>"))(filename)))(source_name));
531
+ return emit_module_with_source_map(compile_portable_ir_string(source, entries, filename), source, generated_name, ((__eliscript_value_31) => (__eliscript_truthy(__eliscript_value_31) ? __eliscript_value_31 : ((__eliscript_value_32) => (__eliscript_truthy(__eliscript_value_32) ? __eliscript_value_32 : "<string>"))(filename)))(source_name));
223
532
  }
224
533
  function compile_string_with_source_map(source, filename, generated_name, source_name) {
225
- return emit_module_with_source_map(compile_ir_string(source, filename), source, generated_name, ((__eliscript_value_24) => (__eliscript_truthy(__eliscript_value_24) ? __eliscript_value_24 : ((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? __eliscript_value_25 : "<string>"))(filename)))(source_name));
534
+ return emit_module_with_source_map(compile_ir_string(source, filename), source, generated_name, ((__eliscript_value_33) => (__eliscript_truthy(__eliscript_value_33) ? __eliscript_value_33 : ((__eliscript_value_34) => (__eliscript_truthy(__eliscript_value_34) ? __eliscript_value_34 : "<string>"))(filename)))(source_name));
226
535
  }
227
- export {compile_ir_string, compile_project_portable_ir_string, compile_string, compile_portable_ir_string, compile_portable_string, compile_portable_string_with_source_map, compile_string_with_source_map, emit_ir_string, emit_ir_string_with_source_map, serialize_ir_program, deserialize_ir_program, evaluation_operation_format, evaluation_operation_version, evaluation_operation_request, evaluation_input_format, evaluation_input_version, evaluation_input_description, evaluation_form_format, evaluation_form_version, evaluation_form_description, evaluation_module_format, evaluation_module_version, evaluation_module_description, formatter_format, formatter_version, formatter_width, formatter_indent, format_source, ir_format, ir_version, project_plan_format, project_plan_version, project_plan, portable_project_plan, project_build_report_format, project_build_report_version, project_build_report, project_request_format, project_request_version, project_request, project_configuration, build_operation_format, build_operation_version, build_operation_request, check_operation_format, check_operation_version, check_operation_request, project_check_report_format, project_check_report_version, project_check_report, project_cache_format, project_cache_version, project_cache_lookup, project_cache_decision};
228
- //# sourceMappingURL=compiler.mjs.map
536
+ export {compile_ir_string, compile_ir_string_with_origins, compile_project_portable_ir_string, compile_string, compile_portable_ir_string, compile_portable_string, compile_portable_string_with_source_map, compile_string_with_source_map, emit_ir_string, emit_ir_string_with_source_map, serialize_ir_program, deserialize_ir_program, evaluation_operation_format, evaluation_operation_version, evaluation_operation_request, evaluation_input_format, evaluation_input_version, evaluation_input_description, evaluation_form_format, evaluation_form_version, evaluation_form_description, evaluation_module_format, evaluation_module_version, evaluation_module_description, formatter_format, formatter_version, formatter_width, formatter_indent, format_source, ir_format, ir_version, project_plan_format, project_plan_version, project_plan, portable_project_plan, project_build_report_format, project_build_report_version, project_build_report, project_request_format, project_request_version, project_request, project_configuration, build_operation_format, build_operation_version, build_operation_request, check_operation_format, check_operation_version, check_operation_request, project_check_report_format, project_check_report_version, project_check_report, project_cache_format, project_cache_version, project_cache_lookup, project_cache_decision};