eliscript 0.0.1 → 0.0.2
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.
- package/README.md +59 -0
- package/bootstrap/README.md +26 -0
- package/bootstrap/backends/README.md +515 -0
- package/bootstrap/backends/async.eli +230 -0
- package/bootstrap/backends/binary.eli +173 -0
- package/bootstrap/backends/capabilities.eli +74 -0
- package/bootstrap/backends/elf.eli +246 -0
- package/bootstrap/backends/managed.eli +5976 -0
- package/bootstrap/backends/memory.eli +100 -0
- package/bootstrap/backends/native.eli +2000 -0
- package/bootstrap/backends/numeric.eli +1362 -0
- package/bootstrap/backends/optimize.eli +79 -0
- package/bootstrap/backends/regexp.eli +2263 -0
- package/bootstrap/backends/sha256.eli +138 -0
- package/bootstrap/backends/wasm.eli +1161 -0
- package/bootstrap/compiler/analyzer.eli +165 -77
- package/bootstrap/compiler/compiler.eli +43 -19
- package/bootstrap/compiler/emitter.eli +780 -170
- package/bootstrap/compiler/expander.eli +136 -45
- package/bootstrap/compiler/formatter.eli +8 -1
- package/bootstrap/compiler/ir.eli +148 -45
- package/bootstrap/compiler/lower.eli +29 -2
- package/bootstrap/compiler/project.eli +51 -21
- package/bootstrap/compiler/reader.eli +128 -36
- package/bootstrap/compiler/source-map.eli +46 -4
- package/bootstrap/compiler/symbol.eli +2 -1
- package/bootstrap/compiler/syntax.eli +47 -12
- package/bootstrap/compiler/transient-analysis.eli +40 -4
- package/bootstrap/host/check-cli-legacy.mjs +163 -0
- package/bootstrap/host/check-cli.mjs +59 -158
- package/bootstrap/host/check-cli.mjs.map +1 -0
- package/bootstrap/host/compiler-session.eli +1579 -0
- package/bootstrap/host/compiler-tools.eli +513 -0
- package/bootstrap/host/eliscript-cli-legacy.mjs +37 -0
- package/bootstrap/host/eliscript-cli.mjs +53 -33
- package/bootstrap/host/eliscript-cli.mjs.map +1 -0
- package/bootstrap/host/project-cli-legacy.mjs +295 -0
- package/bootstrap/host/project-cli.mjs +74 -289
- package/bootstrap/host/project-cli.mjs.map +1 -0
- package/bootstrap/host/project-legacy.mjs +1080 -0
- package/bootstrap/host/project.mjs +210 -1060
- package/bootstrap/host/project.mjs.map +1 -0
- package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
- package/bootstrap/runtime/memory.eli +30379 -0
- package/browser/host.mjs +89 -0
- package/compiler/eliscript-analyzer.el +371 -4
- package/compiler/eliscript-cli.el +84 -1
- package/compiler/eliscript-emitter.el +1189 -256
- package/compiler/eliscript-expander.el +147 -10
- package/compiler/eliscript-ir-emitter.el +725 -208
- package/compiler/eliscript-lower.el +127 -1
- package/compiler/eliscript-portable.el +177 -51
- package/compiler/eliscript-project.el +20 -2
- package/compiler/eliscript-reader.el +141 -57
- package/compiler/eliscript-source-map.el +26 -12
- package/compiler/eliscript-transient-analysis.el +382 -19
- package/dist/backends/async.mjs +561 -0
- package/dist/backends/async.mjs.macro-origins.json +1 -0
- package/dist/backends/async.mjs.map +1 -0
- package/dist/backends/binary.mjs +381 -0
- package/dist/backends/binary.mjs.macro-origins.json +1 -0
- package/dist/backends/binary.mjs.map +1 -0
- package/dist/backends/capabilities.mjs +237 -0
- package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
- package/dist/backends/capabilities.mjs.map +1 -0
- package/dist/backends/elf.mjs +540 -0
- package/dist/backends/elf.mjs.macro-origins.json +1 -0
- package/dist/backends/elf.mjs.map +1 -0
- package/dist/backends/managed.mjs +10616 -0
- package/dist/backends/managed.mjs.macro-origins.json +1 -0
- package/dist/backends/managed.mjs.map +1 -0
- package/dist/backends/memory.mjs +278 -0
- package/dist/backends/memory.mjs.macro-origins.json +1 -0
- package/dist/backends/memory.mjs.map +1 -0
- package/dist/backends/native.mjs +4099 -0
- package/dist/backends/native.mjs.macro-origins.json +1 -0
- package/dist/backends/native.mjs.map +1 -0
- package/dist/backends/numeric.mjs +2458 -0
- package/dist/backends/numeric.mjs.macro-origins.json +1 -0
- package/dist/backends/numeric.mjs.map +1 -0
- package/dist/backends/optimize.mjs +204 -0
- package/dist/backends/optimize.mjs.macro-origins.json +1 -0
- package/dist/backends/optimize.mjs.map +1 -0
- package/dist/backends/regexp.mjs +2033 -0
- package/dist/backends/regexp.mjs.macro-origins.json +1 -0
- package/dist/backends/regexp.mjs.map +1 -0
- package/dist/backends/sha256.mjs +310 -0
- package/dist/backends/sha256.mjs.macro-origins.json +1 -0
- package/dist/backends/sha256.mjs.map +1 -0
- package/dist/backends/wasm.mjs +2258 -0
- package/dist/backends/wasm.mjs.macro-origins.json +1 -0
- package/dist/backends/wasm.mjs.map +1 -0
- package/dist/bootstrap/analyzer.mjs +1908 -776
- package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +450 -142
- package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +3083 -909
- package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +2887 -1233
- package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +582 -218
- package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +670 -116
- package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +866 -257
- package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/package.json +1 -0
- package/dist/bootstrap/project.mjs +1168 -498
- package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +674 -175
- package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/runtime/math.mjs +1117 -0
- package/dist/bootstrap/runtime/math.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
- package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
- package/dist/bootstrap/source-map.mjs +430 -119
- package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +229 -53
- package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +205 -7
- package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1185 -489
- package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +199 -6478
- package/dist/browser/host.mjs +446 -0
- package/dist/browser/loader.js +1 -0
- package/dist/browser/loader.mjs +231 -0
- package/dist/browser/worker.mjs +60 -0
- package/dist/compiler-artifact.json +1 -0
- package/dist/host/compiler-session.mjs +2980 -0
- package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-session.mjs.map +1 -0
- package/dist/host/compiler-tools.mjs +1084 -0
- package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-tools.mjs.map +1 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
- package/dist/literal-sources/runtime/core/collection.eli +579 -0
- package/dist/literal-sources/runtime/core/data-text.eli +290 -0
- package/dist/literal-sources/runtime/core/data.eli +22 -0
- package/dist/literal-sources/runtime/core/identifier.eli +44 -0
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
- package/dist/literal-sources/runtime/core/list.eli +19 -0
- package/dist/literal-sources/runtime/core/map.eli +9 -0
- package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
- package/dist/literal-sources/runtime/core/metadata.eli +23 -0
- package/dist/literal-sources/runtime/core/object.eli +8 -0
- package/dist/literal-sources/runtime/core/order.eli +123 -0
- package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
- package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
- package/dist/literal-sources/runtime/core/protocol.eli +28 -0
- package/dist/literal-sources/runtime/core/queue.eli +9 -0
- package/dist/literal-sources/runtime/core/record.eli +191 -0
- package/dist/literal-sources/runtime/core/regex.eli +158 -0
- package/dist/literal-sources/runtime/core/sequence.eli +305 -0
- package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
- package/dist/literal-sources/runtime/core/set.eli +9 -0
- package/dist/literal-sources/runtime/core/sorted.eli +408 -0
- package/dist/literal-sources/runtime/core/text.eli +14 -0
- package/dist/literal-sources/runtime/core/transducer.eli +268 -0
- package/dist/literal-sources/runtime/core/transient.eli +17 -0
- package/dist/literal-sources/runtime/core/truth.eli +4 -0
- package/dist/literal-sources/runtime/core/type.eli +232 -0
- package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
- package/dist/literal-sources/runtime/core/value.eli +19 -0
- package/dist/literal-sources/runtime/core/vector.eli +20 -0
- package/dist/literal-sources/runtime/literals.eli +23 -0
- package/dist/literal-sources/runtime/testing/value.eli +6 -0
- package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
- package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
- package/dist/literal-sources/runtime/wire/schema.eli +193 -0
- package/dist/literal-sources/stdlib/bit.eli +36 -0
- package/dist/literal-sources/stdlib/core/data.eli +306 -0
- package/dist/literal-sources/stdlib/core/object.eli +89 -0
- package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
- package/dist/literal-sources/stdlib/core/set.eli +312 -0
- package/dist/literal-sources/stdlib/core/text.eli +103 -0
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +483 -0
- package/dist/literal-sources/stdlib/managed-literals.eli +1414 -0
- package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
- package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
- package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
- package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
- package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
- package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
- package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
- package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
- package/dist/literal-sources/stdlib/value.eli +325 -0
- package/dist/package.json +10 -0
- package/dist/runtime/math.mjs +1116 -0
- package/dist/runtime/math.mjs.macro-origins.json +1 -0
- package/dist/runtime/math.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +10124 -0
- package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/runtime/unicode-case.mjs +280 -0
- package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case.mjs.map +1 -0
- package/dist/runtime.eli +30379 -0
- package/dist/stage3-release.json +1 -0
- package/editor/README.md +1 -1
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +97 -10
- package/platform/http.mjs +20 -0
- package/runtime/array-text.mjs +159 -0
- package/runtime/core/map-internals.mjs +27 -9
- package/runtime/core/object-impl.mjs +26 -17
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/protocol-impl.mjs +682 -255
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/protocol.mjs +4 -0
- package/runtime/core/record.mjs +23 -2
- package/runtime/core/regex.mjs +4 -0
- package/runtime/core/sorted.mjs +53 -0
- package/runtime/core/text-impl.mjs +167 -48
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/type.mjs +75 -3
- package/runtime/core/vector.mjs +6 -0
- package/runtime/math.eli +429 -0
- package/runtime/math.mjs +1116 -0
- package/runtime/math.mjs.map +1 -0
- package/runtime/number-radix.mjs +105 -0
- package/runtime/unicode-case-data.eli +29 -0
- package/runtime/unicode-case-data.mjs +10124 -0
- package/runtime/unicode-case-data.mjs.map +1 -0
- package/runtime/unicode-case.eli +100 -0
- package/runtime/unicode-case.mjs +280 -0
- package/runtime/unicode-case.mjs.map +1 -0
- package/runtime/wire/http-rpc.mjs +168 -0
- package/runtime/wire/markdown.mjs +196 -0
- package/runtime/wire/schema.mjs +109 -0
- package/stdlib/README.md +54 -0
- package/stdlib/core/protocol.eli +81 -17
- package/stdlib/core/seq.eli +1 -1
- package/stdlib/core/zipper.eli +114 -47
- package/stdlib/gepo.eli +12 -0
- package/stdlib/interop/js.eli +56 -15
- package/stdlib/managed-literal-protocols.eli +483 -0
- package/stdlib/managed-literals.eli +1414 -0
- package/stdlib/managed-protocol-error.eli +32 -0
- package/stdlib/managed-queue-state.eli +65 -0
- package/stdlib/managed-runtime-collection-internals.eli +60 -0
- package/stdlib/managed-runtime-collection.eli +579 -0
- package/stdlib/managed-runtime-data-text.eli +290 -0
- package/stdlib/managed-runtime-data.eli +22 -0
- package/stdlib/managed-runtime-identifier.eli +44 -0
- package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
- package/stdlib/managed-runtime-list.eli +19 -0
- package/stdlib/managed-runtime-literals.eli +23 -0
- package/stdlib/managed-runtime-map.eli +9 -0
- package/stdlib/managed-runtime-metadata-internals.eli +6 -0
- package/stdlib/managed-runtime-metadata.eli +23 -0
- package/stdlib/managed-runtime-object.eli +8 -0
- package/stdlib/managed-runtime-order.eli +123 -0
- package/stdlib/managed-runtime-persistent-kind.eli +28 -0
- package/stdlib/managed-runtime-protocol.eli +28 -0
- package/stdlib/managed-runtime-queue.eli +9 -0
- package/stdlib/managed-runtime-record.eli +191 -0
- package/stdlib/managed-runtime-regex.eli +158 -0
- package/stdlib/managed-runtime-sequence.eli +305 -0
- package/stdlib/managed-runtime-set-algebra.eli +28 -0
- package/stdlib/managed-runtime-set.eli +9 -0
- package/stdlib/managed-runtime-sorted.eli +408 -0
- package/stdlib/managed-runtime-text.eli +14 -0
- package/stdlib/managed-runtime-transducer.eli +268 -0
- package/stdlib/managed-runtime-transient.eli +17 -0
- package/stdlib/managed-runtime-truth.eli +4 -0
- package/stdlib/managed-runtime-type.eli +232 -0
- package/stdlib/managed-runtime-value-internals.eli +13 -0
- package/stdlib/managed-runtime-value.eli +19 -0
- package/stdlib/managed-runtime-vector.eli +20 -0
- package/stdlib/managed-sorted-state.eli +233 -0
- package/stdlib/managed-testing-value.eli +6 -0
- package/stdlib/managed-transient-state.eli +348 -0
- package/stdlib/managed-value-state.eli +153 -0
- package/stdlib/managed-vector-view-state.eli +102 -0
- package/stdlib/managed-wire-http-rpc.eli +362 -0
- package/stdlib/managed-wire-markdown.eli +275 -0
- package/stdlib/managed-wire-schema.eli +193 -0
- package/stdlib/mdp.eli +7 -0
- package/stdlib/mds.eli +4 -0
- package/stdlib/persistent-vector.eli +23 -6
- package/tools/acceptance/check-legacy.mjs +687 -0
- package/tools/acceptance/check.eli +431 -0
- package/tools/acceptance/compile-evidence.el +49 -0
- package/tools/acceptance/finalize-legacy.mjs +498 -0
- package/tools/acceptance/finalize.eli +270 -0
- package/tools/backends/benchmark.mjs +175 -0
- package/tools/backends/build.mjs +135 -0
- package/tools/backends/compile.mjs +94 -0
- package/tools/backends/compiler-bootstrap.mjs +1001 -0
- package/tools/backends/compiler-browser.mjs +361 -0
- package/tools/backends/compiler-build.mjs +1628 -0
- package/tools/backends/compiler-cli-legacy.mjs +334 -0
- package/tools/backends/compiler-cli.mjs +29 -0
- package/tools/backends/compiler-corpus-bit.mjs +234 -0
- package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
- package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
- package/tools/backends/compiler-corpus-debugging.mjs +221 -0
- package/tools/backends/compiler-corpus-emitter.mjs +324 -0
- package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
- package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
- package/tools/backends/compiler-corpus-execution.mjs +3324 -0
- package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
- package/tools/backends/compiler-corpus-generations.mjs +208 -0
- package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
- package/tools/backends/compiler-corpus-host-context.mjs +550 -0
- package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
- package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
- package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
- package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
- package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
- package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
- package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
- package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
- package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
- package/tools/backends/compiler-corpus-matchers.mjs +173 -0
- package/tools/backends/compiler-corpus-original-program.mjs +612 -0
- package/tools/backends/compiler-corpus-process.mjs +765 -0
- package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
- package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
- package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
- package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
- package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
- package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
- package/tools/backends/compiler-corpus-reference.mjs +241 -0
- package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
- package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
- package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
- package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
- package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
- package/tools/backends/compiler-corpus.mjs +2054 -0
- package/tools/backends/compiler-debug.mjs +142 -0
- package/tools/backends/compiler-matrix.mjs +1955 -0
- package/tools/backends/compiler-metadata.mjs +203 -0
- package/tools/backends/compiler-package-browser.mjs +120 -0
- package/tools/backends/compiler-package-legacy.mjs +654 -0
- package/tools/backends/compiler-package.mjs +464 -0
- package/tools/backends/compiler-project.mjs +126 -0
- package/tools/backends/compiler-session.mjs +843 -0
- package/tools/backends/compiler-sha256.mjs +152 -0
- package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
- package/tools/backends/compiler-worker.mjs +573 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
- package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
- package/tools/backends/dist/record-grid.mjs +1256 -0
- package/tools/backends/dist/record-grid.mjs.map +1 -0
- package/tools/backends/dist/release-cli.mjs +460 -0
- package/tools/backends/dist/release-cli.mjs.map +1 -0
- package/tools/backends/dist/run-artifact.mjs +517 -0
- package/tools/backends/dist/run-artifact.mjs.map +1 -0
- package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
- package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
- package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
- package/tools/backends/managed-foreign-binding.mjs +497 -0
- package/tools/backends/managed-host-legacy.mjs +1181 -0
- package/tools/backends/managed-host-lifecycle.mjs +310 -0
- package/tools/backends/managed-host-object-provider.mjs +155 -0
- package/tools/backends/managed-host-object-realm.mjs +797 -0
- package/tools/backends/managed-host-proxy.mjs +71 -0
- package/tools/backends/managed-host-runtime.mjs +5868 -0
- package/tools/backends/managed-host.mjs +716 -0
- package/tools/backends/managed-module-graph-legacy.mjs +308 -0
- package/tools/backends/managed-module-graph.mjs +694 -0
- package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
- package/tools/backends/managed-runtime.mjs +939 -0
- package/tools/backends/managed-source-view-legacy.mjs +332 -0
- package/tools/backends/managed-source-view.mjs +959 -0
- package/tools/backends/memory-runtime.mjs +100 -0
- package/tools/backends/native-benchmark.mjs +88 -0
- package/tools/backends/native-managed-runtime.mjs +677 -0
- package/tools/backends/native-memory.mjs +768 -0
- package/tools/backends/native-node-memory.mjs +142 -0
- package/tools/backends/native-node-runner.mjs +99 -0
- package/tools/backends/native-node-watchdog.mjs +19 -0
- package/tools/backends/native-node-worker.mjs +75 -0
- package/tools/backends/stage3-targets.mjs +486 -0
- package/tools/bootstrap-command.el +13 -0
- package/tools/bootstrap-runtime.el +101 -0
- package/tools/bootstrap-seed.el +55 -0
- package/tools/project/check-cli.eli +31 -0
- package/tools/project/project-cli.eli +42 -0
- package/tools/project/project.eli +122 -0
- package/tools/runtime/unicode-case-profiles.mjs +13 -0
- package/tools/runtime/unicode-case-runtime.el +57 -0
- package/tools/testing/source-debugging-corpus-host.eli +16 -0
- package/tools/testing/source-debugging.eli +139 -0
- package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
- package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
- package/tools/testing/stdlib-bit.eli +104 -0
- package/tools/testing/stdlib-bit.mjs +255 -0
- package/bin/eliscript-bootstrap +0 -15
package/dist/bootstrap/ir.mjs
CHANGED
|
@@ -1,167 +1,718 @@
|
|
|
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("ir_format"); return ir_format; }
|
|
5
|
+
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("ir_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("ir_version"); return ir_version; }
|
|
8
|
+
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("ir_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("ir_max_depth"); return ir_max_depth; }
|
|
11
|
+
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("ir_max_depth"); 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("node_kinds"); return node_kinds; }
|
|
14
|
+
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("node_kinds"); 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("ir_filename_key"); return ir_filename_key; }
|
|
17
|
+
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("ir_filename_key"); 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("ir_body_key"); return ir_body_key; }
|
|
20
|
+
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("ir_body_key"); 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("ir_kind_key"); return ir_kind_key; }
|
|
23
|
+
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("ir_kind_key"); 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("ir_span_key"); return ir_span_key; }
|
|
26
|
+
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("ir_span_key"); 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("ir_value_key"); return ir_value_key; }
|
|
29
|
+
function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("ir_value_key"); 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("ir_children_key"); return ir_children_key; }
|
|
32
|
+
function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("ir_children_key"); 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("ir_properties_key"); return ir_properties_key; }
|
|
35
|
+
function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("ir_properties_key"); 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("canonical_node_kinds"); return canonical_node_kinds; }
|
|
38
|
+
function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("canonical_node_kinds"); 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("fail"); return fail; }
|
|
41
|
+
function __eliscript_tdz_write_12(__eliscript_tdz_value_12) { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("fail"); 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("make_schema_error"); return make_schema_error; }
|
|
44
|
+
function __eliscript_tdz_write_13(__eliscript_tdz_value_13) { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("make_schema_error"); 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("schema_fail"); return schema_fail; }
|
|
47
|
+
function __eliscript_tdz_write_14(__eliscript_tdz_value_14) { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("schema_fail"); return __eliscript_const_error(); }
|
|
48
|
+
var __eliscript_tdz_ready_15;
|
|
49
|
+
function __eliscript_tdz_read_15() { if (__eliscript_tdz_ready_15 !== true) __eliscript_tdz_error("array_p"); return array_p; }
|
|
50
|
+
function __eliscript_tdz_write_15(__eliscript_tdz_value_15) { if (__eliscript_tdz_ready_15 !== true) __eliscript_tdz_error("array_p"); return __eliscript_const_error(); }
|
|
51
|
+
var __eliscript_tdz_ready_16;
|
|
52
|
+
function __eliscript_tdz_read_16() { if (__eliscript_tdz_ready_16 !== true) __eliscript_tdz_error("dense_json_array_p"); return dense_json_array_p; }
|
|
53
|
+
function __eliscript_tdz_write_16(__eliscript_tdz_value_16) { if (__eliscript_tdz_ready_16 !== true) __eliscript_tdz_error("dense_json_array_p"); return __eliscript_const_error(); }
|
|
54
|
+
var __eliscript_tdz_ready_17;
|
|
55
|
+
function __eliscript_tdz_read_17() { if (__eliscript_tdz_ready_17 !== true) __eliscript_tdz_error("plain_record_keys"); return plain_record_keys; }
|
|
56
|
+
function __eliscript_tdz_write_17(__eliscript_tdz_value_17) { if (__eliscript_tdz_ready_17 !== true) __eliscript_tdz_error("plain_record_keys"); return __eliscript_const_error(); }
|
|
57
|
+
var __eliscript_tdz_ready_18;
|
|
58
|
+
function __eliscript_tdz_read_18() { if (__eliscript_tdz_ready_18 !== true) __eliscript_tdz_error("has_own"); return has_own; }
|
|
59
|
+
function __eliscript_tdz_write_18(__eliscript_tdz_value_18) { if (__eliscript_tdz_ready_18 !== true) __eliscript_tdz_error("has_own"); return __eliscript_const_error(); }
|
|
60
|
+
var __eliscript_tdz_ready_19;
|
|
61
|
+
function __eliscript_tdz_read_19() { if (__eliscript_tdz_ready_19 !== true) __eliscript_tdz_error("finite_number_p"); return finite_number_p; }
|
|
62
|
+
function __eliscript_tdz_write_19(__eliscript_tdz_value_19) { if (__eliscript_tdz_ready_19 !== true) __eliscript_tdz_error("finite_number_p"); return __eliscript_const_error(); }
|
|
63
|
+
var __eliscript_tdz_ready_20;
|
|
64
|
+
function __eliscript_tdz_read_20() { if (__eliscript_tdz_ready_20 !== true) __eliscript_tdz_error("non_negative_integer_p"); return non_negative_integer_p; }
|
|
65
|
+
function __eliscript_tdz_write_20(__eliscript_tdz_value_20) { if (__eliscript_tdz_ready_20 !== true) __eliscript_tdz_error("non_negative_integer_p"); return __eliscript_const_error(); }
|
|
66
|
+
var __eliscript_tdz_ready_21;
|
|
67
|
+
function __eliscript_tdz_read_21() { if (__eliscript_tdz_ready_21 !== true) __eliscript_tdz_error("positive_integer_p"); return positive_integer_p; }
|
|
68
|
+
function __eliscript_tdz_write_21(__eliscript_tdz_value_21) { if (__eliscript_tdz_ready_21 !== true) __eliscript_tdz_error("positive_integer_p"); return __eliscript_const_error(); }
|
|
69
|
+
var __eliscript_tdz_ready_22;
|
|
70
|
+
function __eliscript_tdz_read_22() { if (__eliscript_tdz_ready_22 !== true) __eliscript_tdz_error("parse_json"); return parse_json; }
|
|
71
|
+
function __eliscript_tdz_write_22(__eliscript_tdz_value_22) { if (__eliscript_tdz_ready_22 !== true) __eliscript_tdz_error("parse_json"); return __eliscript_const_error(); }
|
|
72
|
+
var __eliscript_tdz_ready_23;
|
|
73
|
+
function __eliscript_tdz_read_23() { if (__eliscript_tdz_ready_23 !== true) __eliscript_tdz_error("node_kind_set"); return node_kind_set; }
|
|
74
|
+
function __eliscript_tdz_write_23(__eliscript_tdz_value_23) { if (__eliscript_tdz_ready_23 !== true) __eliscript_tdz_error("node_kind_set"); return __eliscript_const_error(); }
|
|
75
|
+
var __eliscript_tdz_ready_24;
|
|
76
|
+
function __eliscript_tdz_read_24() { if (__eliscript_tdz_ready_24 !== true) __eliscript_tdz_error("canonical_json_array_join"); return canonical_json_array_join; }
|
|
77
|
+
function __eliscript_tdz_write_24(__eliscript_tdz_value_24) { if (__eliscript_tdz_ready_24 !== true) __eliscript_tdz_error("canonical_json_array_join"); return __eliscript_const_error(); }
|
|
78
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
79
|
+
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=";
|
|
2
80
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
81
|
+
const __eliscript_number_intrinsic = globalThis.Number;
|
|
82
|
+
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
83
|
+
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
84
|
+
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
85
|
+
const __eliscript_numeric_error = globalThis.TypeError;
|
|
86
|
+
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
87
|
+
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
88
|
+
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
89
|
+
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
90
|
+
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
91
|
+
const __eliscript_numeric_primitive = (value) => {
|
|
92
|
+
if (!__eliscript_numeric_object(value)) return value;
|
|
93
|
+
const exotic = value[__eliscript_numeric_symbol];
|
|
94
|
+
if (exotic !== void 0 && exotic !== null) {
|
|
95
|
+
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
96
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
97
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
98
|
+
}
|
|
99
|
+
for (let index = 0; index < 2; index++) {
|
|
100
|
+
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
101
|
+
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
102
|
+
const result = __eliscript_numeric_apply(method, value, []);
|
|
103
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
107
|
+
};
|
|
108
|
+
const __eliscript_to_number = (value) => {
|
|
109
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
110
|
+
if (typeof primitive === "string") {
|
|
111
|
+
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
112
|
+
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
113
|
+
let first = 2;
|
|
114
|
+
while (first < text.length && text[first] === "0") first++;
|
|
115
|
+
if (first === text.length) return 0;
|
|
116
|
+
const prefix = text[1];
|
|
117
|
+
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
118
|
+
if (text.length - first > limit) return 1 / 0;
|
|
119
|
+
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
120
|
+
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return __eliscript_number_intrinsic(primitive);
|
|
124
|
+
};
|
|
125
|
+
const __eliscript_numeric = (value) => {
|
|
126
|
+
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
127
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
128
|
+
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
129
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
130
|
+
};
|
|
131
|
+
const __eliscript_implicit_number = (value) => {
|
|
132
|
+
if (typeof value === "number") return value;
|
|
133
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
134
|
+
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
135
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
136
|
+
};
|
|
137
|
+
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
138
|
+
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
139
|
+
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
140
|
+
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
141
|
+
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
142
|
+
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
143
|
+
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
144
|
+
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
145
|
+
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
146
|
+
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
147
|
+
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
148
|
+
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
149
|
+
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
150
|
+
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
151
|
+
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
152
|
+
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
153
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
154
|
+
if (operator === "<") return left < right;
|
|
155
|
+
if (operator === "<=") return left <= right;
|
|
156
|
+
if (operator === ">") return left > right;
|
|
157
|
+
return left >= right;
|
|
158
|
+
}
|
|
159
|
+
let a = __eliscript_numeric_primitive(left);
|
|
160
|
+
let b = __eliscript_numeric_primitive(right);
|
|
161
|
+
const x = typeof a, y = typeof b;
|
|
162
|
+
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
163
|
+
a = __eliscript_numeric(a);
|
|
164
|
+
b = __eliscript_numeric(b);
|
|
165
|
+
}
|
|
166
|
+
if (operator === "<") return a < b;
|
|
167
|
+
if (operator === "<=") return a <= b;
|
|
168
|
+
if (operator === ">") return a > b;
|
|
169
|
+
return a >= b;
|
|
170
|
+
};
|
|
3
171
|
|
|
4
172
|
const ir_format = "eliscript-ir";
|
|
173
|
+
__eliscript_tdz_ready_0 = true;
|
|
5
174
|
const ir_version = 1;
|
|
175
|
+
__eliscript_tdz_ready_1 = true;
|
|
6
176
|
const ir_max_depth = 512;
|
|
177
|
+
__eliscript_tdz_ready_2 = true;
|
|
7
178
|
const node_kinds = (globalThis.Object)["freeze"](["module-declaration", "import-declaration", "import-default", "import-namespace", "import-named", "variable-declaration", "function-declaration", "export-declaration", "export-default", "expression-statement", "parameter-binding", "array-binding-pattern", "map-binding-pattern", "map-binding-entry", "binding-name", "binding-hole", "reference", "literal", "array-literal", "persistent-list-literal", "persistent-vector-literal", "persistent-map-literal", "persistent-set-literal", "persistent-queue-literal", "quoted-literal", "function-expression", "await-expression", "throw-expression", "try-expression", "catch-clause", "catch-binding", "finally-clause", "conditional", "conditional-sugar", "conditional-chain", "conditional-clause", "sequence", "lexical-bindings", "lexical-binding", "assignment", "assignment-pair", "loop", "binding-loop", "recur", "short-circuit", "intrinsic", "object-literal", "object-property", "property-read", "property-write", "method-call", "constructor-call", "raw-javascript", "print", "string-concat", "invoke", "apply-call", "call"]);
|
|
8
|
-
|
|
9
|
-
const
|
|
179
|
+
__eliscript_tdz_ready_3 = true;
|
|
180
|
+
const ir_filename_key = "filename";
|
|
181
|
+
__eliscript_tdz_ready_4 = true;
|
|
182
|
+
const ir_body_key = "body";
|
|
183
|
+
__eliscript_tdz_ready_5 = true;
|
|
184
|
+
const ir_kind_key = "kind";
|
|
185
|
+
__eliscript_tdz_ready_6 = true;
|
|
186
|
+
const ir_span_key = "span";
|
|
187
|
+
__eliscript_tdz_ready_7 = true;
|
|
188
|
+
const ir_value_key = "value";
|
|
189
|
+
__eliscript_tdz_ready_8 = true;
|
|
190
|
+
const ir_children_key = "children";
|
|
191
|
+
__eliscript_tdz_ready_9 = true;
|
|
192
|
+
const ir_properties_key = "properties";
|
|
193
|
+
__eliscript_tdz_ready_10 = true;
|
|
194
|
+
const canonical_node_kinds = ((kinds) => {
|
|
195
|
+
((__eliscript_tdz_read_3()))["forEach"](((kind) => {
|
|
196
|
+
return (kinds)["set"](kind, kind);
|
|
197
|
+
}));
|
|
198
|
+
return kinds;
|
|
199
|
+
})(new (globalThis.Map)());
|
|
200
|
+
__eliscript_tdz_ready_11 = true;
|
|
201
|
+
const fail = ((message) => {
|
|
202
|
+
return ((__eliscript_value_1) => { throw __eliscript_value_1; })(new (Error)(message));
|
|
203
|
+
});
|
|
204
|
+
__eliscript_tdz_ready_12 = true;
|
|
205
|
+
const make_schema_error = ((message, options) => {
|
|
206
|
+
{
|
|
207
|
+
const __eliscript_value_2 = ((options === undefined) ? new (Error)(message) : new (Error)(message, options));
|
|
208
|
+
{
|
|
209
|
+
let error = __eliscript_value_2;
|
|
210
|
+
((error)["eliscriptDiagnostic"] = ({"format": "eliscript-diagnostic", "version": 1, "code": "ELI-I0001", "severity": "error", "phase": "ir-schema", "message": message}));
|
|
211
|
+
return error;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
__eliscript_tdz_ready_13 = true;
|
|
216
|
+
const schema_fail = ((message) => {
|
|
217
|
+
return ((__eliscript_value_3) => { throw __eliscript_value_3; })((__eliscript_tdz_read_13())(message, undefined));
|
|
218
|
+
});
|
|
219
|
+
__eliscript_tdz_ready_14 = true;
|
|
10
220
|
const array_p = Array.isArray;
|
|
11
|
-
|
|
12
|
-
const
|
|
221
|
+
__eliscript_tdz_ready_15 = true;
|
|
222
|
+
const dense_json_array_p = ((value) => {
|
|
223
|
+
if (((!__eliscript_truthy(Array.isArray(value))) || (!__eliscript_truthy(Object.is(Object.getPrototypeOf(value), globalThis.Array.prototype))) || ((__eliscript_value_4, __eliscript_value_5) => (__eliscript_value_4 !== __eliscript_value_5))(((Object.getOwnPropertySymbols(value)) ?? []).length, 0))) {
|
|
224
|
+
return false;
|
|
225
|
+
} else {
|
|
226
|
+
{
|
|
227
|
+
const __eliscript_value_6 = Object.getOwnPropertyNames(value);
|
|
228
|
+
{
|
|
229
|
+
let names = __eliscript_value_6;
|
|
230
|
+
if ((((__eliscript_value_7, __eliscript_value_8) => (__eliscript_value_7 !== __eliscript_value_8))(((names) ?? []).length, ((value)["length"] + 1)) || ((__eliscript_value_9, __eliscript_value_10) => (__eliscript_value_9 !== __eliscript_value_10))((names)[__eliscript_numeric_decrement(((names) ?? []).length)], "length"))) {
|
|
231
|
+
return false;
|
|
232
|
+
} else {
|
|
233
|
+
{
|
|
234
|
+
const __eliscript_value_11 = 0;
|
|
235
|
+
const __eliscript_value_12 = true;
|
|
236
|
+
{
|
|
237
|
+
let index = __eliscript_value_11;
|
|
238
|
+
let valid = __eliscript_value_12;
|
|
239
|
+
while (__eliscript_truthy(((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? __eliscript_numeric_relation("<", index, (value)["length"]) : __eliscript_value_13))(valid))) {
|
|
240
|
+
{
|
|
241
|
+
const __eliscript_value_14 = (String)(index);
|
|
242
|
+
{
|
|
243
|
+
let name = __eliscript_value_14;
|
|
244
|
+
if (((__eliscript_value_15, __eliscript_value_16) => (__eliscript_value_15 !== __eliscript_value_16))((names)[index], name)) {
|
|
245
|
+
((valid = false));
|
|
246
|
+
} else {
|
|
247
|
+
{
|
|
248
|
+
const __eliscript_value_17 = Object.getOwnPropertyDescriptor(value, name);
|
|
249
|
+
{
|
|
250
|
+
let descriptor = __eliscript_value_17;
|
|
251
|
+
if ((!__eliscript_truthy(((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? ((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? Object.hasOwn(descriptor, "value") : __eliscript_value_19))((Boolean)((descriptor)["enumerable"])) : __eliscript_value_18))((Boolean)(descriptor))))) {
|
|
252
|
+
((valid = false));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
((index = (index + 1)));
|
|
260
|
+
}
|
|
261
|
+
return valid;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
__eliscript_tdz_ready_16 = true;
|
|
270
|
+
const plain_record_keys = ((value) => {
|
|
271
|
+
if (__eliscript_truthy(((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? __eliscript_value_20 : ((__eliscript_value_21) => (__eliscript_truthy(__eliscript_value_21) ? __eliscript_value_21 : Array.isArray(value)))(((__eliscript_value_22, __eliscript_value_23) => (__eliscript_value_22 !== __eliscript_value_23))(typeof value, "object"))))((value === null)))) {
|
|
272
|
+
return null;
|
|
273
|
+
} else {
|
|
274
|
+
{
|
|
275
|
+
const __eliscript_value_24 = Object.getPrototypeOf(value);
|
|
276
|
+
{
|
|
277
|
+
let prototype = __eliscript_value_24;
|
|
278
|
+
if (((!__eliscript_truthy(Object.is(prototype, globalThis.Object.prototype))) && (!(prototype === null)))) {
|
|
279
|
+
return null;
|
|
280
|
+
} else {
|
|
281
|
+
if (((__eliscript_value_25, __eliscript_value_26) => (__eliscript_value_25 !== __eliscript_value_26))(((Object.getOwnPropertySymbols(value)) ?? []).length, 0)) {
|
|
282
|
+
return null;
|
|
283
|
+
} else {
|
|
284
|
+
{
|
|
285
|
+
const __eliscript_value_27 = Object.getOwnPropertyNames(value);
|
|
286
|
+
const __eliscript_value_28 = 0;
|
|
287
|
+
const __eliscript_value_29 = true;
|
|
288
|
+
{
|
|
289
|
+
let names = __eliscript_value_27;
|
|
290
|
+
let index = __eliscript_value_28;
|
|
291
|
+
let valid = __eliscript_value_29;
|
|
292
|
+
while (__eliscript_truthy(((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? __eliscript_numeric_relation("<", index, ((names) ?? []).length) : __eliscript_value_30))(valid))) {
|
|
293
|
+
{
|
|
294
|
+
const __eliscript_value_31 = Object.getOwnPropertyDescriptor(value, (names)[index]);
|
|
295
|
+
{
|
|
296
|
+
let descriptor = __eliscript_value_31;
|
|
297
|
+
if ((!__eliscript_truthy(((__eliscript_value_32) => (__eliscript_truthy(__eliscript_value_32) ? ((__eliscript_value_33) => (__eliscript_truthy(__eliscript_value_33) ? Object.hasOwn(descriptor, "value") : __eliscript_value_33))((Boolean)((descriptor)["enumerable"])) : __eliscript_value_32))((Boolean)(descriptor))))) {
|
|
298
|
+
((valid = false));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
((index = (index + 1)));
|
|
303
|
+
}
|
|
304
|
+
if (__eliscript_truthy(valid)) {
|
|
305
|
+
return (names)["sort"]();
|
|
306
|
+
} else {
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
__eliscript_tdz_ready_17 = true;
|
|
13
318
|
const has_own = Object.hasOwn;
|
|
319
|
+
__eliscript_tdz_ready_18 = true;
|
|
14
320
|
const finite_number_p = Number.isFinite;
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
321
|
+
__eliscript_tdz_ready_19 = true;
|
|
322
|
+
const non_negative_integer_p = ((value) => {
|
|
323
|
+
return ((__eliscript_value_34) => (__eliscript_truthy(__eliscript_value_34) ? __eliscript_numeric_relation(">=", value, 0) : __eliscript_value_34))(Number.isSafeInteger(value));
|
|
324
|
+
});
|
|
325
|
+
__eliscript_tdz_ready_20 = true;
|
|
326
|
+
const positive_integer_p = ((value) => {
|
|
327
|
+
return ((__eliscript_value_35) => (__eliscript_truthy(__eliscript_value_35) ? __eliscript_numeric_relation(">=", value, 1) : __eliscript_value_35))(Number.isSafeInteger(value));
|
|
328
|
+
});
|
|
329
|
+
__eliscript_tdz_ready_21 = true;
|
|
330
|
+
const parse_json = ((source, reject) => {
|
|
331
|
+
return (() => {
|
|
332
|
+
try {
|
|
333
|
+
return JSON.parse(source);
|
|
334
|
+
} catch (error) {
|
|
335
|
+
{
|
|
336
|
+
const __eliscript_value_36 = "invalid canonical IR JSON";
|
|
337
|
+
{
|
|
338
|
+
let message = __eliscript_value_36;
|
|
339
|
+
if (__eliscript_truthy(Object.is(reject, (__eliscript_tdz_read_14())))) {
|
|
340
|
+
return ((__eliscript_value_37) => { throw __eliscript_value_37; })((__eliscript_tdz_read_13())(message, ({"cause": error})));
|
|
341
|
+
} else {
|
|
342
|
+
return reject(message);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
})();
|
|
348
|
+
});
|
|
349
|
+
__eliscript_tdz_ready_22 = true;
|
|
350
|
+
const node_kind_set = new (globalThis.Set)((__eliscript_tdz_read_3()));
|
|
351
|
+
__eliscript_tdz_ready_23 = true;
|
|
19
352
|
function require_closed_record(value, expected, label) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
353
|
+
{
|
|
354
|
+
const __eliscript_value_38 = (__eliscript_tdz_read_17())(value);
|
|
355
|
+
{
|
|
356
|
+
let keys = __eliscript_value_38;
|
|
357
|
+
if ((keys === null)) {
|
|
358
|
+
(__eliscript_tdz_read_14())((String(label) + String(" must be a plain data object")));
|
|
359
|
+
}
|
|
360
|
+
if ((!((keys)["length"] === (expected)["length"]))) {
|
|
361
|
+
(__eliscript_tdz_read_14())((String(label) + String(" has unknown or missing fields")));
|
|
362
|
+
}
|
|
363
|
+
(expected)["forEach"](((key) => {
|
|
364
|
+
if ((!__eliscript_truthy((keys)["includes"](key)))) {
|
|
365
|
+
return (__eliscript_tdz_read_14())((String(label) + String(" has unknown or missing fields")));
|
|
366
|
+
} else {
|
|
367
|
+
return null;
|
|
368
|
+
}
|
|
369
|
+
}));
|
|
370
|
+
return keys;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const canonical_json_array_join = (Array.prototype)["join"];
|
|
375
|
+
__eliscript_tdz_ready_24 = true;
|
|
376
|
+
function make_canonical_json_sink() {
|
|
377
|
+
return ({"chunks": [], "parts": [], "length": 0});
|
|
378
|
+
}
|
|
379
|
+
function canonical_json_flush(sink) {
|
|
380
|
+
if (__eliscript_numeric_relation(">", (((sink)["parts"]) ?? []).length, 0)) {
|
|
381
|
+
((sink)["chunks"])["push"](__eliscript_at(Reflect, "apply")((__eliscript_tdz_read_24()), (sink)["parts"], [""]));
|
|
382
|
+
((sink)["parts"] = []);
|
|
383
|
+
return ((sink)["length"] = 0);
|
|
384
|
+
} else {
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function canonical_json_token(sink, token) {
|
|
389
|
+
{
|
|
390
|
+
const __eliscript_value_39 = ((token) ?? []).length;
|
|
391
|
+
{
|
|
392
|
+
let length = __eliscript_value_39;
|
|
393
|
+
if (__eliscript_numeric_relation(">", ((sink)["length"] + length), 65536)) {
|
|
394
|
+
canonical_json_flush(sink);
|
|
395
|
+
}
|
|
396
|
+
if (__eliscript_numeric_relation(">=", length, 65536)) {
|
|
397
|
+
return ((sink)["chunks"])["push"](token);
|
|
398
|
+
} else {
|
|
399
|
+
((sink)["parts"])["push"](token);
|
|
400
|
+
return ((sink)["length"] = ((sink)["length"] + length));
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function canonical_json_finish(sink) {
|
|
406
|
+
canonical_json_flush(sink);
|
|
407
|
+
return __eliscript_at(Reflect, "apply")((__eliscript_tdz_read_24()), (sink)["chunks"], [""]);
|
|
408
|
+
}
|
|
409
|
+
function canonical_json_array(value, path, active, depth, collect_output = null, sink = null) {
|
|
410
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_16())(value)))) {
|
|
411
|
+
(__eliscript_tdz_read_14())((String(path) + String(" must be a dense plain array")));
|
|
412
|
+
}
|
|
413
|
+
if (__eliscript_truthy((active)["has"](value))) {
|
|
414
|
+
(__eliscript_tdz_read_14())((String(path) + String(" contains a cyclic JSON value")));
|
|
415
|
+
}
|
|
32
416
|
(active)["add"](value);
|
|
33
|
-
|
|
34
|
-
((
|
|
35
|
-
|
|
36
|
-
|
|
417
|
+
{
|
|
418
|
+
const __eliscript_value_40 = (!(collect_output === false));
|
|
419
|
+
const __eliscript_value_41 = 0;
|
|
420
|
+
{
|
|
421
|
+
let collect = __eliscript_value_40;
|
|
422
|
+
let index = __eliscript_value_41;
|
|
423
|
+
if (__eliscript_truthy(collect)) {
|
|
424
|
+
canonical_json_token(sink, "[");
|
|
425
|
+
}
|
|
426
|
+
while (__eliscript_numeric_relation("<", index, (value)["length"])) {
|
|
427
|
+
if (__eliscript_truthy(((__eliscript_value_42) => (__eliscript_truthy(__eliscript_value_42) ? __eliscript_numeric_relation(">", index, 0) : __eliscript_value_42))(collect))) {
|
|
428
|
+
canonical_json_token(sink, ",");
|
|
429
|
+
}
|
|
430
|
+
canonical_json_value(((((value) ?? [])[index]) ?? null), (String(path) + String("[") + String(index) + String("]")), active, (depth + 1), collect, sink);
|
|
37
431
|
((index = (index + 1)));
|
|
38
432
|
}
|
|
39
|
-
return null;
|
|
40
|
-
})();
|
|
41
|
-
(active)["delete"](value);
|
|
42
|
-
return (String("[") + String((parts)["join"](",")) + String("]"));
|
|
43
|
-
})([], 0);
|
|
44
|
-
}
|
|
45
|
-
function canonical_json_record(value, path, active, depth) {
|
|
46
|
-
return ((keys) => {
|
|
47
|
-
(__eliscript_truthy((keys === null)) ? schema_fail((String(path) + String(" must be a plain data object"))) : null);
|
|
48
|
-
(__eliscript_truthy((active)["has"](value)) ? schema_fail((String(path) + String(" contains a cyclic JSON value"))) : null);
|
|
49
|
-
(active)["add"](value);
|
|
50
|
-
return ((parts) => {
|
|
51
|
-
(keys)["forEach"]((key) => {
|
|
52
|
-
return (parts)["push"]((String(JSON.stringify(key)) + String(":") + String(canonical_json_value((value)[key], (String(path) + String(".") + String(key)), active, (depth + 1)))));
|
|
53
|
-
});
|
|
54
433
|
(active)["delete"](value);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
434
|
+
if (__eliscript_truthy(collect)) {
|
|
435
|
+
return canonical_json_token(sink, "]");
|
|
436
|
+
} else {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function canonical_json_record(value, path, active, depth, collect_output = null, sink = null) {
|
|
443
|
+
{
|
|
444
|
+
const __eliscript_value_43 = (__eliscript_tdz_read_17())(value);
|
|
445
|
+
{
|
|
446
|
+
let keys = __eliscript_value_43;
|
|
447
|
+
if ((keys === null)) {
|
|
448
|
+
(__eliscript_tdz_read_14())((String(path) + String(" must be a plain data object")));
|
|
449
|
+
}
|
|
450
|
+
if (__eliscript_truthy((active)["has"](value))) {
|
|
451
|
+
(__eliscript_tdz_read_14())((String(path) + String(" contains a cyclic JSON value")));
|
|
452
|
+
}
|
|
453
|
+
(active)["add"](value);
|
|
454
|
+
{
|
|
455
|
+
const __eliscript_value_44 = (!(collect_output === false));
|
|
456
|
+
const __eliscript_value_45 = 0;
|
|
457
|
+
{
|
|
458
|
+
let collect = __eliscript_value_44;
|
|
459
|
+
let index = __eliscript_value_45;
|
|
460
|
+
if (__eliscript_truthy(collect)) {
|
|
461
|
+
canonical_json_token(sink, "{");
|
|
462
|
+
}
|
|
463
|
+
(keys)["forEach"](((key) => {
|
|
464
|
+
if (__eliscript_truthy(collect)) {
|
|
465
|
+
if (__eliscript_numeric_relation(">", index, 0)) {
|
|
466
|
+
canonical_json_token(sink, ",");
|
|
467
|
+
}
|
|
468
|
+
canonical_json_token(sink, JSON.stringify(key));
|
|
469
|
+
canonical_json_token(sink, ":");
|
|
470
|
+
}
|
|
471
|
+
canonical_json_value((value)[key], (String(path) + String(".") + String(key)), active, (depth + 1), collect, sink);
|
|
472
|
+
return ((index = (index + 1)));
|
|
473
|
+
}));
|
|
474
|
+
(active)["delete"](value);
|
|
475
|
+
if (__eliscript_truthy(collect)) {
|
|
476
|
+
return canonical_json_token(sink, "}");
|
|
477
|
+
} else {
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
function canonical_json_value(value, path, active, depth, collect_output = null, sink = null) {
|
|
486
|
+
if (__eliscript_numeric_relation(">", depth, (__eliscript_tdz_read_2()))) {
|
|
487
|
+
(__eliscript_tdz_read_14())((String(path) + String(" exceeds IR nesting depth ") + String((__eliscript_tdz_read_2()))));
|
|
488
|
+
}
|
|
489
|
+
{
|
|
490
|
+
const __eliscript_value_46 = typeof value;
|
|
491
|
+
{
|
|
492
|
+
let type = __eliscript_value_46;
|
|
493
|
+
{
|
|
494
|
+
let collect = (!(collect_output === false));
|
|
495
|
+
let output = (__eliscript_truthy(collect) ? ((__eliscript_value_47) => (__eliscript_truthy(__eliscript_value_47) ? __eliscript_value_47 : make_canonical_json_sink()))(sink) : null);
|
|
496
|
+
if ((value === null)) {
|
|
497
|
+
if (__eliscript_truthy(collect)) {
|
|
498
|
+
canonical_json_token(output, "null");
|
|
499
|
+
}
|
|
500
|
+
} else {
|
|
501
|
+
if ((type === "boolean")) {
|
|
502
|
+
if (__eliscript_truthy(collect)) {
|
|
503
|
+
canonical_json_token(output, (__eliscript_truthy(value) ? "true" : "false"));
|
|
504
|
+
}
|
|
505
|
+
} else {
|
|
506
|
+
if ((type === "number")) {
|
|
507
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_19())(value)))) {
|
|
508
|
+
(__eliscript_tdz_read_14())((String(path) + String(" must contain only finite numbers")));
|
|
509
|
+
}
|
|
510
|
+
if (__eliscript_truthy(collect)) {
|
|
511
|
+
canonical_json_token(output, (__eliscript_truthy(Object.is(value, __eliscript_numeric_neg(0))) ? "-0" : JSON.stringify(value)));
|
|
512
|
+
}
|
|
513
|
+
} else {
|
|
514
|
+
if ((type === "string")) {
|
|
515
|
+
if (__eliscript_truthy(collect)) {
|
|
516
|
+
canonical_json_token(output, JSON.stringify(value));
|
|
517
|
+
}
|
|
518
|
+
} else {
|
|
519
|
+
if (__eliscript_truthy((__eliscript_tdz_read_15())(value))) {
|
|
520
|
+
canonical_json_array(value, path, active, depth, collect, output);
|
|
521
|
+
} else {
|
|
522
|
+
if ((type === "object")) {
|
|
523
|
+
canonical_json_record(value, path, active, depth, collect, output);
|
|
524
|
+
} else {
|
|
525
|
+
(__eliscript_tdz_read_14())((String(path) + String(" contains unsupported JSON type ") + String(type)));
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
if (__eliscript_truthy(((__eliscript_value_48) => (__eliscript_truthy(__eliscript_value_48) ? (!__eliscript_truthy(sink)) : __eliscript_value_48))(collect))) {
|
|
533
|
+
return canonical_json_finish(output);
|
|
534
|
+
} else {
|
|
535
|
+
return null;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
67
540
|
}
|
|
68
541
|
function canonical_json(value) {
|
|
69
|
-
return canonical_json_value(value, "$", new globalThis.Set(), 0);
|
|
542
|
+
return canonical_json_value(value, "$", new (globalThis.Set)(), 0);
|
|
70
543
|
}
|
|
71
544
|
function validate_span(span) {
|
|
72
545
|
require_closed_record(span, ["column", "end", "endColumn", "endLine", "filename", "line", "start"], "IR span");
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
546
|
+
if ((!(typeof span.filename === "string"))) {
|
|
547
|
+
(__eliscript_tdz_read_14())("IR span filename must be a string");
|
|
548
|
+
}
|
|
549
|
+
(["start", "end"])["forEach"](((key) => {
|
|
550
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_20())((span)[key])))) {
|
|
551
|
+
return (__eliscript_tdz_read_14())((String("IR span ") + String(key) + String(" must be a non-negative integer")));
|
|
552
|
+
} else {
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
555
|
+
}));
|
|
556
|
+
(["line", "column", "endLine", "endColumn"])["forEach"](((key) => {
|
|
557
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_21())((span)[key])))) {
|
|
558
|
+
return (__eliscript_tdz_read_14())((String("IR span ") + String(key) + String(" must be a positive integer")));
|
|
559
|
+
} else {
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
}));
|
|
563
|
+
if (__eliscript_numeric_relation(">", (span)["start"], (span)["end"])) {
|
|
564
|
+
(__eliscript_tdz_read_14())("IR span start must not exceed end");
|
|
565
|
+
}
|
|
81
566
|
return span;
|
|
82
567
|
}
|
|
83
568
|
function validate_node(node, active, depth) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
569
|
+
if (__eliscript_numeric_relation(">", depth, (__eliscript_tdz_read_2()))) {
|
|
570
|
+
(__eliscript_tdz_read_14())((String("IR node exceeds nesting depth ") + String((__eliscript_tdz_read_2()))));
|
|
571
|
+
}
|
|
572
|
+
if (__eliscript_truthy((active)["has"](node))) {
|
|
573
|
+
(__eliscript_tdz_read_14())("IR node children must not contain a cycle");
|
|
574
|
+
}
|
|
575
|
+
{
|
|
576
|
+
const __eliscript_value_49 = (__eliscript_tdz_read_17())(node);
|
|
577
|
+
{
|
|
578
|
+
let keys = __eliscript_value_49;
|
|
579
|
+
if ((keys === null)) {
|
|
580
|
+
(__eliscript_tdz_read_14())("IR node must be a plain data object");
|
|
581
|
+
}
|
|
582
|
+
{
|
|
583
|
+
const __eliscript_value_50 = (__eliscript_truthy((keys)["includes"]("properties")) ? ["children", "kind", "properties", "span", "value"] : ["children", "kind", "span", "value"]);
|
|
584
|
+
{
|
|
585
|
+
let expected = __eliscript_value_50;
|
|
586
|
+
require_closed_record(node, expected, "IR node");
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if ((!__eliscript_truthy(((__eliscript_value_51) => (__eliscript_truthy(__eliscript_value_51) ? node_kind_p((node)["kind"]) : __eliscript_value_51))((typeof node.kind === "string"))))) {
|
|
592
|
+
(__eliscript_tdz_read_14())((String("unknown Eliscript IR node kind: ") + String((node)["kind"])));
|
|
593
|
+
}
|
|
93
594
|
validate_span((node)["span"]);
|
|
94
|
-
(
|
|
95
|
-
|
|
595
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_16())((node)["children"])))) {
|
|
596
|
+
(__eliscript_tdz_read_14())("IR node children must be a dense plain array");
|
|
597
|
+
}
|
|
598
|
+
if (__eliscript_truthy((__eliscript_tdz_read_18())(node, "properties"))) {
|
|
599
|
+
if (((__eliscript_tdz_read_17())((node)["properties"]) === null)) {
|
|
600
|
+
(__eliscript_tdz_read_14())("IR node properties must be a plain data object");
|
|
601
|
+
}
|
|
602
|
+
}
|
|
96
603
|
(active)["add"](node);
|
|
97
|
-
((node)["children"])["forEach"]((child) => {
|
|
604
|
+
((node)["children"])["forEach"](((child) => {
|
|
98
605
|
return validate_node(child, active, (depth + 1));
|
|
99
|
-
});
|
|
606
|
+
}));
|
|
100
607
|
(active)["delete"](node);
|
|
101
608
|
return node;
|
|
102
609
|
}
|
|
103
610
|
function validate_program(program) {
|
|
104
611
|
require_closed_record(program, ["body", "filename"], "IR program");
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
612
|
+
if ((!(typeof program.filename === "string"))) {
|
|
613
|
+
(__eliscript_tdz_read_14())("IR program filename must be a string");
|
|
614
|
+
}
|
|
615
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_16())((program)["body"])))) {
|
|
616
|
+
(__eliscript_tdz_read_14())("IR program body must be a dense plain array");
|
|
617
|
+
}
|
|
618
|
+
{
|
|
619
|
+
const __eliscript_value_52 = new (globalThis.Set)();
|
|
620
|
+
{
|
|
621
|
+
let active = __eliscript_value_52;
|
|
622
|
+
((program)["body"])["forEach"](((node) => {
|
|
623
|
+
return validate_node(node, active, 0);
|
|
624
|
+
}));
|
|
625
|
+
}
|
|
626
|
+
}
|
|
112
627
|
return program;
|
|
113
628
|
}
|
|
114
629
|
function validate_document(document) {
|
|
115
630
|
require_closed_record(document, ["format", "program", "version"], "IR document");
|
|
116
|
-
(
|
|
117
|
-
|
|
631
|
+
if ((!((document)["format"] === (__eliscript_tdz_read_0())))) {
|
|
632
|
+
(__eliscript_tdz_read_14())((String("unsupported IR format: ") + String((document)["format"])));
|
|
633
|
+
}
|
|
634
|
+
if ((!((document)["version"] === (__eliscript_tdz_read_1())))) {
|
|
635
|
+
(__eliscript_tdz_read_14())((String("unsupported IR version: ") + String((document)["version"])));
|
|
636
|
+
}
|
|
118
637
|
validate_program((document)["program"]);
|
|
119
638
|
return document;
|
|
120
639
|
}
|
|
121
640
|
function serialize_program(program) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
641
|
+
{
|
|
642
|
+
const __eliscript_value_53 = ({"format": (__eliscript_tdz_read_0()), "version": (__eliscript_tdz_read_1()), "program": program});
|
|
643
|
+
{
|
|
644
|
+
let document = __eliscript_value_53;
|
|
645
|
+
validate_document(document);
|
|
646
|
+
return canonical_json(document);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
function validate_serializable_program(program) {
|
|
651
|
+
{
|
|
652
|
+
const __eliscript_value_54 = ({"format": (__eliscript_tdz_read_0()), "version": (__eliscript_tdz_read_1()), "program": program});
|
|
653
|
+
{
|
|
654
|
+
let document = __eliscript_value_54;
|
|
655
|
+
validate_document(document);
|
|
656
|
+
canonical_json_value(document, "$", new (globalThis.Set)(), 0, false);
|
|
657
|
+
return program;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
126
660
|
}
|
|
127
661
|
function deserialize_program(source) {
|
|
128
|
-
(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
662
|
+
if ((!(typeof source === "string"))) {
|
|
663
|
+
(__eliscript_tdz_read_14())("canonical IR source must be a string");
|
|
664
|
+
}
|
|
665
|
+
{
|
|
666
|
+
let document = (__eliscript_tdz_read_22())(source, (__eliscript_tdz_read_14()));
|
|
667
|
+
let _validated = validate_document(document);
|
|
668
|
+
let canonical = canonical_json(document);
|
|
669
|
+
if ((!(source === canonical))) {
|
|
670
|
+
(__eliscript_tdz_read_14())("IR source is valid JSON but not canonical IR JSON");
|
|
671
|
+
}
|
|
672
|
+
return (document)["program"];
|
|
673
|
+
}
|
|
139
674
|
}
|
|
140
675
|
function node_kind_p(kind) {
|
|
141
|
-
return (
|
|
676
|
+
return ((__eliscript_tdz_read_23()))["has"](kind);
|
|
142
677
|
}
|
|
143
678
|
function reference_node_kind_p(kind) {
|
|
144
|
-
return (
|
|
679
|
+
return ((__eliscript_tdz_read_3()))["includes"](kind);
|
|
145
680
|
}
|
|
146
681
|
function make_program(filename, body) {
|
|
147
|
-
(
|
|
148
|
-
|
|
149
|
-
|
|
682
|
+
if ((!__eliscript_truthy(Array.isArray(body)))) {
|
|
683
|
+
(__eliscript_tdz_read_12())("IR program body must be an array");
|
|
684
|
+
}
|
|
685
|
+
if ((!__eliscript_truthy((body)["every"](node_p)))) {
|
|
686
|
+
(__eliscript_tdz_read_12())("IR program body must contain only IR nodes");
|
|
687
|
+
}
|
|
688
|
+
return ({[(__eliscript_tdz_read_4())]: filename, [(__eliscript_tdz_read_5())]: body});
|
|
150
689
|
}
|
|
151
690
|
function node_p(value) {
|
|
152
|
-
return ((
|
|
691
|
+
return ((__eliscript_value_55) => (__eliscript_truthy(__eliscript_value_55) ? ((__eliscript_value_56) => (__eliscript_truthy(__eliscript_value_56) ? node_kind_p((value)["kind"]) : __eliscript_value_56))((typeof value === "object")) : __eliscript_value_55))(value);
|
|
153
692
|
}
|
|
154
693
|
function reference_node_p(value) {
|
|
155
|
-
return ((
|
|
694
|
+
return ((__eliscript_value_57) => (__eliscript_truthy(__eliscript_value_57) ? ((__eliscript_value_58) => (__eliscript_truthy(__eliscript_value_58) ? reference_node_kind_p((value)["kind"]) : __eliscript_value_58))((typeof value === "object")) : __eliscript_value_57))(value);
|
|
156
695
|
}
|
|
157
696
|
function make_node(kind, span, value, children, properties) {
|
|
158
|
-
(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
(
|
|
163
|
-
|
|
164
|
-
|
|
697
|
+
if ((!__eliscript_truthy(node_kind_p(kind)))) {
|
|
698
|
+
(__eliscript_tdz_read_12())((String("unknown Eliscript IR node kind: ") + String(kind)));
|
|
699
|
+
}
|
|
700
|
+
if ((!__eliscript_truthy(Array.isArray(children)))) {
|
|
701
|
+
(__eliscript_tdz_read_12())("IR node children must be an array");
|
|
702
|
+
}
|
|
703
|
+
if ((!__eliscript_truthy((children)["every"](node_p)))) {
|
|
704
|
+
(__eliscript_tdz_read_12())("IR node children must all be IR nodes");
|
|
705
|
+
}
|
|
706
|
+
{
|
|
707
|
+
const __eliscript_value_59 = ({[(__eliscript_tdz_read_6())]: ((__eliscript_tdz_read_11()))["get"](kind), [(__eliscript_tdz_read_7())]: span, [(__eliscript_tdz_read_8())]: value, [(__eliscript_tdz_read_9())]: children});
|
|
708
|
+
{
|
|
709
|
+
let node = __eliscript_value_59;
|
|
710
|
+
if (__eliscript_truthy(properties)) {
|
|
711
|
+
((node)[(__eliscript_tdz_read_10())] = properties);
|
|
712
|
+
}
|
|
713
|
+
return node;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
165
716
|
}
|
|
166
717
|
function program_filename(program) {
|
|
167
718
|
return (program)["filename"];
|
|
@@ -185,9 +736,12 @@ function ir_properties(node) {
|
|
|
185
736
|
return (node)["properties"];
|
|
186
737
|
}
|
|
187
738
|
function ir_property(node, name) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
739
|
+
{
|
|
740
|
+
const __eliscript_value_60 = ir_properties(node);
|
|
741
|
+
{
|
|
742
|
+
let properties = __eliscript_value_60;
|
|
743
|
+
return ((__eliscript_value_61) => (__eliscript_truthy(__eliscript_value_61) ? (properties)[name] : __eliscript_value_61))(properties);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
191
746
|
}
|
|
192
|
-
export {ir_format, ir_version, node_kinds, node_kind_p, reference_node_kind_p, node_p, reference_node_p, make_program, make_node, program_filename, program_body, ir_kind, ir_span, ir_value, ir_children, ir_properties, ir_property, serialize_program, deserialize_program};
|
|
193
|
-
//# sourceMappingURL=ir.mjs.map
|
|
747
|
+
export {ir_format, ir_version, node_kinds, node_kind_p, reference_node_kind_p, node_p, reference_node_p, make_program, make_node, program_filename, program_body, ir_kind, ir_span, ir_value, ir_children, ir_properties, ir_property, validate_serializable_program, serialize_program, deserialize_program};
|