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
|
@@ -1,254 +1,661 @@
|
|
|
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("protocol_states"); return protocol_states; }
|
|
5
|
+
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("protocol_states"); 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("protocol_operation_owners"); return protocol_operation_owners; }
|
|
8
|
+
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("protocol_operation_owners"); 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("protocol_method_owners"); return protocol_method_owners; }
|
|
11
|
+
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("protocol_method_owners"); 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("protocol_missing"); return protocol_missing; }
|
|
14
|
+
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("protocol_missing"); 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("protocol_host_categories"); return protocol_host_categories; }
|
|
17
|
+
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("protocol_host_categories"); 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("protocol_definition_format"); return protocol_definition_format; }
|
|
20
|
+
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("protocol_definition_format"); 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("protocol_definition_version"); return protocol_definition_version; }
|
|
23
|
+
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("protocol_definition_version"); 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("protocol_max_operations"); return protocol_max_operations; }
|
|
26
|
+
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("protocol_max_operations"); 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("protocol_symbol"); return protocol_symbol; }
|
|
29
|
+
function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("protocol_symbol"); 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("protocol_array_QMARK_"); return protocol_array_QMARK_; }
|
|
32
|
+
function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("protocol_array_QMARK_"); 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("protocol_map"); return protocol_map; }
|
|
35
|
+
function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("protocol_map"); 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("protocol_null_object"); return protocol_null_object; }
|
|
38
|
+
function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("protocol_null_object"); 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("protocol_own_descriptors"); return protocol_own_descriptors; }
|
|
41
|
+
function __eliscript_tdz_write_12(__eliscript_tdz_value_12) { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("protocol_own_descriptors"); 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("protocol_own_keys"); return protocol_own_keys; }
|
|
44
|
+
function __eliscript_tdz_write_13(__eliscript_tdz_value_13) { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("protocol_own_keys"); 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("protocol_has_own"); return protocol_has_own; }
|
|
47
|
+
function __eliscript_tdz_write_14(__eliscript_tdz_value_14) { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("protocol_has_own"); 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("protocol_property_present"); return protocol_property_present; }
|
|
50
|
+
function __eliscript_tdz_write_15(__eliscript_tdz_value_15) { if (__eliscript_tdz_ready_15 !== true) __eliscript_tdz_error("protocol_property_present"); 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("protocol_property_value"); return protocol_property_value; }
|
|
53
|
+
function __eliscript_tdz_write_16(__eliscript_tdz_value_16) { if (__eliscript_tdz_ready_16 !== true) __eliscript_tdz_error("protocol_property_value"); 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("protocol_host_type"); return protocol_host_type; }
|
|
56
|
+
function __eliscript_tdz_write_17(__eliscript_tdz_value_17) { if (__eliscript_tdz_ready_17 !== true) __eliscript_tdz_error("protocol_host_type"); 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("protocol_exact_prototype"); return protocol_exact_prototype; }
|
|
59
|
+
function __eliscript_tdz_write_18(__eliscript_tdz_value_18) { if (__eliscript_tdz_ready_18 !== true) __eliscript_tdz_error("protocol_exact_prototype"); 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("protocol_object_prototype"); return protocol_object_prototype; }
|
|
62
|
+
function __eliscript_tdz_write_19(__eliscript_tdz_value_19) { if (__eliscript_tdz_ready_19 !== true) __eliscript_tdz_error("protocol_object_prototype"); 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("protocol_get_prototype"); return protocol_get_prototype; }
|
|
65
|
+
function __eliscript_tdz_write_20(__eliscript_tdz_value_20) { if (__eliscript_tdz_ready_20 !== true) __eliscript_tdz_error("protocol_get_prototype"); 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("protocol_freeze"); return protocol_freeze; }
|
|
68
|
+
function __eliscript_tdz_write_21(__eliscript_tdz_value_21) { if (__eliscript_tdz_ready_21 !== true) __eliscript_tdz_error("protocol_freeze"); 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("protocol_define_enumerable"); return protocol_define_enumerable; }
|
|
71
|
+
function __eliscript_tdz_write_22(__eliscript_tdz_value_22) { if (__eliscript_tdz_ready_22 !== true) __eliscript_tdz_error("protocol_define_enumerable"); 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("protocol_define_metadata"); return protocol_define_metadata; }
|
|
74
|
+
function __eliscript_tdz_write_23(__eliscript_tdz_value_23) { if (__eliscript_tdz_ready_23 !== true) __eliscript_tdz_error("protocol_define_metadata"); return __eliscript_const_error(); }
|
|
75
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
76
|
+
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
77
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
78
|
+
const __eliscript_number_intrinsic = globalThis.Number;
|
|
79
|
+
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
80
|
+
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
81
|
+
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
82
|
+
const __eliscript_numeric_error = globalThis.TypeError;
|
|
83
|
+
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
84
|
+
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
85
|
+
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
86
|
+
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
87
|
+
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
88
|
+
const __eliscript_numeric_primitive = (value) => {
|
|
89
|
+
if (!__eliscript_numeric_object(value)) return value;
|
|
90
|
+
const exotic = value[__eliscript_numeric_symbol];
|
|
91
|
+
if (exotic !== void 0 && exotic !== null) {
|
|
92
|
+
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
93
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
94
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
95
|
+
}
|
|
96
|
+
for (let index = 0; index < 2; index++) {
|
|
97
|
+
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
98
|
+
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
99
|
+
const result = __eliscript_numeric_apply(method, value, []);
|
|
100
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
104
|
+
};
|
|
105
|
+
const __eliscript_to_number = (value) => {
|
|
106
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
107
|
+
if (typeof primitive === "string") {
|
|
108
|
+
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
109
|
+
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
110
|
+
let first = 2;
|
|
111
|
+
while (first < text.length && text[first] === "0") first++;
|
|
112
|
+
if (first === text.length) return 0;
|
|
113
|
+
const prefix = text[1];
|
|
114
|
+
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
115
|
+
if (text.length - first > limit) return 1 / 0;
|
|
116
|
+
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
117
|
+
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return __eliscript_number_intrinsic(primitive);
|
|
121
|
+
};
|
|
122
|
+
const __eliscript_numeric = (value) => {
|
|
123
|
+
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
124
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
125
|
+
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
126
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
127
|
+
};
|
|
128
|
+
const __eliscript_implicit_number = (value) => {
|
|
129
|
+
if (typeof value === "number") return value;
|
|
130
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
131
|
+
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
132
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
133
|
+
};
|
|
134
|
+
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
135
|
+
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
136
|
+
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
137
|
+
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
138
|
+
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
139
|
+
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
140
|
+
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
141
|
+
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
142
|
+
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
143
|
+
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
144
|
+
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
145
|
+
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
146
|
+
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
147
|
+
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
148
|
+
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
149
|
+
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
150
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
151
|
+
if (operator === "<") return left < right;
|
|
152
|
+
if (operator === "<=") return left <= right;
|
|
153
|
+
if (operator === ">") return left > right;
|
|
154
|
+
return left >= right;
|
|
155
|
+
}
|
|
156
|
+
let a = __eliscript_numeric_primitive(left);
|
|
157
|
+
let b = __eliscript_numeric_primitive(right);
|
|
158
|
+
const x = typeof a, y = typeof b;
|
|
159
|
+
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
160
|
+
a = __eliscript_numeric(a);
|
|
161
|
+
b = __eliscript_numeric(b);
|
|
162
|
+
}
|
|
163
|
+
if (operator === "<") return a < b;
|
|
164
|
+
if (operator === "<=") return a <= b;
|
|
165
|
+
if (operator === ">") return a > b;
|
|
166
|
+
return a >= b;
|
|
167
|
+
};
|
|
3
168
|
|
|
4
169
|
import {ProtocolDispatchError} from "../../runtime/core/protocol-error.mjs";
|
|
5
|
-
const protocol_states = new WeakMap();
|
|
6
|
-
|
|
170
|
+
const protocol_states = new (globalThis.WeakMap)();
|
|
171
|
+
__eliscript_tdz_ready_0 = true;
|
|
172
|
+
const protocol_operation_owners = new (globalThis.WeakMap)();
|
|
173
|
+
__eliscript_tdz_ready_1 = true;
|
|
174
|
+
const protocol_method_owners = new (globalThis.WeakMap)();
|
|
175
|
+
__eliscript_tdz_ready_2 = true;
|
|
176
|
+
const protocol_missing = globalThis.Symbol("eliscript.protocol.missing");
|
|
177
|
+
__eliscript_tdz_ready_3 = true;
|
|
7
178
|
const protocol_host_categories = ["null", "undefined", "boolean", "number", "bigint", "string", "symbol", "function", "object"];
|
|
179
|
+
__eliscript_tdz_ready_4 = true;
|
|
8
180
|
const protocol_definition_format = "eliscript-protocol-definition";
|
|
181
|
+
__eliscript_tdz_ready_5 = true;
|
|
9
182
|
const protocol_definition_version = 1;
|
|
183
|
+
__eliscript_tdz_ready_6 = true;
|
|
10
184
|
const protocol_max_operations = 1024;
|
|
11
|
-
|
|
185
|
+
__eliscript_tdz_ready_7 = true;
|
|
186
|
+
const protocol_symbol = ((description) => {
|
|
187
|
+
return globalThis.Symbol(description);
|
|
188
|
+
});
|
|
189
|
+
__eliscript_tdz_ready_8 = true;
|
|
12
190
|
const protocol_array_QMARK_ = Array.isArray;
|
|
13
|
-
|
|
14
|
-
const
|
|
191
|
+
__eliscript_tdz_ready_9 = true;
|
|
192
|
+
const protocol_map = (() => {
|
|
193
|
+
return new (globalThis.Map)();
|
|
194
|
+
});
|
|
195
|
+
__eliscript_tdz_ready_10 = true;
|
|
196
|
+
const protocol_null_object = (() => {
|
|
197
|
+
return (globalThis.Object)["create"](null);
|
|
198
|
+
});
|
|
199
|
+
__eliscript_tdz_ready_11 = true;
|
|
15
200
|
const protocol_own_descriptors = Object.getOwnPropertyDescriptors;
|
|
201
|
+
__eliscript_tdz_ready_12 = true;
|
|
16
202
|
const protocol_own_keys = Reflect.ownKeys;
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
203
|
+
__eliscript_tdz_ready_13 = true;
|
|
204
|
+
const protocol_has_own = ((value, key) => {
|
|
205
|
+
return __eliscript_at(((globalThis.Object)["prototype"])["hasOwnProperty"], "call")(value, key);
|
|
206
|
+
});
|
|
207
|
+
__eliscript_tdz_ready_14 = true;
|
|
208
|
+
const protocol_property_present = ((value, key) => {
|
|
209
|
+
if (((value === null) || (value === undefined))) {
|
|
210
|
+
return false;
|
|
211
|
+
} else {
|
|
212
|
+
return (globalThis.Reflect)["has"](globalThis.Object(value), key);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
__eliscript_tdz_ready_15 = true;
|
|
216
|
+
const protocol_property_value = ((value, key) => {
|
|
217
|
+
return (globalThis.Object(value))[key];
|
|
218
|
+
});
|
|
219
|
+
__eliscript_tdz_ready_16 = true;
|
|
220
|
+
const protocol_host_type = ((value) => {
|
|
221
|
+
return typeof value;
|
|
222
|
+
});
|
|
223
|
+
__eliscript_tdz_ready_17 = true;
|
|
224
|
+
const protocol_exact_prototype = ((value, missing) => {
|
|
225
|
+
if ((((typeof value === "object") && (!(value === null))) || (typeof value === "function"))) {
|
|
226
|
+
return (globalThis.Object)["getPrototypeOf"](value);
|
|
227
|
+
} else {
|
|
228
|
+
return missing;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
__eliscript_tdz_ready_18 = true;
|
|
22
232
|
const protocol_object_prototype = Object.prototype;
|
|
233
|
+
__eliscript_tdz_ready_19 = true;
|
|
23
234
|
const protocol_get_prototype = Object.getPrototypeOf;
|
|
235
|
+
__eliscript_tdz_ready_20 = true;
|
|
24
236
|
const protocol_freeze = Object.freeze;
|
|
25
|
-
|
|
26
|
-
const
|
|
237
|
+
__eliscript_tdz_ready_21 = true;
|
|
238
|
+
const protocol_define_enumerable = ((target, key, value) => {
|
|
239
|
+
(globalThis.Object)["defineProperty"](target, key, ({"value": value, "enumerable": true}));
|
|
240
|
+
return target;
|
|
241
|
+
});
|
|
242
|
+
__eliscript_tdz_ready_22 = true;
|
|
243
|
+
const protocol_define_metadata = ((target, protocol, operation, slot) => {
|
|
244
|
+
(globalThis.Object)["defineProperties"](target, ({"protocol": ({"value": protocol}), "operation": ({"value": operation}), "slot": ({"value": slot})}));
|
|
245
|
+
return target;
|
|
246
|
+
});
|
|
247
|
+
__eliscript_tdz_ready_23 = true;
|
|
27
248
|
function protocol_fail(message) {
|
|
28
|
-
return ((__eliscript_value_1) => { throw __eliscript_value_1; })(new globalThis.TypeError(message));
|
|
249
|
+
return ((__eliscript_value_1) => { throw __eliscript_value_1; })(new (globalThis.TypeError)(message));
|
|
29
250
|
}
|
|
30
251
|
function protocol_state(protocol) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
252
|
+
{
|
|
253
|
+
const __eliscript_value_2 = ((__eliscript_tdz_read_0()))["get"](protocol);
|
|
254
|
+
{
|
|
255
|
+
let state = __eliscript_value_2;
|
|
256
|
+
if ((state === undefined)) {
|
|
257
|
+
return protocol_fail("expected an Eliscript protocol");
|
|
258
|
+
} else {
|
|
259
|
+
return state;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
34
263
|
}
|
|
35
264
|
function normalize_name(value, label) {
|
|
36
|
-
|
|
265
|
+
if (((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "string")) || (((value) ?? []).length === 0))) {
|
|
266
|
+
return protocol_fail((String(label) + String(" must be a non-empty string")));
|
|
267
|
+
} else {
|
|
268
|
+
return value;
|
|
269
|
+
}
|
|
37
270
|
}
|
|
38
271
|
function normalize_protocol_operations(operations) {
|
|
39
|
-
(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
272
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_9())(operations)))) {
|
|
273
|
+
protocol_fail("protocol operations must be a non-empty dense array");
|
|
274
|
+
}
|
|
275
|
+
{
|
|
276
|
+
const __eliscript_value_3 = ((operations) ?? []).length;
|
|
277
|
+
{
|
|
278
|
+
let length = __eliscript_value_3;
|
|
279
|
+
if ((length === 0)) {
|
|
280
|
+
protocol_fail("protocol operations must be a non-empty dense array");
|
|
281
|
+
}
|
|
282
|
+
if (__eliscript_numeric_relation(">", length, (__eliscript_tdz_read_7()))) {
|
|
283
|
+
protocol_fail((String("protocol operations exceed ") + String((__eliscript_tdz_read_7()))));
|
|
284
|
+
}
|
|
285
|
+
{
|
|
286
|
+
let descriptors = (__eliscript_tdz_read_12())(operations);
|
|
287
|
+
let keys = (__eliscript_tdz_read_13())(descriptors);
|
|
288
|
+
let normalized = [];
|
|
289
|
+
let index = 0;
|
|
290
|
+
if (((__eliscript_value_4, __eliscript_value_5) => (__eliscript_value_4 !== __eliscript_value_5))(((keys) ?? []).length, (length + 1))) {
|
|
291
|
+
protocol_fail("protocol operations must be a dense array with no extra properties");
|
|
292
|
+
}
|
|
293
|
+
while (__eliscript_numeric_relation("<", index, length)) {
|
|
294
|
+
{
|
|
295
|
+
const __eliscript_value_6 = ((descriptors)[(String(index))] ?? undefined);
|
|
296
|
+
{
|
|
297
|
+
let descriptor = __eliscript_value_6;
|
|
298
|
+
if (((descriptor === undefined) || (!__eliscript_truthy((__eliscript_tdz_read_14())(descriptor, "value"))) || (!__eliscript_truthy(((descriptor)["enumerable"] ?? false))))) {
|
|
299
|
+
protocol_fail("protocol operations must contain enumerable data values");
|
|
300
|
+
}
|
|
301
|
+
(normalized)["push"](normalize_name((descriptor)["value"], "protocol operation"));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
((index = (index + 1)));
|
|
305
|
+
}
|
|
306
|
+
return normalized;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
66
310
|
}
|
|
67
311
|
function protocol_definition_field(descriptors, name) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
312
|
+
{
|
|
313
|
+
const __eliscript_value_7 = ((descriptors)[name] ?? undefined);
|
|
314
|
+
{
|
|
315
|
+
let descriptor = __eliscript_value_7;
|
|
316
|
+
if (((descriptor === undefined) || (!__eliscript_truthy((__eliscript_tdz_read_14())(descriptor, "value"))) || (!__eliscript_truthy(((descriptor)["enumerable"] ?? false))))) {
|
|
317
|
+
protocol_fail((String("protocol definition field ") + String(name) + String(" must be an enumerable data property")));
|
|
318
|
+
}
|
|
319
|
+
return (descriptor)["value"];
|
|
320
|
+
}
|
|
321
|
+
}
|
|
72
322
|
}
|
|
73
323
|
function normalize_protocol_definition(definition) {
|
|
74
|
-
(__eliscript_truthy(((
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
324
|
+
if (__eliscript_truthy(((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? __eliscript_value_8 : ((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? __eliscript_value_9 : (__eliscript_tdz_read_9())(definition)))((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(definition) === "object")))))((definition === null)))) {
|
|
325
|
+
protocol_fail("protocol definition must be a plain object");
|
|
326
|
+
}
|
|
327
|
+
{
|
|
328
|
+
const __eliscript_value_10 = (__eliscript_tdz_read_20())(definition);
|
|
329
|
+
{
|
|
330
|
+
let prototype = __eliscript_value_10;
|
|
331
|
+
if ((((__eliscript_value_11, __eliscript_value_12) => (__eliscript_value_11 !== __eliscript_value_12))(prototype, (__eliscript_tdz_read_19())) && (!(prototype === null)))) {
|
|
332
|
+
protocol_fail("protocol definition must be a plain object");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
{
|
|
337
|
+
let descriptors = (__eliscript_tdz_read_12())(definition);
|
|
338
|
+
let keys = (__eliscript_tdz_read_13())(descriptors);
|
|
339
|
+
if (((__eliscript_value_13, __eliscript_value_14) => (__eliscript_value_13 !== __eliscript_value_14))(((keys) ?? []).length, 4)) {
|
|
340
|
+
protocol_fail("protocol definition must contain exactly format, version, name, and operations");
|
|
341
|
+
}
|
|
342
|
+
{
|
|
343
|
+
const __eliscript_value_15 = protocol_definition_field(descriptors, "format");
|
|
344
|
+
const __eliscript_value_16 = protocol_definition_field(descriptors, "version");
|
|
345
|
+
const __eliscript_value_17 = protocol_definition_field(descriptors, "name");
|
|
346
|
+
const __eliscript_value_18 = protocol_definition_field(descriptors, "operations");
|
|
347
|
+
{
|
|
348
|
+
let format = __eliscript_value_15;
|
|
349
|
+
let version = __eliscript_value_16;
|
|
350
|
+
let name = __eliscript_value_17;
|
|
351
|
+
let operations = __eliscript_value_18;
|
|
352
|
+
if (((__eliscript_value_19, __eliscript_value_20) => (__eliscript_value_19 !== __eliscript_value_20))(format, (__eliscript_tdz_read_5()))) {
|
|
353
|
+
protocol_fail((String("unsupported protocol definition format ") + String(format)));
|
|
354
|
+
}
|
|
355
|
+
if (((__eliscript_value_21, __eliscript_value_22) => (__eliscript_value_21 !== __eliscript_value_22))(version, (__eliscript_tdz_read_6()))) {
|
|
356
|
+
protocol_fail((String("unsupported protocol definition version ") + String(version)));
|
|
357
|
+
}
|
|
358
|
+
return ({"name": normalize_name(name, "protocol name"), "operations": normalize_protocol_operations(operations)});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
90
362
|
}
|
|
91
363
|
function operation_record(protocol, operation) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
364
|
+
{
|
|
365
|
+
let state = protocol_state(protocol);
|
|
366
|
+
let record = ((state)["operations"])["get"](operation);
|
|
367
|
+
if ((record === undefined)) {
|
|
368
|
+
return protocol_fail((String("protocol ") + String((protocol)["name"]) + String(" has no operation ") + String(operation)));
|
|
369
|
+
} else {
|
|
370
|
+
return record;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
97
373
|
}
|
|
98
374
|
function protocol_host_category(value) {
|
|
99
|
-
|
|
375
|
+
if ((value === null)) {
|
|
376
|
+
return "null";
|
|
377
|
+
} else {
|
|
378
|
+
return (__eliscript_tdz_read_17())(value);
|
|
379
|
+
}
|
|
100
380
|
}
|
|
101
381
|
function known_host_category_QMARK_(category) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
382
|
+
{
|
|
383
|
+
const __eliscript_value_23 = 0;
|
|
384
|
+
const __eliscript_value_24 = false;
|
|
385
|
+
{
|
|
386
|
+
let index = __eliscript_value_23;
|
|
387
|
+
let found = __eliscript_value_24;
|
|
388
|
+
while ((__eliscript_numeric_relation("<", index, (((__eliscript_tdz_read_4())) ?? []).length) && (!__eliscript_truthy(found)))) {
|
|
389
|
+
if ((category === (((((__eliscript_tdz_read_4())) ?? [])[index]) ?? null))) {
|
|
390
|
+
((found = true));
|
|
391
|
+
}
|
|
106
392
|
((index = (index + 1)));
|
|
107
393
|
}
|
|
108
|
-
return
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
})(0, false);
|
|
394
|
+
return found;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
112
397
|
}
|
|
113
398
|
function normalize_implementations(protocol, implementations) {
|
|
114
|
-
(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
399
|
+
if (((implementations === null) || (!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(implementations) === "object")))) {
|
|
400
|
+
protocol_fail((String("protocol ") + String((protocol)["name"]) + String(" implementations must be an object")));
|
|
401
|
+
}
|
|
402
|
+
{
|
|
403
|
+
let descriptors = (__eliscript_tdz_read_12())(implementations);
|
|
404
|
+
let keys = (__eliscript_tdz_read_13())(descriptors);
|
|
405
|
+
let normalized = (__eliscript_tdz_read_11())();
|
|
406
|
+
let index = 0;
|
|
407
|
+
if ((((keys) ?? []).length === 0)) {
|
|
408
|
+
protocol_fail((String("protocol ") + String((protocol)["name"]) + String(" extension must implement at least one operation")));
|
|
409
|
+
}
|
|
410
|
+
while (__eliscript_numeric_relation("<", index, ((keys) ?? []).length)) {
|
|
411
|
+
{
|
|
412
|
+
let key = ((((keys) ?? [])[index]) ?? null);
|
|
413
|
+
let descriptor = (descriptors)[key];
|
|
414
|
+
if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(key) === "string"))) {
|
|
415
|
+
protocol_fail((String("protocol ") + String((protocol)["name"]) + String(" implementation names must be strings")));
|
|
416
|
+
}
|
|
417
|
+
operation_record(protocol, key);
|
|
418
|
+
if (((!__eliscript_truthy((__eliscript_tdz_read_14())(descriptor, "value"))) || (!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((descriptor)["value"]) === "function")))) {
|
|
419
|
+
protocol_fail((String("protocol ") + String((protocol)["name"]) + String("/") + String(key) + String(" implementation must be a function")));
|
|
420
|
+
}
|
|
421
|
+
(__eliscript_tdz_read_22())(normalized, key, (descriptor)["value"]);
|
|
422
|
+
}
|
|
423
|
+
((index = (index + 1)));
|
|
424
|
+
}
|
|
425
|
+
return (__eliscript_tdz_read_21())(normalized);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function merge_implementations(current, incoming) {
|
|
429
|
+
{
|
|
430
|
+
const __eliscript_value_25 = (__eliscript_tdz_read_11())();
|
|
431
|
+
const __eliscript_value_26 = null;
|
|
432
|
+
{
|
|
433
|
+
let merged = __eliscript_value_25;
|
|
434
|
+
let copy = __eliscript_value_26;
|
|
435
|
+
((copy = ((source) => {
|
|
436
|
+
if ((!(source == null))) {
|
|
437
|
+
{
|
|
438
|
+
const __eliscript_value_27 = Object.keys((source) ?? {});
|
|
439
|
+
const __eliscript_value_28 = 0;
|
|
440
|
+
{
|
|
441
|
+
let keys = __eliscript_value_27;
|
|
442
|
+
let index = __eliscript_value_28;
|
|
443
|
+
while (__eliscript_numeric_relation("<", index, ((keys) ?? []).length)) {
|
|
444
|
+
{
|
|
445
|
+
const __eliscript_value_29 = ((((keys) ?? [])[index]) ?? null);
|
|
446
|
+
{
|
|
447
|
+
let key = __eliscript_value_29;
|
|
448
|
+
(__eliscript_tdz_read_22())(merged, key, (source)[key]);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
133
451
|
((index = (index + 1)));
|
|
134
452
|
}
|
|
135
453
|
return null;
|
|
136
|
-
}
|
|
137
|
-
return protocol_freeze(normalized);
|
|
138
|
-
})();
|
|
139
|
-
})(0);
|
|
140
|
-
})(protocol_null_object());
|
|
141
|
-
})(protocol_own_keys(descriptors));
|
|
142
|
-
})(protocol_own_descriptors(implementations));
|
|
143
|
-
}
|
|
144
|
-
function merge_implementations(current, incoming) {
|
|
145
|
-
return ((merged, copy) => {
|
|
146
|
-
((copy = (source) => {
|
|
147
|
-
return (__eliscript_truthy((!__eliscript_truthy((source == null)))) ? ((keys, index) => {
|
|
148
|
-
return (() => {
|
|
149
|
-
while (__eliscript_truthy((index < ((keys) ?? []).length))) {
|
|
150
|
-
((key) => {
|
|
151
|
-
return protocol_define_enumerable(merged, key, (source)[key]);
|
|
152
|
-
})(((((keys) ?? [])[index]) ?? null));
|
|
153
|
-
((index = (index + 1)));
|
|
454
|
+
}
|
|
154
455
|
}
|
|
456
|
+
} else {
|
|
155
457
|
return null;
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
458
|
+
}
|
|
459
|
+
})));
|
|
460
|
+
copy(current);
|
|
461
|
+
copy(incoming);
|
|
462
|
+
return (__eliscript_tdz_read_21())(merged);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
163
465
|
}
|
|
164
466
|
function direct_method(record, receiver) {
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
467
|
+
if (((receiver === null) || (receiver === undefined))) {
|
|
468
|
+
return (__eliscript_tdz_read_3());
|
|
469
|
+
} else {
|
|
470
|
+
{
|
|
471
|
+
const __eliscript_value_30 = (record)["slot"];
|
|
472
|
+
{
|
|
473
|
+
let slot = __eliscript_value_30;
|
|
474
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_15())(receiver, slot)))) {
|
|
475
|
+
return (__eliscript_tdz_read_3());
|
|
476
|
+
} else {
|
|
477
|
+
{
|
|
478
|
+
const __eliscript_value_31 = (__eliscript_tdz_read_16())(receiver, slot);
|
|
479
|
+
{
|
|
480
|
+
let method = __eliscript_value_31;
|
|
481
|
+
if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(method) === "function")) {
|
|
482
|
+
return method;
|
|
483
|
+
} else {
|
|
484
|
+
return null;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
170
492
|
}
|
|
171
493
|
function external_method(state, record, receiver) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
494
|
+
{
|
|
495
|
+
let prototype = (__eliscript_tdz_read_18())(receiver, (__eliscript_tdz_read_3()));
|
|
496
|
+
let exact_implementations = ((prototype === (__eliscript_tdz_read_3())) ? undefined : ((state)["types"])["get"](prototype));
|
|
497
|
+
let exact = ((exact_implementations === undefined) ? undefined : ((exact_implementations)[(record)["name"]] ?? undefined));
|
|
498
|
+
if ((!(exact === undefined))) {
|
|
499
|
+
return exact;
|
|
500
|
+
} else {
|
|
501
|
+
{
|
|
502
|
+
let category_implementations = ((state)["categories"])["get"](protocol_host_category(receiver));
|
|
503
|
+
let category = ((category_implementations === undefined) ? undefined : ((category_implementations)[(record)["name"]] ?? undefined));
|
|
504
|
+
if ((!(category === undefined))) {
|
|
505
|
+
return category;
|
|
506
|
+
} else {
|
|
507
|
+
return (((state)["defaults"])[(record)["name"]] ?? (__eliscript_tdz_read_3()));
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
183
512
|
}
|
|
184
513
|
function dispatch(protocol, record, receiver, arguments$) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return ((
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
})();
|
|
206
|
-
})(({"name": operation, "slot": slot, "method": method}));
|
|
207
|
-
})((...invocation) => {
|
|
208
|
-
(__eliscript_truthy((((invocation) ?? []).length === 0)) ? protocol_fail((String("protocol ") + String(protocol_name) + String("/") + String(operation) + String(" requires a dispatch value"))) : null);
|
|
209
|
-
return dispatch(protocol, (records)["get"](operation), (invocation)[0], (invocation)["slice"](1));
|
|
210
|
-
});
|
|
211
|
-
})(protocol_symbol((String("eliscript.protocol.") + String(protocol_name) + String("/") + String(operation))));
|
|
212
|
-
})(((((protocol_operations) ?? [])[index]) ?? null));
|
|
213
|
-
((index = (index + 1)));
|
|
514
|
+
{
|
|
515
|
+
const __eliscript_value_32 = direct_method(record, receiver);
|
|
516
|
+
{
|
|
517
|
+
let direct = __eliscript_value_32;
|
|
518
|
+
if ((direct === null)) {
|
|
519
|
+
((__eliscript_value_33) => { throw __eliscript_value_33; })(new (ProtocolDispatchError)(protocol, (record)["name"], receiver, "invalid-direct-slot"));
|
|
520
|
+
}
|
|
521
|
+
if (((__eliscript_value_34, __eliscript_value_35) => (__eliscript_value_34 !== __eliscript_value_35))(direct, (__eliscript_tdz_read_3()))) {
|
|
522
|
+
return __eliscript_at(direct, "apply")(receiver, arguments$);
|
|
523
|
+
} else {
|
|
524
|
+
{
|
|
525
|
+
const __eliscript_value_36 = external_method(protocol_state(protocol), record, receiver);
|
|
526
|
+
{
|
|
527
|
+
let external = __eliscript_value_36;
|
|
528
|
+
if ((external === (__eliscript_tdz_read_3()))) {
|
|
529
|
+
return ((__eliscript_value_37) => { throw __eliscript_value_37; })(new (ProtocolDispatchError)(protocol, (record)["name"], receiver));
|
|
530
|
+
} else {
|
|
531
|
+
return external(...[receiver, ...((arguments$) ?? [])]);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
214
534
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function make_protocol_with_slots(name, operations, slots) {
|
|
540
|
+
{
|
|
541
|
+
const __eliscript_value_38 = normalize_name(name, "protocol name");
|
|
542
|
+
const __eliscript_value_39 = normalize_protocol_operations(operations);
|
|
543
|
+
{
|
|
544
|
+
let protocol_name = __eliscript_value_38;
|
|
545
|
+
let protocol_operations = __eliscript_value_39;
|
|
546
|
+
{
|
|
547
|
+
const __eliscript_value_40 = (__eliscript_tdz_read_10())();
|
|
548
|
+
const __eliscript_value_41 = (__eliscript_tdz_read_11())();
|
|
549
|
+
const __eliscript_value_42 = null;
|
|
550
|
+
const __eliscript_value_43 = 0;
|
|
551
|
+
{
|
|
552
|
+
let records = __eliscript_value_40;
|
|
553
|
+
let operation_table = __eliscript_value_41;
|
|
554
|
+
let protocol = __eliscript_value_42;
|
|
555
|
+
let index = __eliscript_value_43;
|
|
556
|
+
while (__eliscript_numeric_relation("<", index, ((protocol_operations) ?? []).length)) {
|
|
557
|
+
{
|
|
558
|
+
const __eliscript_value_44 = ((((protocol_operations) ?? [])[index]) ?? null);
|
|
559
|
+
{
|
|
560
|
+
let operation = __eliscript_value_44;
|
|
561
|
+
if (__eliscript_truthy((records)["has"](operation))) {
|
|
562
|
+
protocol_fail((String("protocol ") + String(protocol_name) + String(" declares duplicate operation ") + String(operation)));
|
|
563
|
+
}
|
|
564
|
+
{
|
|
565
|
+
let slot = ((slots === null) ? (__eliscript_tdz_read_8())((String("eliscript.protocol.") + String(protocol_name) + String("/") + String(operation))) : (slots)[index]);
|
|
566
|
+
let method = ((...invocation) => {
|
|
567
|
+
if ((((invocation) ?? []).length === 0)) {
|
|
568
|
+
protocol_fail((String("protocol ") + String(protocol_name) + String("/") + String(operation) + String(" requires a dispatch value")));
|
|
569
|
+
}
|
|
570
|
+
return dispatch(protocol, (records)["get"](operation), (invocation)[0], (invocation)["slice"](1));
|
|
571
|
+
});
|
|
572
|
+
let record = ({"name": operation, "slot": slot, "method": method});
|
|
573
|
+
(records)["set"](operation, record);
|
|
574
|
+
(__eliscript_tdz_read_22())(operation_table, operation, method);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
((index = (index + 1)));
|
|
579
|
+
}
|
|
580
|
+
((protocol = (__eliscript_tdz_read_21())(({"name": protocol_name, "operations": (__eliscript_tdz_read_21())(operation_table)}))));
|
|
581
|
+
((__eliscript_tdz_read_1()))["set"](operation_table, protocol);
|
|
582
|
+
((index = 0));
|
|
583
|
+
while (__eliscript_numeric_relation("<", index, ((protocol_operations) ?? []).length)) {
|
|
584
|
+
{
|
|
585
|
+
let operation = ((((protocol_operations) ?? [])[index]) ?? null);
|
|
586
|
+
let record = (records)["get"](operation);
|
|
587
|
+
let method = (record)["method"];
|
|
588
|
+
(__eliscript_tdz_read_23())(method, protocol, operation, (record)["slot"]);
|
|
589
|
+
((__eliscript_tdz_read_2()))["set"](method, (__eliscript_tdz_read_21())(({"protocol": protocol, "operation": operation})));
|
|
590
|
+
(__eliscript_tdz_read_21())(method);
|
|
591
|
+
(__eliscript_tdz_read_21())(record);
|
|
592
|
+
}
|
|
593
|
+
((index = (index + 1)));
|
|
594
|
+
}
|
|
595
|
+
((__eliscript_tdz_read_0()))["set"](protocol, ({"operations": records, "types": (__eliscript_tdz_read_10())(), "categories": (__eliscript_tdz_read_10())(), "defaults": (__eliscript_tdz_read_21())((__eliscript_tdz_read_11())())}));
|
|
596
|
+
return protocol;
|
|
233
597
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
function define_protocol(name, operations) {
|
|
603
|
+
return make_protocol_with_slots(name, operations, null);
|
|
240
604
|
}
|
|
241
605
|
function protocol_definition(protocol) {
|
|
242
606
|
protocol_state(protocol);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
607
|
+
{
|
|
608
|
+
const __eliscript_value_45 = (Object.keys(((protocol)["operations"]) ?? {}))["slice"]();
|
|
609
|
+
{
|
|
610
|
+
let operations = __eliscript_value_45;
|
|
611
|
+
(__eliscript_tdz_read_21())(operations);
|
|
612
|
+
return (__eliscript_tdz_read_21())(({"format": (__eliscript_tdz_read_5()), "version": (__eliscript_tdz_read_6()), "name": (protocol)["name"], "operations": operations}));
|
|
613
|
+
}
|
|
614
|
+
}
|
|
247
615
|
}
|
|
248
616
|
function define_protocol_from_definition(definition) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
617
|
+
{
|
|
618
|
+
const __eliscript_value_46 = normalize_protocol_definition(definition);
|
|
619
|
+
{
|
|
620
|
+
let normalized = __eliscript_value_46;
|
|
621
|
+
return define_protocol((normalized)["name"], (normalized)["operations"]);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function materialize_protocol_from_definition(definition, slots) {
|
|
626
|
+
{
|
|
627
|
+
let normalized = normalize_protocol_definition(definition);
|
|
628
|
+
let operations = (normalized)["operations"];
|
|
629
|
+
if ((!__eliscript_truthy(((__eliscript_value_47) => (__eliscript_truthy(__eliscript_value_47) ? (((slots) ?? []).length === ((operations) ?? []).length) : __eliscript_value_47))((__eliscript_tdz_read_9())(slots))))) {
|
|
630
|
+
protocol_fail("protocol slots must be a dense array matching its operations");
|
|
631
|
+
}
|
|
632
|
+
{
|
|
633
|
+
let descriptors = (__eliscript_tdz_read_12())(slots);
|
|
634
|
+
let keys = (__eliscript_tdz_read_13())(descriptors);
|
|
635
|
+
let seen = new (globalThis.Set)();
|
|
636
|
+
let symbols = [];
|
|
637
|
+
let index = 0;
|
|
638
|
+
if ((!(((keys) ?? []).length === (((slots) ?? []).length + 1)))) {
|
|
639
|
+
protocol_fail("protocol slots must be a dense array with no extra properties");
|
|
640
|
+
}
|
|
641
|
+
while (__eliscript_numeric_relation("<", index, ((slots) ?? []).length)) {
|
|
642
|
+
{
|
|
643
|
+
let descriptor = ((descriptors)[(String(index))] ?? undefined);
|
|
644
|
+
let value = ((descriptor === undefined) ? undefined : (descriptor)["value"]);
|
|
645
|
+
if ((!__eliscript_truthy(((__eliscript_value_48) => (__eliscript_truthy(__eliscript_value_48) ? ((__eliscript_value_49) => (__eliscript_truthy(__eliscript_value_49) ? ((__eliscript_value_50) => (__eliscript_truthy(__eliscript_value_50) ? ((__eliscript_tdz_read_17())(value) === "symbol") : __eliscript_value_50))(((descriptor)["enumerable"] ?? false)) : __eliscript_value_49))((__eliscript_tdz_read_14())(descriptor, "value")) : __eliscript_value_48))((!(descriptor === undefined)))))) {
|
|
646
|
+
protocol_fail("protocol slots must contain enumerable Symbol data values");
|
|
647
|
+
}
|
|
648
|
+
if (__eliscript_truthy((seen)["has"](value))) {
|
|
649
|
+
protocol_fail("protocol slots must be distinct Symbols");
|
|
650
|
+
}
|
|
651
|
+
(seen)["add"](value);
|
|
652
|
+
(symbols)["push"](value);
|
|
653
|
+
}
|
|
654
|
+
((index = (index + 1)));
|
|
655
|
+
}
|
|
656
|
+
return make_protocol_with_slots((normalized)["name"], operations, symbols);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
252
659
|
}
|
|
253
660
|
function protocol_method(protocol, operation) {
|
|
254
661
|
return (operation_record(protocol, operation))["method"];
|
|
@@ -257,70 +664,90 @@ function protocol_slot(protocol, operation) {
|
|
|
257
664
|
return (operation_record(protocol, operation))["slot"];
|
|
258
665
|
}
|
|
259
666
|
function extend_protocol_type(protocol, constructor, implementations) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
((
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
667
|
+
{
|
|
668
|
+
const __eliscript_value_51 = protocol_state(protocol);
|
|
669
|
+
{
|
|
670
|
+
let state = __eliscript_value_51;
|
|
671
|
+
if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(constructor) === "function"))) {
|
|
672
|
+
protocol_fail((String("protocol ") + String((protocol)["name"]) + String(" exact type must be a constructor with a prototype")));
|
|
673
|
+
}
|
|
674
|
+
{
|
|
675
|
+
const __eliscript_value_52 = ((constructor)["prototype"] ?? null);
|
|
676
|
+
{
|
|
677
|
+
let prototype = __eliscript_value_52;
|
|
678
|
+
if (((prototype === null) || (!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(prototype) === "object")))) {
|
|
679
|
+
protocol_fail((String("protocol ") + String((protocol)["name"]) + String(" exact type must be a constructor with a prototype")));
|
|
680
|
+
}
|
|
681
|
+
{
|
|
682
|
+
let normalized = normalize_implementations(protocol, implementations);
|
|
683
|
+
let current = ((state)["types"])["get"](prototype);
|
|
684
|
+
((state)["types"])["set"](prototype, merge_implementations(current, normalized));
|
|
685
|
+
}
|
|
686
|
+
return protocol;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
272
691
|
}
|
|
273
692
|
function extend_protocol_category(protocol, category, implementations) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
693
|
+
{
|
|
694
|
+
const __eliscript_value_53 = protocol_state(protocol);
|
|
695
|
+
{
|
|
696
|
+
let state = __eliscript_value_53;
|
|
697
|
+
if ((!__eliscript_truthy(known_host_category_QMARK_(category)))) {
|
|
698
|
+
protocol_fail((String("unknown protocol host category ") + String(category)));
|
|
699
|
+
}
|
|
700
|
+
{
|
|
701
|
+
let normalized = normalize_implementations(protocol, implementations);
|
|
702
|
+
let current = ((state)["categories"])["get"](category);
|
|
703
|
+
((state)["categories"])["set"](category, merge_implementations(current, normalized));
|
|
704
|
+
}
|
|
705
|
+
return protocol;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
283
708
|
}
|
|
284
709
|
function extend_protocol_default(protocol, implementations) {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
})(normalize_implementations(protocol, implementations));
|
|
292
|
-
})(protocol_state(protocol));
|
|
710
|
+
{
|
|
711
|
+
let state = protocol_state(protocol);
|
|
712
|
+
let normalized = normalize_implementations(protocol, implementations);
|
|
713
|
+
((state)["defaults"] = merge_implementations((state)["defaults"], normalized));
|
|
714
|
+
return protocol;
|
|
715
|
+
}
|
|
293
716
|
}
|
|
294
717
|
function implements_protocol_operation_QMARK_(protocol, operation, value) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
718
|
+
{
|
|
719
|
+
let record = operation_record(protocol, operation);
|
|
720
|
+
let direct = direct_method(record, value);
|
|
721
|
+
return ((!(direct === null)) && (((__eliscript_value_54, __eliscript_value_55) => (__eliscript_value_54 !== __eliscript_value_55))(direct, (__eliscript_tdz_read_3())) || ((__eliscript_value_56, __eliscript_value_57) => (__eliscript_value_56 !== __eliscript_value_57))(external_method(protocol_state(protocol), record, value), (__eliscript_tdz_read_3()))));
|
|
722
|
+
}
|
|
300
723
|
}
|
|
301
724
|
function implements_protocol_QMARK_(protocol, value) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
725
|
+
{
|
|
726
|
+
let state = protocol_state(protocol);
|
|
727
|
+
let operations = Object.keys(((protocol)["operations"]) ?? {});
|
|
728
|
+
let index = 0;
|
|
729
|
+
let implemented = true;
|
|
730
|
+
while (__eliscript_truthy(((__eliscript_value_58) => (__eliscript_truthy(__eliscript_value_58) ? implemented : __eliscript_value_58))(__eliscript_numeric_relation("<", index, ((operations) ?? []).length)))) {
|
|
731
|
+
{
|
|
732
|
+
let record = ((state)["operations"])["get"](((((operations) ?? [])[index]) ?? null));
|
|
733
|
+
let direct = direct_method(record, value);
|
|
734
|
+
if (((direct === null) || ((direct === (__eliscript_tdz_read_3())) && (external_method(state, record, value) === (__eliscript_tdz_read_3()))))) {
|
|
735
|
+
((implemented = false));
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
((index = (index + 1)));
|
|
739
|
+
}
|
|
740
|
+
return implemented;
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
function protocol_QMARK_(value) {
|
|
744
|
+
return ((__eliscript_tdz_read_0()))["has"](value);
|
|
745
|
+
}
|
|
746
|
+
function read_protocol_operations_owner(value) {
|
|
747
|
+
return ((__eliscript_tdz_read_1()))["get"](value);
|
|
748
|
+
}
|
|
749
|
+
function read_protocol_method_owner(value) {
|
|
750
|
+
return ((__eliscript_tdz_read_2()))["get"](value);
|
|
324
751
|
}
|
|
325
|
-
export {define_protocol, define_protocol_from_definition, extend_protocol_category, extend_protocol_default, extend_protocol_type, implements_protocol_operation_QMARK_, implements_protocol_QMARK_, protocol_definition, protocol_host_category, protocol_method, protocol_slot};
|
|
752
|
+
export {protocol_QMARK_, define_protocol, define_protocol_from_definition, materialize_protocol_from_definition, read_protocol_operations_owner, read_protocol_method_owner, extend_protocol_category, extend_protocol_default, extend_protocol_type, implements_protocol_operation_QMARK_, implements_protocol_QMARK_, protocol_definition, protocol_host_category, protocol_method, protocol_slot};
|
|
326
753
|
//# sourceMappingURL=protocol-impl.mjs.map
|