eliscript 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -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.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 +732 -11
- package/browser/worker.mjs +6 -3
- 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 +1078 -0
- package/dist/browser/loader.js +1 -0
- package/dist/browser/loader.mjs +231 -0
- package/dist/browser/worker.mjs +63 -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 +639 -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 +40 -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 +25 -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 +494 -0
- package/dist/literal-sources/stdlib/managed-literals.eli +1469 -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 +106 -11
- 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 +172 -72
- package/stdlib/gepo.eli +12 -0
- package/stdlib/interop/js.eli +56 -15
- package/stdlib/managed-literal-protocols.eli +494 -0
- package/stdlib/managed-literals.eli +1469 -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 +639 -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 +40 -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 +25 -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 +462 -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 +493 -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,73 +1,309 @@
|
|
|
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("transient_fail"); return transient_fail; }
|
|
5
|
+
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("transient_fail"); 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("canonical_transient_family"); return canonical_transient_family; }
|
|
8
|
+
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("canonical_transient_family"); 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("trusted_core_source_p"); return trusted_core_source_p; }
|
|
11
|
+
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("trusted_core_source_p"); return __eliscript_const_error(); }
|
|
12
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
2
13
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
14
|
+
const __eliscript_number_intrinsic = globalThis.Number;
|
|
15
|
+
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
16
|
+
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
17
|
+
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
18
|
+
const __eliscript_numeric_error = globalThis.TypeError;
|
|
19
|
+
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
20
|
+
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
21
|
+
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
22
|
+
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
23
|
+
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
24
|
+
const __eliscript_numeric_primitive = (value) => {
|
|
25
|
+
if (!__eliscript_numeric_object(value)) return value;
|
|
26
|
+
const exotic = value[__eliscript_numeric_symbol];
|
|
27
|
+
if (exotic !== void 0 && exotic !== null) {
|
|
28
|
+
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
29
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
30
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
31
|
+
}
|
|
32
|
+
for (let index = 0; index < 2; index++) {
|
|
33
|
+
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
34
|
+
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
35
|
+
const result = __eliscript_numeric_apply(method, value, []);
|
|
36
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
40
|
+
};
|
|
41
|
+
const __eliscript_to_number = (value) => {
|
|
42
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
43
|
+
if (typeof primitive === "string") {
|
|
44
|
+
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
45
|
+
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
46
|
+
let first = 2;
|
|
47
|
+
while (first < text.length && text[first] === "0") first++;
|
|
48
|
+
if (first === text.length) return 0;
|
|
49
|
+
const prefix = text[1];
|
|
50
|
+
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
51
|
+
if (text.length - first > limit) return 1 / 0;
|
|
52
|
+
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
53
|
+
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return __eliscript_number_intrinsic(primitive);
|
|
57
|
+
};
|
|
58
|
+
const __eliscript_numeric = (value) => {
|
|
59
|
+
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
60
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
61
|
+
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
62
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
63
|
+
};
|
|
64
|
+
const __eliscript_implicit_number = (value) => {
|
|
65
|
+
if (typeof value === "number") return value;
|
|
66
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
67
|
+
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
68
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
69
|
+
};
|
|
70
|
+
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
71
|
+
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
72
|
+
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
73
|
+
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
74
|
+
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
75
|
+
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
76
|
+
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
77
|
+
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
78
|
+
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
79
|
+
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
80
|
+
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
81
|
+
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
82
|
+
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
83
|
+
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
84
|
+
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
85
|
+
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
86
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
87
|
+
if (operator === "<") return left < right;
|
|
88
|
+
if (operator === "<=") return left <= right;
|
|
89
|
+
if (operator === ">") return left > right;
|
|
90
|
+
return left >= right;
|
|
91
|
+
}
|
|
92
|
+
let a = __eliscript_numeric_primitive(left);
|
|
93
|
+
let b = __eliscript_numeric_primitive(right);
|
|
94
|
+
const x = typeof a, y = typeof b;
|
|
95
|
+
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
96
|
+
a = __eliscript_numeric(a);
|
|
97
|
+
b = __eliscript_numeric(b);
|
|
98
|
+
}
|
|
99
|
+
if (operator === "<") return a < b;
|
|
100
|
+
if (operator === "<=") return a <= b;
|
|
101
|
+
if (operator === ">") return a > b;
|
|
102
|
+
return a >= b;
|
|
103
|
+
};
|
|
3
104
|
|
|
4
105
|
import {node_kind, node_span, node_value, node_name, node_items} from "./syntax.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
106
|
+
function utf16_string_order(left, right) {
|
|
107
|
+
if (__eliscript_numeric_relation("<", left, right)) {
|
|
108
|
+
return -1;
|
|
109
|
+
} else {
|
|
110
|
+
if (__eliscript_numeric_relation(">", left, right)) {
|
|
111
|
+
return 1;
|
|
112
|
+
} else {
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const transient_fail = ((filename, span, message) => {
|
|
118
|
+
{
|
|
119
|
+
const __eliscript_value_1 = (!!filename ? filename : ((fallback) => {
|
|
120
|
+
if (!!fallback) {
|
|
121
|
+
return fallback;
|
|
122
|
+
} else {
|
|
123
|
+
return "<input>";
|
|
124
|
+
}
|
|
125
|
+
})(((span == null) ? undefined : (span)["filename"])));
|
|
126
|
+
{
|
|
127
|
+
let file = __eliscript_value_1;
|
|
128
|
+
{
|
|
129
|
+
const __eliscript_value_2 = (!!span ? ({"offset": (span)["start"], "line": (span)["line"], "column": (span)["column"]}) : ({"offset": 0, "line": 1, "column": 1}));
|
|
130
|
+
{
|
|
131
|
+
let start = __eliscript_value_2;
|
|
132
|
+
{
|
|
133
|
+
const __eliscript_value_3 = (!!span ? ({"offset": (span)["end"], "line": (span)["endLine"], "column": (span)["endColumn"]}) : ({"offset": 0, "line": 1, "column": 1}));
|
|
134
|
+
{
|
|
135
|
+
let end = __eliscript_value_3;
|
|
136
|
+
{
|
|
137
|
+
const __eliscript_value_4 = ({"format": "eliscript-diagnostic", "version": 1, "code": "ELI-A0001", "severity": "error", "phase": "analysis", "message": message, "location": ({"file": file, "start": start, "end": end})});
|
|
138
|
+
{
|
|
139
|
+
let diagnostic = __eliscript_value_4;
|
|
140
|
+
{
|
|
141
|
+
const __eliscript_value_5 = new (Error)(((file_text) => {
|
|
142
|
+
return ((line_value) => {
|
|
143
|
+
return ((line_text) => {
|
|
144
|
+
return ((column_value) => {
|
|
145
|
+
return ((column_text) => {
|
|
146
|
+
return ((message_text) => {
|
|
147
|
+
return (file_text + ":" + line_text + ":" + column_text + ": " + message_text);
|
|
148
|
+
})(`${message}`);
|
|
149
|
+
})(`${column_value}`);
|
|
150
|
+
})((start)["column"]);
|
|
151
|
+
})(`${line_value}`);
|
|
152
|
+
})((start)["line"]);
|
|
153
|
+
})(`${file}`));
|
|
154
|
+
{
|
|
155
|
+
let error = __eliscript_value_5;
|
|
156
|
+
((error)["eliscriptDiagnostic"] = diagnostic);
|
|
157
|
+
return ((__eliscript_value_6) => { throw __eliscript_value_6; })(error);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
__eliscript_tdz_ready_0 = true;
|
|
170
|
+
const canonical_transient_family = ((value) => {
|
|
171
|
+
if (__eliscript_truthy(((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? (/(^|\/)(stdlib|runtime)\/core\/transient\.(mjs|eli)$/)["test"](value) : __eliscript_value_7))((typeof value === "string")))) {
|
|
172
|
+
if (__eliscript_truthy((/(^|\/)runtime\/core\//)["test"](value))) {
|
|
173
|
+
return "runtime";
|
|
174
|
+
} else {
|
|
175
|
+
return "stdlib";
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
__eliscript_tdz_ready_1 = true;
|
|
182
|
+
const trusted_core_source_p = ((value) => {
|
|
183
|
+
return ((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? (["stdlib/core/data.eli", "stdlib/core/seq.eli", "stdlib/core/set.eli", "stdlib/core/transient.eli"])["some"](((suffix) => {
|
|
184
|
+
return ((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? __eliscript_value_9 : (value)["endsWith"]((String("/") + String(suffix)))))((value === suffix));
|
|
185
|
+
})) : __eliscript_value_8))((typeof value === "string"));
|
|
186
|
+
});
|
|
187
|
+
__eliscript_tdz_ready_2 = true;
|
|
8
188
|
function symbol_node_p(node) {
|
|
9
|
-
return ((
|
|
189
|
+
return ((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? (node_kind(node) === "symbol") : __eliscript_value_10))(node);
|
|
10
190
|
}
|
|
11
191
|
function vector_node_p(node) {
|
|
12
|
-
return ((
|
|
192
|
+
return ((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? (node_kind(node) === "vector") : __eliscript_value_11))(node);
|
|
13
193
|
}
|
|
14
194
|
function map_node_p(node) {
|
|
15
|
-
return ((
|
|
195
|
+
return ((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? ((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? ((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? ((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? (node_name(((((node_items(node)) ?? [])[0]) ?? null)) === "hash-map") : __eliscript_value_15))(symbol_node_p(((((node_items(node)) ?? [])[0]) ?? null))) : __eliscript_value_14))(__eliscript_numeric_relation(">", (node_items(node))["length"], 0)) : __eliscript_value_13))((node_kind(node) === "list")) : __eliscript_value_12))(node);
|
|
16
196
|
}
|
|
17
197
|
function keyword_node_p(node) {
|
|
18
|
-
return ((
|
|
198
|
+
return ((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? (node_kind(node) === "keyword") : __eliscript_value_16))(node);
|
|
19
199
|
}
|
|
20
200
|
function null_node_p(node) {
|
|
21
|
-
return ((
|
|
201
|
+
return ((__eliscript_value_17) => (__eliscript_truthy(__eliscript_value_17) ? ((node_kind(node) === "literal") && (node_value(node) == null)) : __eliscript_value_17))(node);
|
|
22
202
|
}
|
|
23
203
|
function list_items(node) {
|
|
24
|
-
|
|
204
|
+
if (__eliscript_truthy(((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? (node_kind(node) === "list") : __eliscript_value_18))(node))) {
|
|
205
|
+
return node_items(node);
|
|
206
|
+
} else {
|
|
207
|
+
if (__eliscript_truthy(null_node_p(node))) {
|
|
208
|
+
return [];
|
|
209
|
+
} else {
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
25
213
|
}
|
|
26
214
|
function binding_marker_p(name) {
|
|
27
215
|
return (["&optional", "&rest", "&body"])["includes"](name);
|
|
28
216
|
}
|
|
29
217
|
function split_binding_name(name) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
218
|
+
{
|
|
219
|
+
const __eliscript_value_19 = (name)["lastIndexOf"]("/");
|
|
220
|
+
{
|
|
221
|
+
let slash = __eliscript_value_19;
|
|
222
|
+
if (__eliscript_numeric_relation("<", slash, 0)) {
|
|
223
|
+
return ({"namespace": undefined, "local": name});
|
|
224
|
+
} else {
|
|
225
|
+
return ({"namespace": (name)["slice"](0, slash), "local": (name)["slice"]((slash + 1))});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
33
229
|
}
|
|
34
230
|
function map_binding_shortcut_p(node) {
|
|
35
|
-
return ((
|
|
231
|
+
return ((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? (["keys", "strs", "syms"])["includes"]((split_binding_name(node_name(node)))["local"]) : __eliscript_value_20))(keyword_node_p(node));
|
|
36
232
|
}
|
|
37
233
|
function local_binding_node(node) {
|
|
38
234
|
return ({"kind": "symbol", "name": (split_binding_name(node_name(node)))["local"], "span": node_span(node)});
|
|
39
235
|
}
|
|
40
236
|
function binding_nodes(pattern, context) {
|
|
41
|
-
|
|
42
|
-
(
|
|
43
|
-
return (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}) : (__eliscript_truthy((directive === "as")) ? (result)["push"](right) : (__eliscript_truthy((directive === "or")) ? null : (binding_nodes(left, context))["forEach"]((binding) => {
|
|
237
|
+
if (__eliscript_truthy(symbol_node_p(pattern))) {
|
|
238
|
+
if (__eliscript_truthy(binding_marker_p(node_name(pattern)))) {
|
|
239
|
+
return (__eliscript_tdz_read_0())((context)["filename"], node_span(pattern), "invalid transient-analysis binding marker");
|
|
240
|
+
} else {
|
|
241
|
+
return [pattern];
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
if (__eliscript_truthy(vector_node_p(pattern))) {
|
|
245
|
+
{
|
|
246
|
+
const __eliscript_value_21 = [];
|
|
247
|
+
{
|
|
248
|
+
let result = __eliscript_value_21;
|
|
249
|
+
(node_items(pattern))["forEach"](((element) => {
|
|
250
|
+
if ((!__eliscript_truthy(((__eliscript_value_22) => (__eliscript_truthy(__eliscript_value_22) ? __eliscript_value_22 : ((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? binding_marker_p(node_name(element)) : __eliscript_value_23))(symbol_node_p(element))))(null_node_p(element))))) {
|
|
251
|
+
return (binding_nodes(element, context))["forEach"](((binding) => {
|
|
57
252
|
return (result)["push"](binding);
|
|
58
|
-
}))
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
253
|
+
}));
|
|
254
|
+
} else {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
}));
|
|
258
|
+
return result;
|
|
259
|
+
}
|
|
63
260
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
261
|
+
} else {
|
|
262
|
+
if (__eliscript_truthy(map_node_p(pattern))) {
|
|
263
|
+
{
|
|
264
|
+
const __eliscript_value_24 = (node_items(pattern))["slice"](1);
|
|
265
|
+
const __eliscript_value_25 = [];
|
|
266
|
+
const __eliscript_value_26 = 0;
|
|
267
|
+
{
|
|
268
|
+
let items = __eliscript_value_24;
|
|
269
|
+
let result = __eliscript_value_25;
|
|
270
|
+
let index = __eliscript_value_26;
|
|
271
|
+
while (__eliscript_numeric_relation("<", index, (items)["length"])) {
|
|
272
|
+
{
|
|
273
|
+
let left = ((((items) ?? [])[index]) ?? null);
|
|
274
|
+
let right = ((((items) ?? [])[(index + 1)]) ?? null);
|
|
275
|
+
let directive = ((__eliscript_value_27) => (__eliscript_truthy(__eliscript_value_27) ? node_name(left) : __eliscript_value_27))(keyword_node_p(left));
|
|
276
|
+
if (__eliscript_truthy(map_binding_shortcut_p(left))) {
|
|
277
|
+
(node_items(right))["forEach"](((binding) => {
|
|
278
|
+
return (result)["push"](local_binding_node(binding));
|
|
279
|
+
}));
|
|
280
|
+
} else {
|
|
281
|
+
if ((directive === "as")) {
|
|
282
|
+
(result)["push"](right);
|
|
283
|
+
} else {
|
|
284
|
+
if ((directive === "or")) {
|
|
285
|
+
null;
|
|
286
|
+
} else {
|
|
287
|
+
(binding_nodes(left, context))["forEach"](((binding) => {
|
|
288
|
+
return (result)["push"](binding);
|
|
289
|
+
}));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
((index = (index + 2)));
|
|
295
|
+
}
|
|
296
|
+
return result;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
68
304
|
}
|
|
69
305
|
function make_scope(parent) {
|
|
70
|
-
return ({"parent": parent, "names": new Map()});
|
|
306
|
+
return ({"parent": parent, "names": new (Map)()});
|
|
71
307
|
}
|
|
72
308
|
function make_binding(node, operation = null, namespace = null) {
|
|
73
309
|
return ({"name": node_name(node), "operation": operation, "namespace": namespace, "resource": null});
|
|
@@ -80,581 +316,1041 @@ function declare_binding(scope, node, operation = null, namespace = null) {
|
|
|
80
316
|
return install_binding(scope, make_binding(node, operation, namespace));
|
|
81
317
|
}
|
|
82
318
|
function lookup_binding(scope, name) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
319
|
+
{
|
|
320
|
+
const __eliscript_value_28 = scope;
|
|
321
|
+
const __eliscript_value_29 = undefined;
|
|
322
|
+
{
|
|
323
|
+
let current = __eliscript_value_28;
|
|
324
|
+
let binding = __eliscript_value_29;
|
|
325
|
+
while (__eliscript_truthy(((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? (!__eliscript_truthy(binding)) : __eliscript_value_30))(current))) {
|
|
86
326
|
((binding = ((current)["names"])["get"](name)));
|
|
87
327
|
((current = (current)["parent"]));
|
|
88
328
|
}
|
|
89
|
-
return
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
})(scope, undefined);
|
|
329
|
+
return binding;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
93
332
|
}
|
|
94
333
|
function make_pattern_bindings(pattern, context) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
334
|
+
{
|
|
335
|
+
const __eliscript_value_31 = [];
|
|
336
|
+
{
|
|
337
|
+
let result = __eliscript_value_31;
|
|
338
|
+
(binding_nodes(pattern, context))["forEach"](((node) => {
|
|
339
|
+
return (result)["push"](make_binding(node));
|
|
340
|
+
}));
|
|
341
|
+
return result;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
101
344
|
}
|
|
102
345
|
function install_bindings(scope, bindings) {
|
|
103
|
-
(bindings)["forEach"]((binding) => {
|
|
346
|
+
(bindings)["forEach"](((binding) => {
|
|
104
347
|
return install_binding(scope, binding);
|
|
105
|
-
});
|
|
348
|
+
}));
|
|
106
349
|
return bindings;
|
|
107
350
|
}
|
|
108
351
|
function transient_operation(family, name) {
|
|
109
|
-
|
|
352
|
+
if ((family === "stdlib")) {
|
|
353
|
+
if ((name === "transient")) {
|
|
354
|
+
return "construct";
|
|
355
|
+
} else {
|
|
356
|
+
if (((name === "conj!") || (name === "assoc!") || (name === "dissoc!"))) {
|
|
357
|
+
return "update";
|
|
358
|
+
} else {
|
|
359
|
+
if ((name === "persistent!")) {
|
|
360
|
+
return "complete";
|
|
361
|
+
} else {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
if ((family === "runtime")) {
|
|
368
|
+
if ((name === "transient")) {
|
|
369
|
+
return "construct";
|
|
370
|
+
} else {
|
|
371
|
+
if (((name === "conjBang") || (name === "assocBang") || (name === "dissocBang"))) {
|
|
372
|
+
return "update";
|
|
373
|
+
} else {
|
|
374
|
+
if ((name === "persistentBang")) {
|
|
375
|
+
return "complete";
|
|
376
|
+
} else {
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
} else {
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
110
385
|
}
|
|
111
386
|
function operator_binding(operator, scope) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
387
|
+
if (__eliscript_truthy(symbol_node_p(operator))) {
|
|
388
|
+
{
|
|
389
|
+
let name = node_name(operator);
|
|
390
|
+
let direct = lookup_binding(scope, name);
|
|
391
|
+
if (__eliscript_truthy(((__eliscript_value_32) => (__eliscript_truthy(__eliscript_value_32) ? (direct)["operation"] : __eliscript_value_32))(direct))) {
|
|
392
|
+
return direct;
|
|
393
|
+
} else {
|
|
394
|
+
{
|
|
395
|
+
const __eliscript_value_33 = (name)["indexOf"]("/");
|
|
396
|
+
{
|
|
397
|
+
let separator = __eliscript_value_33;
|
|
398
|
+
if ((__eliscript_numeric_relation(">", separator, 0) && (separator === (name)["lastIndexOf"]("/")))) {
|
|
399
|
+
{
|
|
400
|
+
let namespace_name = (name)["slice"](0, separator);
|
|
401
|
+
let member_name = (name)["slice"]((separator + 1));
|
|
402
|
+
let namespace = lookup_binding(scope, namespace_name);
|
|
403
|
+
let family = ((__eliscript_value_34) => (__eliscript_truthy(__eliscript_value_34) ? (namespace)["namespace"] : __eliscript_value_34))(namespace);
|
|
404
|
+
let operation = ((__eliscript_value_35) => (__eliscript_truthy(__eliscript_value_35) ? transient_operation(family, member_name) : __eliscript_value_35))(family);
|
|
405
|
+
return ((__eliscript_value_36) => (__eliscript_truthy(__eliscript_value_36) ? ({"name": name, "operation": operation}) : __eliscript_value_36))(operation);
|
|
406
|
+
}
|
|
407
|
+
} else {
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
} else {
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
129
417
|
}
|
|
130
418
|
function copy_state(context) {
|
|
131
|
-
|
|
132
|
-
(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
419
|
+
{
|
|
420
|
+
const __eliscript_value_37 = new (Map)();
|
|
421
|
+
{
|
|
422
|
+
let result = __eliscript_value_37;
|
|
423
|
+
((context)["state"])["forEach"](((state, resource) => {
|
|
424
|
+
return (result)["set"](resource, state);
|
|
425
|
+
}));
|
|
426
|
+
return result;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
137
429
|
}
|
|
138
430
|
function merge_state(baseline, branches) {
|
|
139
|
-
|
|
140
|
-
(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
431
|
+
{
|
|
432
|
+
const __eliscript_value_38 = new (Map)();
|
|
433
|
+
{
|
|
434
|
+
let result = __eliscript_value_38;
|
|
435
|
+
(baseline)["forEach"](((original, resource) => {
|
|
436
|
+
{
|
|
437
|
+
const __eliscript_value_39 = undefined;
|
|
438
|
+
const __eliscript_value_40 = true;
|
|
439
|
+
{
|
|
440
|
+
let first = __eliscript_value_39;
|
|
441
|
+
let same = __eliscript_value_40;
|
|
442
|
+
(branches)["forEach"](((branch) => {
|
|
443
|
+
{
|
|
444
|
+
const __eliscript_value_41 = (__eliscript_truthy((branch)["has"](resource)) ? (branch)["get"](resource) : original);
|
|
445
|
+
{
|
|
446
|
+
let state = __eliscript_value_41;
|
|
447
|
+
if ((first === undefined)) {
|
|
448
|
+
return ((first = state));
|
|
449
|
+
} else {
|
|
450
|
+
if ((!(state === first))) {
|
|
451
|
+
return ((same = false));
|
|
452
|
+
} else {
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}));
|
|
459
|
+
return (result)["set"](resource, (__eliscript_truthy(same) ? first : "maybe"));
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}));
|
|
463
|
+
return result;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
152
466
|
}
|
|
153
467
|
function run_with_state(context, state, operation) {
|
|
154
|
-
|
|
155
|
-
(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
((
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
468
|
+
{
|
|
469
|
+
const __eliscript_value_42 = (context)["state"];
|
|
470
|
+
{
|
|
471
|
+
let saved = __eliscript_value_42;
|
|
472
|
+
((context)["state"] = ((result) => {
|
|
473
|
+
(state)["forEach"](((value, resource) => {
|
|
474
|
+
return (result)["set"](resource, value);
|
|
475
|
+
}));
|
|
476
|
+
return result;
|
|
477
|
+
})(new (Map)()));
|
|
478
|
+
operation();
|
|
479
|
+
{
|
|
480
|
+
const __eliscript_value_43 = (context)["state"];
|
|
481
|
+
{
|
|
482
|
+
let result = __eliscript_value_43;
|
|
483
|
+
((context)["state"] = saved);
|
|
484
|
+
return result;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
167
489
|
}
|
|
168
490
|
function retain_state_keys(context, baseline) {
|
|
169
|
-
|
|
170
|
-
(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
491
|
+
{
|
|
492
|
+
const __eliscript_value_44 = (context)["state"];
|
|
493
|
+
const __eliscript_value_45 = new (Map)();
|
|
494
|
+
{
|
|
495
|
+
let current = __eliscript_value_44;
|
|
496
|
+
let result = __eliscript_value_45;
|
|
497
|
+
(baseline)["forEach"](((original, resource) => {
|
|
498
|
+
return (result)["set"](resource, (__eliscript_truthy((current)["has"](resource)) ? (current)["get"](resource) : original));
|
|
499
|
+
}));
|
|
500
|
+
return ((context)["state"] = result);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
175
503
|
}
|
|
176
504
|
function record_try_prefix(context) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
505
|
+
{
|
|
506
|
+
const __eliscript_value_46 = (context)["tryPrefixes"];
|
|
507
|
+
{
|
|
508
|
+
let prefixes = __eliscript_value_46;
|
|
509
|
+
if (__eliscript_truthy(prefixes)) {
|
|
510
|
+
return (prefixes)["push"](copy_state(context));
|
|
511
|
+
} else {
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
180
516
|
}
|
|
181
517
|
function resource_state(context, resource) {
|
|
182
|
-
|
|
518
|
+
if (__eliscript_truthy(((context)["state"])["has"](resource))) {
|
|
519
|
+
return ((context)["state"])["get"](resource);
|
|
520
|
+
} else {
|
|
521
|
+
return "active";
|
|
522
|
+
}
|
|
183
523
|
}
|
|
184
524
|
function check_owner(binding, context, span) {
|
|
185
|
-
|
|
186
|
-
(
|
|
187
|
-
(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
525
|
+
{
|
|
526
|
+
const __eliscript_value_47 = ((__eliscript_value_49) => (__eliscript_truthy(__eliscript_value_49) ? (binding)["resource"] : __eliscript_value_49))(binding);
|
|
527
|
+
const __eliscript_value_48 = ((__eliscript_value_50) => (__eliscript_truthy(__eliscript_value_50) ? (binding)["name"] : __eliscript_value_50))(binding);
|
|
528
|
+
{
|
|
529
|
+
let resource = __eliscript_value_47;
|
|
530
|
+
let name = __eliscript_value_48;
|
|
531
|
+
if ((!__eliscript_truthy(resource))) {
|
|
532
|
+
(__eliscript_tdz_read_0())((context)["filename"], span, "transient operation requires a directly bound transient value");
|
|
533
|
+
}
|
|
534
|
+
if ((!((resource)["functionId"] === (context)["functionId"]))) {
|
|
535
|
+
(__eliscript_tdz_read_0())((context)["filename"], span, (String("transient binding ") + String(name) + String(" cannot cross a function boundary")));
|
|
536
|
+
}
|
|
537
|
+
{
|
|
538
|
+
const __eliscript_value_51 = resource_state(context, resource);
|
|
539
|
+
{
|
|
540
|
+
let state = __eliscript_value_51;
|
|
541
|
+
if ((state === "active")) {
|
|
542
|
+
return resource;
|
|
543
|
+
} else {
|
|
544
|
+
if ((state === "consumed")) {
|
|
545
|
+
return (__eliscript_tdz_read_0())((context)["filename"], span, (String("transient binding ") + String(name) + String(" is no longer editable after persistent!")));
|
|
546
|
+
} else {
|
|
547
|
+
return (__eliscript_tdz_read_0())((context)["filename"], span, (String("transient binding ") + String(name) + String(" may already be persistent after conditional control flow")));
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
192
554
|
}
|
|
193
555
|
function direct_resource(form, scope, context) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
556
|
+
{
|
|
557
|
+
const __eliscript_value_52 = ((__eliscript_value_53) => (__eliscript_truthy(__eliscript_value_53) ? lookup_binding(scope, node_name(form)) : __eliscript_value_53))(symbol_node_p(form));
|
|
558
|
+
{
|
|
559
|
+
let binding = __eliscript_value_52;
|
|
560
|
+
return check_owner(binding, context, ((__eliscript_value_54) => (__eliscript_truthy(__eliscript_value_54) ? node_span(form) : __eliscript_value_54))(form));
|
|
561
|
+
}
|
|
562
|
+
}
|
|
197
563
|
}
|
|
198
564
|
function analyze_reference(form, scope, context) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
565
|
+
{
|
|
566
|
+
let name = node_name(form);
|
|
567
|
+
let operation = operator_binding(form, scope);
|
|
568
|
+
let binding = lookup_binding(scope, name);
|
|
569
|
+
if (__eliscript_truthy(operation)) {
|
|
570
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(form), (String("transient operation ") + String(name) + String(" must be called directly")));
|
|
571
|
+
}
|
|
572
|
+
if (__eliscript_truthy(((__eliscript_value_55) => (__eliscript_truthy(__eliscript_value_55) ? (binding)["resource"] : __eliscript_value_55))(binding))) {
|
|
573
|
+
{
|
|
574
|
+
const __eliscript_value_56 = (binding)["resource"];
|
|
575
|
+
{
|
|
576
|
+
let resource = __eliscript_value_56;
|
|
577
|
+
if ((!((resource)["functionId"] === (context)["functionId"]))) {
|
|
578
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(form), (String("transient binding ") + String(name) + String(" cannot cross a function boundary")));
|
|
579
|
+
}
|
|
580
|
+
{
|
|
581
|
+
const __eliscript_value_57 = resource_state(context, resource);
|
|
582
|
+
{
|
|
583
|
+
let state = __eliscript_value_57;
|
|
584
|
+
if ((state === "active")) {
|
|
585
|
+
return (__eliscript_tdz_read_0())((context)["filename"], node_span(form), (String("transient binding ") + String(name) + String(" may only be used by a direct transient operation")));
|
|
586
|
+
} else {
|
|
587
|
+
if ((state === "consumed")) {
|
|
588
|
+
return (__eliscript_tdz_read_0())((context)["filename"], node_span(form), (String("transient binding ") + String(name) + String(" is no longer editable after persistent!")));
|
|
589
|
+
} else {
|
|
590
|
+
return (__eliscript_tdz_read_0())((context)["filename"], node_span(form), (String("transient binding ") + String(name) + String(" may already be persistent after conditional control flow")));
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
} else {
|
|
598
|
+
return null;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
214
601
|
}
|
|
215
602
|
function binding_pair(binding) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
603
|
+
{
|
|
604
|
+
const __eliscript_value_58 = list_items(binding);
|
|
605
|
+
{
|
|
606
|
+
let items = __eliscript_value_58;
|
|
607
|
+
if (((!(items === undefined)) && __eliscript_numeric_relation(">", (items)["length"], 0))) {
|
|
608
|
+
return ({"target": ((((items) ?? [])[0]) ?? null), "initializer": ((((items) ?? [])[1]) ?? null)});
|
|
609
|
+
} else {
|
|
610
|
+
return ({"target": binding, "initializer": null});
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
219
614
|
}
|
|
220
615
|
function new_resource(binding, span, context) {
|
|
221
|
-
|
|
222
|
-
((binding)["
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
616
|
+
{
|
|
617
|
+
const __eliscript_value_59 = ({"name": (binding)["name"], "functionId": (context)["functionId"], "span": span});
|
|
618
|
+
{
|
|
619
|
+
let resource = __eliscript_value_59;
|
|
620
|
+
((binding)["resource"] = resource);
|
|
621
|
+
((context)["state"])["set"](resource, "active");
|
|
622
|
+
return resource;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
226
625
|
}
|
|
227
626
|
function constructor_call_p(form, scope) {
|
|
228
|
-
return ((
|
|
627
|
+
return ((__eliscript_value_60) => (__eliscript_truthy(__eliscript_value_60) ? ((__eliscript_value_61) => (__eliscript_truthy(__eliscript_value_61) ? ((items) => {
|
|
229
628
|
return ((binding) => {
|
|
230
|
-
return ((
|
|
629
|
+
return ((__eliscript_value_62) => (__eliscript_truthy(__eliscript_value_62) ? ((binding)["operation"] === "construct") : __eliscript_value_62))(binding);
|
|
231
630
|
})(operator_binding(((((items) ?? [])[0]) ?? null), scope));
|
|
232
|
-
})(node_items(form)) :
|
|
631
|
+
})(node_items(form)) : __eliscript_value_61))((node_kind(form) === "list")) : __eliscript_value_60))(form);
|
|
233
632
|
}
|
|
234
633
|
function analyze_initializer(initializer, scope, bindings, context, predeclared = null) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
634
|
+
if (__eliscript_truthy(constructor_call_p(initializer, scope))) {
|
|
635
|
+
{
|
|
636
|
+
let items = node_items(initializer);
|
|
637
|
+
let arguments$ = (items)["slice"](1);
|
|
638
|
+
if ((!((bindings)["length"] === 1))) {
|
|
639
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(initializer), "transient result must be bound directly to one symbol");
|
|
640
|
+
}
|
|
641
|
+
if ((!((arguments$)["length"] === 1))) {
|
|
642
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(initializer), "transient expects 1 argument");
|
|
643
|
+
}
|
|
644
|
+
analyze_expression(((((arguments$) ?? [])[0]) ?? null), scope, context, true);
|
|
645
|
+
{
|
|
646
|
+
const __eliscript_value_63 = ((((bindings) ?? [])[0]) ?? null);
|
|
647
|
+
{
|
|
648
|
+
let binding = __eliscript_value_63;
|
|
649
|
+
if ((!__eliscript_truthy(((__eliscript_value_64) => (__eliscript_truthy(__eliscript_value_64) ? (binding)["resource"] : __eliscript_value_64))(predeclared)))) {
|
|
650
|
+
return new_resource(binding, node_span(initializer), context);
|
|
651
|
+
} else {
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
} else {
|
|
658
|
+
if (__eliscript_truthy(initializer)) {
|
|
659
|
+
return analyze_expression(initializer, scope, context, true);
|
|
660
|
+
} else {
|
|
661
|
+
return null;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
247
664
|
}
|
|
248
665
|
function analyze_sequence(forms, scope, context, value_context) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
666
|
+
{
|
|
667
|
+
const __eliscript_value_65 = 0;
|
|
668
|
+
{
|
|
669
|
+
let index = __eliscript_value_65;
|
|
670
|
+
while (__eliscript_numeric_relation("<", index, (forms)["length"])) {
|
|
671
|
+
analyze_expression(((((forms) ?? [])[index]) ?? null), scope, context, ((__eliscript_value_66) => (__eliscript_truthy(__eliscript_value_66) ? (index === __eliscript_numeric_decrement((forms)["length"])) : __eliscript_value_66))(value_context));
|
|
253
672
|
((index = (index + 1)));
|
|
254
673
|
}
|
|
255
674
|
return null;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
258
677
|
}
|
|
259
678
|
function analyze_let(arguments$, scope, context, sequential, value_context) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
679
|
+
{
|
|
680
|
+
let baseline = copy_state(context);
|
|
681
|
+
let binding_node = ((((arguments$) ?? [])[0]) ?? null);
|
|
682
|
+
let binding_forms = (__eliscript_truthy(binding_node) ? list_items(binding_node) : undefined);
|
|
683
|
+
let body = (arguments$)["slice"](1);
|
|
684
|
+
let child = make_scope(scope);
|
|
685
|
+
if ((binding_forms === undefined)) {
|
|
686
|
+
(__eliscript_tdz_read_0())((context)["filename"], ((__eliscript_value_67) => (__eliscript_truthy(__eliscript_value_67) ? node_span(binding_node) : __eliscript_value_67))(binding_node), "let bindings must be a list");
|
|
687
|
+
}
|
|
688
|
+
if (__eliscript_truthy(sequential)) {
|
|
689
|
+
(binding_forms)["forEach"](((entry) => {
|
|
690
|
+
{
|
|
691
|
+
let parsed = binding_pair(entry);
|
|
692
|
+
let declared = make_pattern_bindings((parsed)["target"], context);
|
|
693
|
+
analyze_initializer((parsed)["initializer"], child, declared, context);
|
|
694
|
+
return install_bindings(child, declared);
|
|
695
|
+
}
|
|
696
|
+
}));
|
|
697
|
+
} else {
|
|
698
|
+
{
|
|
699
|
+
const __eliscript_value_68 = [];
|
|
700
|
+
const __eliscript_value_69 = [];
|
|
701
|
+
{
|
|
702
|
+
let parsed = __eliscript_value_68;
|
|
703
|
+
let declared = __eliscript_value_69;
|
|
704
|
+
(binding_forms)["forEach"](((entry) => {
|
|
705
|
+
{
|
|
706
|
+
let pair = binding_pair(entry);
|
|
707
|
+
let bindings = make_pattern_bindings((pair)["target"], context);
|
|
708
|
+
(parsed)["push"](pair);
|
|
709
|
+
return (declared)["push"](bindings);
|
|
710
|
+
}
|
|
711
|
+
}));
|
|
712
|
+
{
|
|
713
|
+
const __eliscript_value_70 = 0;
|
|
714
|
+
{
|
|
715
|
+
let index = __eliscript_value_70;
|
|
716
|
+
while (__eliscript_numeric_relation("<", index, (parsed)["length"])) {
|
|
717
|
+
analyze_initializer((((((parsed) ?? [])[index]) ?? null))["initializer"], scope, ((((declared) ?? [])[index]) ?? null), context);
|
|
718
|
+
((index = (index + 1)));
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
(declared)["forEach"](((bindings) => {
|
|
723
|
+
return install_bindings(child, bindings);
|
|
724
|
+
}));
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
analyze_sequence(body, child, context, value_context);
|
|
729
|
+
return retain_state_keys(context, baseline);
|
|
730
|
+
}
|
|
308
731
|
}
|
|
309
732
|
function declare_parameters(scope, parameters, context) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
733
|
+
{
|
|
734
|
+
const __eliscript_value_71 = ((node_kind(parameters) === "list") ? node_items(parameters) : ((node_kind(parameters) === "vector") ? node_items(parameters) : []));
|
|
735
|
+
{
|
|
736
|
+
let items = __eliscript_value_71;
|
|
737
|
+
return (items)["forEach"](((parameter) => {
|
|
738
|
+
if ((!__eliscript_truthy(((__eliscript_value_72) => (__eliscript_truthy(__eliscript_value_72) ? binding_marker_p(node_name(parameter)) : __eliscript_value_72))(symbol_node_p(parameter))))) {
|
|
739
|
+
return install_bindings(scope, make_pattern_bindings(parameter, context));
|
|
740
|
+
} else {
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
}));
|
|
744
|
+
}
|
|
745
|
+
}
|
|
315
746
|
}
|
|
316
747
|
function analyze_function(parameters, body, scope, context) {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
748
|
+
{
|
|
749
|
+
const __eliscript_value_73 = (context)["state"];
|
|
750
|
+
const __eliscript_value_74 = (context)["functionId"];
|
|
751
|
+
const __eliscript_value_75 = (context)["loopProtected"];
|
|
752
|
+
const __eliscript_value_76 = make_scope(scope);
|
|
753
|
+
{
|
|
754
|
+
let saved_state = __eliscript_value_73;
|
|
755
|
+
let saved_function_id = __eliscript_value_74;
|
|
756
|
+
let saved_loop_protected = __eliscript_value_75;
|
|
757
|
+
let child = __eliscript_value_76;
|
|
758
|
+
((context)["nextFunctionId"] = ((context)["nextFunctionId"] + 1));
|
|
759
|
+
((context)["functionId"] = (context)["nextFunctionId"]);
|
|
760
|
+
((context)["state"] = copy_state(context));
|
|
761
|
+
((context)["loopProtected"] = []);
|
|
762
|
+
declare_parameters(child, parameters, context);
|
|
763
|
+
analyze_sequence(body, child, context, true);
|
|
764
|
+
((context)["state"] = saved_state);
|
|
765
|
+
((context)["functionId"] = saved_function_id);
|
|
766
|
+
return ((context)["loopProtected"] = saved_loop_protected);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
328
769
|
}
|
|
329
770
|
function analyze_if(arguments$, scope, context, value_context) {
|
|
330
771
|
analyze_expression(((((arguments$) ?? [])[0]) ?? null), scope, context, true);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return ((context)["state"] = merge_state(baseline, [then_state, else_state]));
|
|
335
|
-
})((__eliscript_truthy(((arguments$)["length"] > 2)) ? run_with_state(context, baseline, () => {
|
|
336
|
-
return analyze_expression(((((arguments$) ?? [])[2]) ?? null), scope, context, value_context);
|
|
337
|
-
}) : baseline));
|
|
338
|
-
})(run_with_state(context, baseline, () => {
|
|
772
|
+
{
|
|
773
|
+
let baseline = copy_state(context);
|
|
774
|
+
let then_state = run_with_state(context, baseline, (() => {
|
|
339
775
|
return analyze_expression(((((arguments$) ?? [])[1]) ?? null), scope, context, value_context);
|
|
340
776
|
}));
|
|
341
|
-
|
|
777
|
+
let else_state = (__eliscript_numeric_relation(">", (arguments$)["length"], 2) ? run_with_state(context, baseline, (() => {
|
|
778
|
+
return analyze_expression(((((arguments$) ?? [])[2]) ?? null), scope, context, value_context);
|
|
779
|
+
})) : baseline);
|
|
780
|
+
return ((context)["state"] = merge_state(baseline, [then_state, else_state]));
|
|
781
|
+
}
|
|
342
782
|
}
|
|
343
783
|
function analyze_when(arguments$, scope, context, value_context) {
|
|
344
784
|
analyze_expression(((((arguments$) ?? [])[0]) ?? null), scope, context, true);
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
})(run_with_state(context, baseline, () => {
|
|
785
|
+
{
|
|
786
|
+
let baseline = copy_state(context);
|
|
787
|
+
let body_state = run_with_state(context, baseline, (() => {
|
|
349
788
|
return analyze_sequence((arguments$)["slice"](1), scope, context, value_context);
|
|
350
789
|
}));
|
|
351
|
-
|
|
790
|
+
return ((context)["state"] = merge_state(baseline, [baseline, body_state]));
|
|
791
|
+
}
|
|
352
792
|
}
|
|
353
793
|
function analyze_short_circuit(arguments$, scope, context, value_context) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
794
|
+
{
|
|
795
|
+
const __eliscript_value_77 = [];
|
|
796
|
+
const __eliscript_value_78 = 0;
|
|
797
|
+
{
|
|
798
|
+
let exits = __eliscript_value_77;
|
|
799
|
+
let index = __eliscript_value_78;
|
|
800
|
+
while (__eliscript_numeric_relation("<", index, (arguments$)["length"])) {
|
|
357
801
|
analyze_expression(((((arguments$) ?? [])[index]) ?? null), scope, context, value_context);
|
|
358
802
|
(exits)["push"](copy_state(context));
|
|
359
803
|
((index = (index + 1)));
|
|
360
804
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
805
|
+
if (__eliscript_numeric_relation(">", (exits)["length"], 0)) {
|
|
806
|
+
return ((context)["state"] = merge_state(((((exits) ?? [])[0]) ?? null), exits));
|
|
807
|
+
} else {
|
|
808
|
+
return null;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
365
812
|
}
|
|
366
813
|
function analyze_cond(clauses, scope, context, value_context) {
|
|
367
|
-
|
|
368
|
-
(
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
814
|
+
{
|
|
815
|
+
const __eliscript_value_79 = copy_state(context);
|
|
816
|
+
const __eliscript_value_80 = [];
|
|
817
|
+
const __eliscript_value_81 = false;
|
|
818
|
+
const __eliscript_value_82 = 0;
|
|
819
|
+
{
|
|
820
|
+
let baseline = __eliscript_value_79;
|
|
821
|
+
let exits = __eliscript_value_80;
|
|
822
|
+
let default_seen = __eliscript_value_81;
|
|
823
|
+
let index = __eliscript_value_82;
|
|
824
|
+
while ((__eliscript_numeric_relation("<", index, (clauses)["length"]) && (!__eliscript_truthy(default_seen)))) {
|
|
825
|
+
{
|
|
826
|
+
let items = list_items(((((clauses) ?? [])[index]) ?? null));
|
|
827
|
+
let test = ((((items) ?? [])[0]) ?? null);
|
|
828
|
+
analyze_expression(test, scope, context, true);
|
|
829
|
+
{
|
|
830
|
+
let after_test = copy_state(context);
|
|
831
|
+
let body_state = run_with_state(context, after_test, (() => {
|
|
832
|
+
return analyze_sequence((items)["slice"](1), scope, context, value_context);
|
|
833
|
+
}));
|
|
834
|
+
(exits)["push"](body_state);
|
|
835
|
+
if (((node_kind(test) === "literal") && (node_value(test) === true))) {
|
|
836
|
+
((default_seen = true));
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
387
840
|
((index = (index + 1)));
|
|
388
841
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
842
|
+
if ((!__eliscript_truthy(default_seen))) {
|
|
843
|
+
(exits)["push"](copy_state(context));
|
|
844
|
+
}
|
|
845
|
+
if (__eliscript_numeric_relation(">", (exits)["length"], 0)) {
|
|
846
|
+
return ((context)["state"] = merge_state(baseline, exits));
|
|
847
|
+
} else {
|
|
848
|
+
return null;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
394
852
|
}
|
|
395
853
|
function visible_active_resources(context) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
854
|
+
{
|
|
855
|
+
const __eliscript_value_83 = [];
|
|
856
|
+
{
|
|
857
|
+
let resources = __eliscript_value_83;
|
|
858
|
+
((context)["state"])["forEach"](((state, resource) => {
|
|
859
|
+
if ((((resource)["functionId"] === (context)["functionId"]) && ((state === "active") || (state === "maybe")))) {
|
|
860
|
+
return (resources)["push"](resource);
|
|
861
|
+
} else {
|
|
862
|
+
return null;
|
|
863
|
+
}
|
|
864
|
+
}));
|
|
865
|
+
(resources)["sort"](((left, right) => {
|
|
866
|
+
return utf16_string_order((left)["name"], (right)["name"]);
|
|
867
|
+
}));
|
|
868
|
+
return resources;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
405
871
|
}
|
|
406
872
|
function analyze_await(form, arguments$, scope, context) {
|
|
407
873
|
analyze_expression(((((arguments$) ?? [])[0]) ?? null), scope, context, true);
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
874
|
+
{
|
|
875
|
+
const __eliscript_value_84 = visible_active_resources(context);
|
|
876
|
+
{
|
|
877
|
+
let active = __eliscript_value_84;
|
|
878
|
+
if (__eliscript_numeric_relation(">", (active)["length"], 0)) {
|
|
879
|
+
return (__eliscript_tdz_read_0())((context)["filename"], node_span(form), (String("transient binding ") + String((((((active) ?? [])[0]) ?? null))["name"]) + String(" cannot remain active across await")));
|
|
880
|
+
} else {
|
|
881
|
+
return null;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
411
885
|
}
|
|
412
886
|
function analyze_operation(operation, form, arguments$, scope, context, value_context) {
|
|
413
|
-
|
|
414
|
-
(
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
887
|
+
if ((operation === "construct")) {
|
|
888
|
+
return (__eliscript_tdz_read_0())((context)["filename"], node_span(form), "transient result must be bound directly to one symbol");
|
|
889
|
+
} else {
|
|
890
|
+
if ((operation === "update")) {
|
|
891
|
+
if (((arguments$)["length"] === 0)) {
|
|
892
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(form), "transient update requires a directly bound transient value");
|
|
893
|
+
}
|
|
894
|
+
direct_resource(((((arguments$) ?? [])[0]) ?? null), scope, context);
|
|
895
|
+
if (__eliscript_truthy(value_context)) {
|
|
896
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(form), "transient update result cannot be used as an ordinary value");
|
|
897
|
+
}
|
|
898
|
+
{
|
|
899
|
+
const __eliscript_value_85 = 1;
|
|
900
|
+
{
|
|
901
|
+
let index = __eliscript_value_85;
|
|
902
|
+
while (__eliscript_numeric_relation("<", index, (arguments$)["length"])) {
|
|
903
|
+
analyze_expression(((((arguments$) ?? [])[index]) ?? null), scope, context, true);
|
|
904
|
+
((index = (index + 1)));
|
|
905
|
+
}
|
|
906
|
+
return null;
|
|
422
907
|
}
|
|
908
|
+
}
|
|
909
|
+
} else {
|
|
910
|
+
if ((operation === "complete")) {
|
|
911
|
+
if ((!((arguments$)["length"] === 1))) {
|
|
912
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(form), "persistent! expects 1 argument");
|
|
913
|
+
}
|
|
914
|
+
{
|
|
915
|
+
const __eliscript_value_86 = direct_resource(((((arguments$) ?? [])[0]) ?? null), scope, context);
|
|
916
|
+
{
|
|
917
|
+
let resource = __eliscript_value_86;
|
|
918
|
+
if (__eliscript_truthy(((context)["loopProtected"])["includes"](resource))) {
|
|
919
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(((((arguments$) ?? [])[0]) ?? null)), (String("transient binding ") + String((resource)["name"]) + String(" cannot be completed inside a repeated loop")));
|
|
920
|
+
}
|
|
921
|
+
return ((context)["state"])["set"](resource, "consumed");
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
} else {
|
|
423
925
|
return null;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
(__eliscript_truthy((!__eliscript_truthy(((arguments$)["length"] === 1)))) ? transient_fail((context)["filename"], node_span(form), "persistent! expects 1 argument") : null);
|
|
428
|
-
return ((resource) => {
|
|
429
|
-
(__eliscript_truthy(((context)["loopProtected"])["includes"](resource)) ? transient_fail((context)["filename"], node_span(((((arguments$) ?? [])[0]) ?? null)), (String("transient binding ") + String((resource)["name"]) + String(" cannot be completed inside a repeated loop"))) : null);
|
|
430
|
-
return ((context)["state"])["set"](resource, "consumed");
|
|
431
|
-
})(direct_resource(((((arguments$) ?? [])[0]) ?? null), scope, context));
|
|
432
|
-
})() : null)));
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
433
929
|
}
|
|
434
930
|
function analyze_loop(arguments$, scope, context, value_context) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
931
|
+
{
|
|
932
|
+
let baseline = copy_state(context);
|
|
933
|
+
let bindings = list_items(((((arguments$) ?? [])[0]) ?? null));
|
|
934
|
+
let child = make_scope(scope);
|
|
935
|
+
(bindings)["forEach"](((entry) => {
|
|
936
|
+
{
|
|
937
|
+
let parsed = binding_pair(entry);
|
|
938
|
+
let declared = make_pattern_bindings((parsed)["target"], context);
|
|
939
|
+
analyze_initializer((parsed)["initializer"], scope, declared, context);
|
|
940
|
+
return install_bindings(child, declared);
|
|
941
|
+
}
|
|
942
|
+
}));
|
|
943
|
+
{
|
|
944
|
+
const __eliscript_value_87 = (context)["loopProtected"];
|
|
945
|
+
const __eliscript_value_88 = (visible_active_resources(context))["slice"]();
|
|
946
|
+
{
|
|
947
|
+
let saved = __eliscript_value_87;
|
|
948
|
+
let protected$ = __eliscript_value_88;
|
|
949
|
+
(saved)["forEach"](((resource) => {
|
|
950
|
+
return (protected$)["push"](resource);
|
|
951
|
+
}));
|
|
952
|
+
((context)["loopProtected"] = protected$);
|
|
953
|
+
analyze_sequence((arguments$)["slice"](1), child, context, value_context);
|
|
954
|
+
((context)["loopProtected"] = saved);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
return retain_state_keys(context, baseline);
|
|
958
|
+
}
|
|
462
959
|
}
|
|
463
960
|
function analyze_while(arguments$, scope, context) {
|
|
464
961
|
analyze_expression(((((arguments$) ?? [])[0]) ?? null), scope, context, true);
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
962
|
+
{
|
|
963
|
+
let baseline = copy_state(context);
|
|
964
|
+
let saved = (context)["loopProtected"];
|
|
965
|
+
let protected$ = (visible_active_resources(context))["slice"]();
|
|
966
|
+
(saved)["forEach"](((resource) => {
|
|
967
|
+
return (protected$)["push"](resource);
|
|
968
|
+
}));
|
|
969
|
+
((context)["loopProtected"] = protected$);
|
|
970
|
+
{
|
|
971
|
+
const __eliscript_value_89 = run_with_state(context, baseline, (() => {
|
|
972
|
+
return analyze_sequence((arguments$)["slice"](1), scope, context, false);
|
|
973
|
+
}));
|
|
974
|
+
{
|
|
975
|
+
let body_state = __eliscript_value_89;
|
|
976
|
+
((context)["loopProtected"] = saved);
|
|
977
|
+
return ((context)["state"] = merge_state(baseline, [baseline, body_state]));
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
483
981
|
}
|
|
484
982
|
function analyze_assignment(arguments$, scope, context) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
983
|
+
{
|
|
984
|
+
const __eliscript_value_90 = 0;
|
|
985
|
+
{
|
|
986
|
+
let index = __eliscript_value_90;
|
|
987
|
+
while (__eliscript_numeric_relation("<", index, (arguments$)["length"])) {
|
|
988
|
+
{
|
|
989
|
+
let name = ((((arguments$) ?? [])[index]) ?? null);
|
|
990
|
+
let binding = ((__eliscript_value_91) => (__eliscript_truthy(__eliscript_value_91) ? lookup_binding(scope, node_name(name)) : __eliscript_value_91))(symbol_node_p(name));
|
|
991
|
+
if (__eliscript_truthy(((__eliscript_value_92) => (__eliscript_truthy(__eliscript_value_92) ? (binding)["resource"] : __eliscript_value_92))(binding))) {
|
|
992
|
+
(__eliscript_tdz_read_0())((context)["filename"], node_span(name), (String("transient binding ") + String(node_name(name)) + String(" cannot be reassigned")));
|
|
993
|
+
}
|
|
994
|
+
analyze_expression(((((arguments$) ?? [])[(index + 1)]) ?? null), scope, context, true);
|
|
995
|
+
}
|
|
496
996
|
((index = (index + 2)));
|
|
497
997
|
}
|
|
498
998
|
return null;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
501
1001
|
}
|
|
502
1002
|
function clause_operator(form) {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
1003
|
+
{
|
|
1004
|
+
const __eliscript_value_93 = list_items(form);
|
|
1005
|
+
{
|
|
1006
|
+
let items = __eliscript_value_93;
|
|
1007
|
+
return ((__eliscript_value_94) => (__eliscript_truthy(__eliscript_value_94) ? ((__eliscript_value_95) => (__eliscript_truthy(__eliscript_value_95) ? ((__eliscript_value_96) => (__eliscript_truthy(__eliscript_value_96) ? node_name(((((items) ?? [])[0]) ?? null)) : __eliscript_value_96))(symbol_node_p(((((items) ?? [])[0]) ?? null))) : __eliscript_value_95))(__eliscript_numeric_relation(">", (items)["length"], 0)) : __eliscript_value_94))((!(items === undefined)));
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
506
1010
|
}
|
|
507
1011
|
function analyze_try(arguments$, scope, context, value_context) {
|
|
508
|
-
|
|
509
|
-
(
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
1012
|
+
{
|
|
1013
|
+
const __eliscript_value_97 = copy_state(context);
|
|
1014
|
+
const __eliscript_value_98 = [];
|
|
1015
|
+
const __eliscript_value_99 = null;
|
|
1016
|
+
const __eliscript_value_100 = null;
|
|
1017
|
+
{
|
|
1018
|
+
let baseline = __eliscript_value_97;
|
|
1019
|
+
let body = __eliscript_value_98;
|
|
1020
|
+
let catch_clause = __eliscript_value_99;
|
|
1021
|
+
let finally_clause = __eliscript_value_100;
|
|
1022
|
+
(arguments$)["forEach"](((argument) => {
|
|
1023
|
+
{
|
|
1024
|
+
const __eliscript_value_101 = clause_operator(argument);
|
|
1025
|
+
{
|
|
1026
|
+
let operator = __eliscript_value_101;
|
|
1027
|
+
if ((operator === "catch")) {
|
|
1028
|
+
return ((catch_clause = argument));
|
|
1029
|
+
} else {
|
|
1030
|
+
if ((operator === "finally")) {
|
|
1031
|
+
return ((finally_clause = argument));
|
|
1032
|
+
} else {
|
|
1033
|
+
return (body)["push"](argument);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
}));
|
|
1039
|
+
{
|
|
1040
|
+
let saved_prefixes = (context)["tryPrefixes"];
|
|
1041
|
+
let prefixes = [baseline];
|
|
1042
|
+
((context)["tryPrefixes"] = prefixes);
|
|
1043
|
+
{
|
|
1044
|
+
const __eliscript_value_102 = run_with_state(context, baseline, (() => {
|
|
1045
|
+
return analyze_sequence(body, scope, context, value_context);
|
|
1046
|
+
}));
|
|
1047
|
+
{
|
|
1048
|
+
let normal_state = __eliscript_value_102;
|
|
519
1049
|
((context)["tryPrefixes"] = saved_prefixes);
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
})((__eliscript_truthy(catch_clause) ? ((items) => {
|
|
1050
|
+
{
|
|
1051
|
+
let exception_state = merge_state(baseline, prefixes);
|
|
1052
|
+
let catch_state = (__eliscript_truthy(catch_clause) ? ((items) => {
|
|
524
1053
|
return ((child) => {
|
|
525
1054
|
return (() => {
|
|
526
1055
|
install_bindings(child, make_pattern_bindings(((((items) ?? [])[1]) ?? null), context));
|
|
527
|
-
return run_with_state(context, exception_state, () => {
|
|
1056
|
+
return run_with_state(context, exception_state, (() => {
|
|
528
1057
|
return analyze_sequence((items)["slice"](2), child, context, value_context);
|
|
529
|
-
});
|
|
1058
|
+
}));
|
|
530
1059
|
})();
|
|
531
1060
|
})(make_scope(scope));
|
|
532
|
-
})(list_items(catch_clause)) : exception_state)
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
1061
|
+
})(list_items(catch_clause)) : exception_state);
|
|
1062
|
+
((context)["state"] = merge_state(baseline, [normal_state, catch_state]));
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
if (__eliscript_truthy(finally_clause)) {
|
|
1068
|
+
return analyze_sequence((list_items(finally_clause))["slice"](1), scope, context, false);
|
|
1069
|
+
} else {
|
|
1070
|
+
return null;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
542
1074
|
}
|
|
543
1075
|
function analyze_call(form, scope, context, value_context) {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
1076
|
+
{
|
|
1077
|
+
let items = node_items(form);
|
|
1078
|
+
let operator_node = ((((items) ?? [])[0]) ?? null);
|
|
1079
|
+
let operator = ((__eliscript_value_103) => (__eliscript_truthy(__eliscript_value_103) ? node_name(operator_node) : __eliscript_value_103))(symbol_node_p(operator_node));
|
|
1080
|
+
let arguments$ = (items)["slice"](1);
|
|
1081
|
+
let binding = operator_binding(operator_node, scope);
|
|
1082
|
+
if (__eliscript_truthy(binding)) {
|
|
1083
|
+
return analyze_operation((binding)["operation"], form, arguments$, scope, context, value_context);
|
|
1084
|
+
} else {
|
|
1085
|
+
if (((operator === "lambda") || (operator === "fn") || (operator === "async"))) {
|
|
1086
|
+
return analyze_function(((((arguments$) ?? [])[0]) ?? null), (arguments$)["slice"](1), scope, context);
|
|
1087
|
+
} else {
|
|
1088
|
+
if ((operator === "await")) {
|
|
1089
|
+
return analyze_await(form, arguments$, scope, context);
|
|
1090
|
+
} else {
|
|
1091
|
+
if (((operator === "quote") || (operator === "js*"))) {
|
|
1092
|
+
return null;
|
|
1093
|
+
} else {
|
|
1094
|
+
if ((operator === "let")) {
|
|
1095
|
+
return analyze_let(arguments$, scope, context, false, value_context);
|
|
1096
|
+
} else {
|
|
1097
|
+
if ((operator === "let*")) {
|
|
1098
|
+
return analyze_let(arguments$, scope, context, true, value_context);
|
|
1099
|
+
} else {
|
|
1100
|
+
if ((operator === "loop")) {
|
|
1101
|
+
return analyze_loop(arguments$, scope, context, value_context);
|
|
1102
|
+
} else {
|
|
1103
|
+
if ((operator === "while")) {
|
|
1104
|
+
return analyze_while(arguments$, scope, context);
|
|
1105
|
+
} else {
|
|
1106
|
+
if (((operator === "setq") || (operator === "set!"))) {
|
|
1107
|
+
return analyze_assignment(arguments$, scope, context);
|
|
1108
|
+
} else {
|
|
1109
|
+
if ((operator === "if")) {
|
|
1110
|
+
return analyze_if(arguments$, scope, context, value_context);
|
|
1111
|
+
} else {
|
|
1112
|
+
if (((operator === "when") || (operator === "unless"))) {
|
|
1113
|
+
return analyze_when(arguments$, scope, context, value_context);
|
|
1114
|
+
} else {
|
|
1115
|
+
if (((operator === "and") || (operator === "or"))) {
|
|
1116
|
+
return analyze_short_circuit(arguments$, scope, context, value_context);
|
|
1117
|
+
} else {
|
|
1118
|
+
if ((operator === "cond")) {
|
|
1119
|
+
return analyze_cond(arguments$, scope, context, value_context);
|
|
1120
|
+
} else {
|
|
1121
|
+
if ((operator === "try")) {
|
|
1122
|
+
return analyze_try(arguments$, scope, context, value_context);
|
|
1123
|
+
} else {
|
|
1124
|
+
if (((operator === "progn") || (operator === "do"))) {
|
|
1125
|
+
return analyze_sequence(arguments$, scope, context, value_context);
|
|
1126
|
+
} else {
|
|
1127
|
+
{
|
|
1128
|
+
const __eliscript_value_104 = ((__eliscript_value_105) => (__eliscript_truthy(__eliscript_value_105) ? lookup_binding(scope, operator) : __eliscript_value_105))(operator);
|
|
1129
|
+
{
|
|
1130
|
+
let operator_binding = __eliscript_value_104;
|
|
1131
|
+
if (__eliscript_truthy(((__eliscript_value_106) => (__eliscript_truthy(__eliscript_value_106) ? ((__eliscript_value_107) => (__eliscript_truthy(__eliscript_value_107) ? __eliscript_value_107 : (operator_binding)["resource"]))((operator_binding)["operation"]) : __eliscript_value_106))(operator_binding))) {
|
|
1132
|
+
analyze_reference(operator_node, scope, context);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
return (arguments$)["forEach"](((argument) => {
|
|
1137
|
+
return analyze_expression(argument, scope, context, true);
|
|
1138
|
+
}));
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
562
1155
|
}
|
|
563
1156
|
function analyze_expression(form, scope, context, value_context) {
|
|
564
|
-
|
|
1157
|
+
if (__eliscript_truthy(form)) {
|
|
565
1158
|
record_try_prefix(context);
|
|
566
|
-
(
|
|
567
|
-
|
|
568
|
-
}
|
|
1159
|
+
if ((node_kind(form) === "symbol")) {
|
|
1160
|
+
analyze_reference(form, scope, context);
|
|
1161
|
+
} else {
|
|
1162
|
+
if ((node_kind(form) === "vector")) {
|
|
1163
|
+
(node_items(form))["forEach"](((item) => {
|
|
1164
|
+
return analyze_expression(item, scope, context, true);
|
|
1165
|
+
}));
|
|
1166
|
+
} else {
|
|
1167
|
+
if ((node_kind(form) === "list")) {
|
|
1168
|
+
analyze_call(form, scope, context, value_context);
|
|
1169
|
+
} else {
|
|
1170
|
+
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
569
1174
|
return record_try_prefix(context);
|
|
570
|
-
}
|
|
1175
|
+
} else {
|
|
1176
|
+
return null;
|
|
1177
|
+
}
|
|
571
1178
|
}
|
|
572
1179
|
function import_declarations(arguments$, scope) {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
1180
|
+
{
|
|
1181
|
+
let source = node_value(((((arguments$) ?? [])[0]) ?? null));
|
|
1182
|
+
let family = (__eliscript_tdz_read_1())(source);
|
|
1183
|
+
let index = 1;
|
|
1184
|
+
while (__eliscript_numeric_relation("<", index, (arguments$)["length"])) {
|
|
1185
|
+
{
|
|
1186
|
+
const __eliscript_value_108 = ((((arguments$) ?? [])[index]) ?? null);
|
|
1187
|
+
{
|
|
1188
|
+
let specifier = __eliscript_value_108;
|
|
1189
|
+
if ((node_kind(specifier) === "keyword")) {
|
|
1190
|
+
{
|
|
1191
|
+
const __eliscript_value_109 = node_name(specifier);
|
|
1192
|
+
const __eliscript_value_110 = ((((arguments$) ?? [])[(index + 1)]) ?? null);
|
|
1193
|
+
{
|
|
1194
|
+
let keyword = __eliscript_value_109;
|
|
1195
|
+
let name = __eliscript_value_110;
|
|
1196
|
+
declare_binding(scope, name, null, ((__eliscript_value_111) => (__eliscript_truthy(__eliscript_value_111) ? family : __eliscript_value_111))((keyword === "as")));
|
|
1197
|
+
((index = (index + 2)));
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
} else {
|
|
1201
|
+
declare_binding(scope, specifier, ((__eliscript_value_112) => (__eliscript_truthy(__eliscript_value_112) ? transient_operation(family, node_name(specifier)) : __eliscript_value_112))(family));
|
|
1202
|
+
((index = (index + 1)));
|
|
587
1203
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
return null;
|
|
1208
|
+
}
|
|
593
1209
|
}
|
|
594
1210
|
function flatten_modules_into(forms, result) {
|
|
595
|
-
return (forms)["forEach"]((form) => {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
1211
|
+
return (forms)["forEach"](((form) => {
|
|
1212
|
+
{
|
|
1213
|
+
const __eliscript_value_113 = list_items(form);
|
|
1214
|
+
{
|
|
1215
|
+
let items = __eliscript_value_113;
|
|
1216
|
+
if (__eliscript_truthy(((__eliscript_value_114) => (__eliscript_truthy(__eliscript_value_114) ? ((__eliscript_value_115) => (__eliscript_truthy(__eliscript_value_115) ? ((__eliscript_value_116) => (__eliscript_truthy(__eliscript_value_116) ? (node_name(((((items) ?? [])[0]) ?? null)) === "module") : __eliscript_value_116))(symbol_node_p(((((items) ?? [])[0]) ?? null))) : __eliscript_value_115))(__eliscript_numeric_relation(">", (items)["length"], 0)) : __eliscript_value_114))((!(items === undefined))))) {
|
|
1217
|
+
return flatten_modules_into((items)["slice"](2), result);
|
|
1218
|
+
} else {
|
|
1219
|
+
return (result)["push"](form);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
}));
|
|
600
1224
|
}
|
|
601
1225
|
function flatten_modules(forms) {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
1226
|
+
{
|
|
1227
|
+
const __eliscript_value_117 = [];
|
|
1228
|
+
{
|
|
1229
|
+
let result = __eliscript_value_117;
|
|
1230
|
+
flatten_modules_into(forms, result);
|
|
1231
|
+
return result;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
606
1234
|
}
|
|
607
1235
|
function predeclare_top_level(forms, scope, context) {
|
|
608
|
-
(forms)["forEach"]((form) => {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
1236
|
+
(forms)["forEach"](((form) => {
|
|
1237
|
+
{
|
|
1238
|
+
const __eliscript_value_118 = list_items(form);
|
|
1239
|
+
{
|
|
1240
|
+
let items = __eliscript_value_118;
|
|
1241
|
+
if (__eliscript_truthy(((__eliscript_value_119) => (__eliscript_truthy(__eliscript_value_119) ? ((__eliscript_value_120) => (__eliscript_truthy(__eliscript_value_120) ? symbol_node_p(((((items) ?? [])[0]) ?? null)) : __eliscript_value_120))(__eliscript_numeric_relation(">", (items)["length"], 1)) : __eliscript_value_119))((!(items === undefined))))) {
|
|
1242
|
+
{
|
|
1243
|
+
const __eliscript_value_121 = node_name(((((items) ?? [])[0]) ?? null));
|
|
1244
|
+
{
|
|
1245
|
+
let operator = __eliscript_value_121;
|
|
1246
|
+
if (((operator === "import") || (operator === "import-portable"))) {
|
|
1247
|
+
return import_declarations((items)["slice"](1), scope);
|
|
1248
|
+
} else {
|
|
1249
|
+
if (((operator === "defvar") || (operator === "defconst") || (operator === "defun") || (operator === "defn") || (operator === "defportable") || (operator === "defasync"))) {
|
|
1250
|
+
return declare_binding(scope, ((((items) ?? [])[1]) ?? null));
|
|
1251
|
+
} else {
|
|
1252
|
+
return null;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
} else {
|
|
1258
|
+
return null;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}));
|
|
1263
|
+
return (forms)["forEach"](((form) => {
|
|
1264
|
+
{
|
|
1265
|
+
const __eliscript_value_122 = list_items(form);
|
|
1266
|
+
{
|
|
1267
|
+
let items = __eliscript_value_122;
|
|
1268
|
+
if (__eliscript_truthy(((__eliscript_value_123) => (__eliscript_truthy(__eliscript_value_123) ? ((__eliscript_value_124) => (__eliscript_truthy(__eliscript_value_124) ? ((__eliscript_value_125) => (__eliscript_truthy(__eliscript_value_125) ? ((__eliscript_value_126) => (__eliscript_truthy(__eliscript_value_126) ? constructor_call_p(((((items) ?? [])[2]) ?? null), scope) : __eliscript_value_126))(((node_name(((((items) ?? [])[0]) ?? null)) === "defvar") || (node_name(((((items) ?? [])[0]) ?? null)) === "defconst"))) : __eliscript_value_125))(symbol_node_p(((((items) ?? [])[0]) ?? null))) : __eliscript_value_124))(__eliscript_numeric_relation(">", (items)["length"], 2)) : __eliscript_value_123))((!(items === undefined))))) {
|
|
1269
|
+
return new_resource(lookup_binding(scope, node_name(((((items) ?? [])[1]) ?? null))), node_span(((((items) ?? [])[2]) ?? null)), context);
|
|
1270
|
+
} else {
|
|
1271
|
+
return null;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
}));
|
|
620
1276
|
}
|
|
621
1277
|
function check_export(name, scope, context) {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
1278
|
+
{
|
|
1279
|
+
const __eliscript_value_127 = ((__eliscript_value_128) => (__eliscript_truthy(__eliscript_value_128) ? lookup_binding(scope, node_name(name)) : __eliscript_value_128))(symbol_node_p(name));
|
|
1280
|
+
{
|
|
1281
|
+
let binding = __eliscript_value_127;
|
|
1282
|
+
if (__eliscript_truthy(((__eliscript_value_129) => (__eliscript_truthy(__eliscript_value_129) ? (binding)["resource"] : __eliscript_value_129))(binding))) {
|
|
1283
|
+
return (__eliscript_tdz_read_0())((context)["filename"], node_span(name), (String("transient binding ") + String(node_name(name)) + String(" cannot be exported")));
|
|
1284
|
+
} else {
|
|
1285
|
+
return null;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
625
1289
|
}
|
|
626
1290
|
function analyze_top_level(form, scope, context) {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
1291
|
+
{
|
|
1292
|
+
const __eliscript_value_130 = list_items(form);
|
|
1293
|
+
{
|
|
1294
|
+
let items = __eliscript_value_130;
|
|
1295
|
+
if (((items === undefined) || ((items)["length"] === 0))) {
|
|
1296
|
+
return analyze_expression(form, scope, context, false);
|
|
1297
|
+
} else {
|
|
1298
|
+
{
|
|
1299
|
+
let operator_node = ((((items) ?? [])[0]) ?? null);
|
|
1300
|
+
let operator = ((__eliscript_value_131) => (__eliscript_truthy(__eliscript_value_131) ? node_name(operator_node) : __eliscript_value_131))(symbol_node_p(operator_node));
|
|
1301
|
+
let arguments$ = (items)["slice"](1);
|
|
1302
|
+
if (((operator === "import") || (operator === "import-portable"))) {
|
|
1303
|
+
return null;
|
|
1304
|
+
} else {
|
|
1305
|
+
if (((operator === "defvar") || (operator === "defconst"))) {
|
|
1306
|
+
{
|
|
1307
|
+
const __eliscript_value_132 = lookup_binding(scope, node_name(((((arguments$) ?? [])[0]) ?? null)));
|
|
1308
|
+
{
|
|
1309
|
+
let binding = __eliscript_value_132;
|
|
1310
|
+
return analyze_initializer(((((arguments$) ?? [])[1]) ?? null), scope, [binding], context, true);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
} else {
|
|
1314
|
+
if (((operator === "defun") || (operator === "defn") || (operator === "defportable") || (operator === "defasync"))) {
|
|
1315
|
+
return analyze_function(((((arguments$) ?? [])[1]) ?? null), (arguments$)["slice"](2), scope, context);
|
|
1316
|
+
} else {
|
|
1317
|
+
if ((operator === "export")) {
|
|
1318
|
+
return (arguments$)["forEach"](((name) => {
|
|
1319
|
+
return check_export(name, scope, context);
|
|
1320
|
+
}));
|
|
1321
|
+
} else {
|
|
1322
|
+
if ((operator === "export-default")) {
|
|
1323
|
+
check_export(((((arguments$) ?? [])[0]) ?? null), scope, context);
|
|
1324
|
+
return analyze_expression(((((arguments$) ?? [])[0]) ?? null), scope, context, true);
|
|
1325
|
+
} else {
|
|
1326
|
+
return analyze_expression(form, scope, context, false);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
643
1336
|
}
|
|
644
1337
|
function analyze_transients(forms, filename) {
|
|
645
|
-
(
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
1338
|
+
if ((!__eliscript_truthy((__eliscript_tdz_read_2())(filename)))) {
|
|
1339
|
+
{
|
|
1340
|
+
const __eliscript_value_133 = ({"filename": filename, "state": new (Map)(), "functionId": 0, "nextFunctionId": 0, "loopProtected": [], "tryPrefixes": null});
|
|
1341
|
+
{
|
|
1342
|
+
let context = __eliscript_value_133;
|
|
1343
|
+
{
|
|
1344
|
+
let flattened = flatten_modules(forms);
|
|
1345
|
+
let scope = make_scope(null);
|
|
649
1346
|
predeclare_top_level(flattened, scope, context);
|
|
650
|
-
|
|
1347
|
+
(flattened)["forEach"](((form) => {
|
|
651
1348
|
return analyze_top_level(form, scope, context);
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
1349
|
+
}));
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
657
1354
|
return forms;
|
|
658
1355
|
}
|
|
659
1356
|
export {analyze_transients};
|
|
660
|
-
//# sourceMappingURL=transient-analysis.mjs.map
|