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
|
@@ -510,6 +510,11 @@ When PREDECLARED is non-nil, reuse an already attached top-level resource."
|
|
|
510
510
|
(eliscript-transient--analyze-sequence
|
|
511
511
|
(cdr (eliscript-form-value finally-clause)) scope nil))))
|
|
512
512
|
|
|
513
|
+
(defun eliscript-transient--utf16-less-p (left right)
|
|
514
|
+
"Compare LEFT and RIGHT by UTF-16 code units without locale collation."
|
|
515
|
+
(string-lessp (encode-coding-string left 'utf-16be t)
|
|
516
|
+
(encode-coding-string right 'utf-16be t)))
|
|
517
|
+
|
|
513
518
|
(defun eliscript-transient--visible-active-resources ()
|
|
514
519
|
"Return active or maybe-active resources owned by the current function."
|
|
515
520
|
(let (resources)
|
|
@@ -522,7 +527,7 @@ When PREDECLARED is non-nil, reuse an already attached top-level resource."
|
|
|
522
527
|
eliscript-transient--state)
|
|
523
528
|
(sort resources
|
|
524
529
|
(lambda (left right)
|
|
525
|
-
(
|
|
530
|
+
(eliscript-transient--utf16-less-p
|
|
526
531
|
(symbol-name (eliscript-transient--resource-name left))
|
|
527
532
|
(symbol-name (eliscript-transient--resource-name right)))))))
|
|
528
533
|
|
|
@@ -678,23 +683,366 @@ When PREDECLARED is non-nil, reuse an already attached top-level resource."
|
|
|
678
683
|
(dolist (argument arguments)
|
|
679
684
|
(eliscript-transient--analyze-expression argument scope t)))))))
|
|
680
685
|
|
|
681
|
-
(
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
686
|
+
(defvar eliscript-transient--task-active nil)
|
|
687
|
+
(defvar eliscript-transient--task-context nil)
|
|
688
|
+
(defvar eliscript-transient--pending-tasks nil)
|
|
689
|
+
|
|
690
|
+
;; Context slots are state, function id, next function id, repeated-loop
|
|
691
|
+
;; protection, and an optional shared cell of exceptional try-prefix states.
|
|
692
|
+
;; A branch owns its state slot; only an explicit continuation merges it.
|
|
693
|
+
(defun eliscript-transient--enqueue (action &optional context)
|
|
694
|
+
"Schedule ACTION in CONTEXT with its original diagnostic span."
|
|
695
|
+
(push (vector action (or context eliscript-transient--task-context)
|
|
696
|
+
eliscript-transient--current-span)
|
|
697
|
+
eliscript-transient--pending-tasks))
|
|
698
|
+
|
|
699
|
+
(defun eliscript-transient--branch-context (state)
|
|
700
|
+
"Copy the current control context with a private copy of STATE."
|
|
701
|
+
(let ((context (copy-sequence eliscript-transient--task-context)))
|
|
702
|
+
(aset context 0 (copy-hash-table state))
|
|
703
|
+
context))
|
|
704
|
+
|
|
705
|
+
(defun eliscript-transient--enqueue-expression
|
|
706
|
+
(form scope value-context &optional context)
|
|
707
|
+
"Schedule FORM in SCOPE with VALUE-CONTEXT and optional control CONTEXT."
|
|
708
|
+
(eliscript-transient--enqueue
|
|
709
|
+
(lambda ()
|
|
710
|
+
(when form
|
|
711
|
+
(let* ((eliscript-transient--current-span
|
|
712
|
+
(or (eliscript-form-span form) eliscript-transient--current-span))
|
|
713
|
+
(value (eliscript-form-value form)))
|
|
714
|
+
(eliscript-transient--record-try-prefix)
|
|
715
|
+
(cond
|
|
716
|
+
((symbolp value) (eliscript-transient--analyze-reference form scope))
|
|
717
|
+
((vectorp value)
|
|
718
|
+
(dolist (item (append value nil))
|
|
719
|
+
(eliscript-transient--enqueue-expression item scope t)))
|
|
720
|
+
((consp value)
|
|
721
|
+
(eliscript-transient--analyze-call-tasks form scope value-context)))
|
|
722
|
+
;; Recording after descendants is an explicit continuation: recording
|
|
723
|
+
;; here immediately would miss completion in a nested expression.
|
|
724
|
+
(eliscript-transient--enqueue #'eliscript-transient--record-try-prefix))))
|
|
725
|
+
context))
|
|
726
|
+
|
|
727
|
+
(defun eliscript-transient--enqueue-sequence (forms scope value-context &optional context)
|
|
728
|
+
"Schedule FORMS in order with VALUE-CONTEXT only on the last form."
|
|
729
|
+
(while forms
|
|
730
|
+
(eliscript-transient--enqueue-expression
|
|
731
|
+
(car forms) scope (and value-context (null (cdr forms))) context)
|
|
732
|
+
(setq forms (cdr forms))))
|
|
733
|
+
|
|
734
|
+
(defun eliscript-transient--enqueue-initializer (initializer scope bindings)
|
|
735
|
+
"Schedule INITIALIZER, attaching its fresh resource only after its argument."
|
|
736
|
+
(eliscript-transient--enqueue
|
|
737
|
+
(lambda ()
|
|
738
|
+
(if (and initializer
|
|
739
|
+
(eliscript-transient--constructor-call-p initializer scope))
|
|
740
|
+
(let* ((value (eliscript-form-value initializer)) (arguments (cdr value)))
|
|
741
|
+
(unless (and (= (length bindings) 1)
|
|
742
|
+
(symbolp (eliscript-transient--binding-name (car bindings))))
|
|
743
|
+
(let ((eliscript-transient--current-span
|
|
744
|
+
(or (eliscript-form-span initializer)
|
|
745
|
+
eliscript-transient--current-span)))
|
|
746
|
+
(eliscript-transient--fail
|
|
747
|
+
"transient result must be bound directly to one symbol")))
|
|
748
|
+
(unless (= (length arguments) 1)
|
|
749
|
+
(let ((eliscript-transient--current-span
|
|
750
|
+
(or (eliscript-form-span initializer)
|
|
751
|
+
eliscript-transient--current-span)))
|
|
752
|
+
(eliscript-transient--fail "transient expects 1 argument")))
|
|
753
|
+
(eliscript-transient--enqueue-expression (car arguments) scope t)
|
|
754
|
+
(eliscript-transient--enqueue
|
|
755
|
+
(lambda ()
|
|
756
|
+
(eliscript-transient--new-resource
|
|
757
|
+
(car bindings) (eliscript-form-span initializer)))))
|
|
758
|
+
(when initializer
|
|
759
|
+
(eliscript-transient--enqueue-expression initializer scope t))))))
|
|
760
|
+
|
|
761
|
+
(defun eliscript-transient--enqueue-let (arguments scope sequential value-context)
|
|
762
|
+
"Schedule lexical binding ARGUMENTS and restore visible state on exit."
|
|
763
|
+
(let* ((baseline (eliscript-transient--copy-state))
|
|
764
|
+
(bindings (eliscript-form-value (car arguments)))
|
|
765
|
+
(child (eliscript-transient--make-scope scope)))
|
|
766
|
+
(if sequential
|
|
767
|
+
(dolist (entry bindings)
|
|
768
|
+
(let ((entry entry))
|
|
769
|
+
(eliscript-transient--enqueue
|
|
770
|
+
(lambda ()
|
|
771
|
+
(pcase-let* ((`(,target ,initializer)
|
|
772
|
+
(eliscript-transient--binding-pair entry))
|
|
773
|
+
(declared (eliscript-transient--make-pattern-bindings target)))
|
|
774
|
+
(eliscript-transient--enqueue-initializer initializer child declared)
|
|
775
|
+
(eliscript-transient--enqueue
|
|
776
|
+
(lambda () (eliscript-transient--install-bindings child declared))))))))
|
|
777
|
+
(let ((parsed (mapcar #'eliscript-transient--binding-pair bindings)) declared)
|
|
778
|
+
(dolist (entry parsed)
|
|
779
|
+
(push (eliscript-transient--make-pattern-bindings (car entry)) declared))
|
|
780
|
+
(setq declared (nreverse declared))
|
|
781
|
+
(cl-mapc (lambda (entry targets)
|
|
782
|
+
(eliscript-transient--enqueue-initializer (cadr entry) scope targets))
|
|
783
|
+
parsed declared)
|
|
784
|
+
(eliscript-transient--enqueue
|
|
785
|
+
(lambda ()
|
|
786
|
+
(dolist (targets declared)
|
|
787
|
+
(eliscript-transient--install-bindings child targets))))))
|
|
788
|
+
(eliscript-transient--enqueue-sequence (cdr arguments) child value-context)
|
|
789
|
+
(eliscript-transient--enqueue
|
|
790
|
+
(lambda () (eliscript-transient--retain-state-keys baseline)))))
|
|
791
|
+
|
|
792
|
+
(defun eliscript-transient--enqueue-function (parameters body scope)
|
|
793
|
+
"Schedule an independently owned function with PARAMETERS and BODY."
|
|
794
|
+
(let* ((context (eliscript-transient--branch-context eliscript-transient--state))
|
|
795
|
+
(id (1+ eliscript-transient--next-function-id))
|
|
796
|
+
(child (eliscript-transient--make-scope scope)))
|
|
797
|
+
(aset context 1 id) (aset context 2 id) (aset context 3 nil)
|
|
798
|
+
(dolist (parameter (eliscript-parameters-parse
|
|
799
|
+
parameters (lambda (_form message) (error "%s" message))))
|
|
800
|
+
(eliscript-transient--declare-pattern child (eliscript-parameter-form parameter)))
|
|
801
|
+
(eliscript-transient--enqueue-sequence body child t context)))
|
|
802
|
+
|
|
803
|
+
(defun eliscript-transient--enqueue-if (arguments scope value-context)
|
|
804
|
+
"Schedule the test, isolated branches and original ownership merge."
|
|
805
|
+
(eliscript-transient--enqueue-expression (car arguments) scope t)
|
|
806
|
+
(eliscript-transient--enqueue
|
|
807
|
+
(lambda ()
|
|
808
|
+
(let* ((baseline (eliscript-transient--copy-state))
|
|
809
|
+
(then-context (eliscript-transient--branch-context baseline))
|
|
810
|
+
(else-context (eliscript-transient--branch-context baseline)))
|
|
811
|
+
(eliscript-transient--enqueue-expression
|
|
812
|
+
(cadr arguments) scope value-context then-context)
|
|
813
|
+
(when (cddr arguments)
|
|
814
|
+
(eliscript-transient--enqueue-expression
|
|
815
|
+
(caddr arguments) scope value-context else-context))
|
|
816
|
+
(eliscript-transient--enqueue
|
|
817
|
+
(lambda ()
|
|
818
|
+
(setq eliscript-transient--state
|
|
819
|
+
(eliscript-transient--merge-state
|
|
820
|
+
baseline (list (aref then-context 0) (aref else-context 0))))))))))
|
|
821
|
+
|
|
822
|
+
(defun eliscript-transient--enqueue-when (arguments scope value-context)
|
|
823
|
+
"Schedule a conditional body and its implicit unchanged branch."
|
|
824
|
+
(eliscript-transient--enqueue-expression (car arguments) scope t)
|
|
825
|
+
(eliscript-transient--enqueue
|
|
826
|
+
(lambda ()
|
|
827
|
+
(let* ((baseline (eliscript-transient--copy-state))
|
|
828
|
+
(body-context (eliscript-transient--branch-context baseline)))
|
|
829
|
+
(eliscript-transient--enqueue-sequence
|
|
830
|
+
(cdr arguments) scope value-context body-context)
|
|
831
|
+
(eliscript-transient--enqueue
|
|
832
|
+
(lambda ()
|
|
833
|
+
(setq eliscript-transient--state
|
|
834
|
+
(eliscript-transient--merge-state
|
|
835
|
+
baseline (list baseline (aref body-context 0))))))))))
|
|
836
|
+
|
|
837
|
+
(defun eliscript-transient--enqueue-short-circuit (arguments scope value-context)
|
|
838
|
+
"Schedule each short-circuit operand and retain every possible exit."
|
|
839
|
+
(let ((exits (list nil)))
|
|
840
|
+
(dolist (argument arguments)
|
|
841
|
+
(eliscript-transient--enqueue-expression argument scope value-context)
|
|
842
|
+
(eliscript-transient--enqueue
|
|
843
|
+
(lambda () (push (eliscript-transient--copy-state) (car exits)))))
|
|
844
|
+
(eliscript-transient--enqueue
|
|
845
|
+
(lambda ()
|
|
846
|
+
(when (car exits)
|
|
847
|
+
(setq eliscript-transient--state
|
|
848
|
+
(eliscript-transient--merge-state
|
|
849
|
+
(car (last (car exits))) (car exits))))))))
|
|
850
|
+
|
|
851
|
+
(defun eliscript-transient--enqueue-cond-step
|
|
852
|
+
(clauses scope value-context baseline exits)
|
|
853
|
+
"Schedule the next COND clause and the continuation over remaining CLAUSES."
|
|
854
|
+
(if (null clauses)
|
|
855
|
+
(progn
|
|
856
|
+
(push (eliscript-transient--copy-state) (car exits))
|
|
857
|
+
(setq eliscript-transient--state
|
|
858
|
+
(eliscript-transient--merge-state baseline (car exits))))
|
|
859
|
+
(let* ((items (eliscript-form-value (car clauses))) (test (car items)))
|
|
860
|
+
(eliscript-transient--enqueue-expression test scope t)
|
|
861
|
+
(eliscript-transient--enqueue
|
|
862
|
+
(lambda ()
|
|
863
|
+
(let ((body-context (eliscript-transient--branch-context
|
|
864
|
+
(eliscript-transient--copy-state))))
|
|
865
|
+
(eliscript-transient--enqueue-sequence
|
|
866
|
+
(cdr items) scope value-context body-context)
|
|
867
|
+
(eliscript-transient--enqueue
|
|
868
|
+
(lambda ()
|
|
869
|
+
(push (aref body-context 0) (car exits))
|
|
870
|
+
(if (eq (eliscript-form-value test) t)
|
|
871
|
+
(setq eliscript-transient--state
|
|
872
|
+
(eliscript-transient--merge-state baseline (car exits)))
|
|
873
|
+
(eliscript-transient--enqueue-cond-step
|
|
874
|
+
(cdr clauses) scope value-context baseline exits))))))))))
|
|
875
|
+
|
|
876
|
+
(defun eliscript-transient--enqueue-try (arguments scope value-context)
|
|
877
|
+
"Schedule TRY normal, exceptional, catch and finally states without recursion."
|
|
878
|
+
(let ((baseline (eliscript-transient--copy-state)) body catch-clause finally-clause)
|
|
879
|
+
(dolist (argument arguments)
|
|
689
880
|
(cond
|
|
690
|
-
((
|
|
691
|
-
|
|
692
|
-
((
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
881
|
+
((eliscript-transient--try-clause-p argument 'catch) (setq catch-clause argument))
|
|
882
|
+
((eliscript-transient--try-clause-p argument 'finally) (setq finally-clause argument))
|
|
883
|
+
(t (push argument body))))
|
|
884
|
+
(let* ((prefixes (list (list (copy-hash-table baseline))))
|
|
885
|
+
(normal-context (eliscript-transient--branch-context baseline)))
|
|
886
|
+
(aset normal-context 4 prefixes)
|
|
887
|
+
(eliscript-transient--enqueue-sequence
|
|
888
|
+
(nreverse body) scope value-context normal-context)
|
|
889
|
+
(eliscript-transient--enqueue
|
|
890
|
+
(lambda ()
|
|
891
|
+
(let* ((exception-state (eliscript-transient--merge-state baseline (car prefixes)))
|
|
892
|
+
(catch-context (eliscript-transient--branch-context exception-state)))
|
|
893
|
+
(aset catch-context 4 prefixes)
|
|
894
|
+
(when catch-clause
|
|
895
|
+
(let* ((items (eliscript-form-value catch-clause))
|
|
896
|
+
(child (eliscript-transient--make-scope scope)))
|
|
897
|
+
(eliscript-transient--declare-pattern child (cadr items))
|
|
898
|
+
(eliscript-transient--enqueue-sequence
|
|
899
|
+
(cddr items) child value-context catch-context)))
|
|
900
|
+
(eliscript-transient--enqueue
|
|
901
|
+
(lambda ()
|
|
902
|
+
(setq eliscript-transient--state
|
|
903
|
+
(eliscript-transient--merge-state
|
|
904
|
+
baseline (list (aref normal-context 0) (aref catch-context 0))))
|
|
905
|
+
(when finally-clause
|
|
906
|
+
(eliscript-transient--enqueue-sequence
|
|
907
|
+
(cdr (eliscript-form-value finally-clause)) scope nil))))))))))
|
|
908
|
+
|
|
909
|
+
(defun eliscript-transient--enqueue-loop (arguments scope value-context)
|
|
910
|
+
"Schedule loop initialization, protected body and visible-resource cleanup."
|
|
911
|
+
(let* ((baseline (eliscript-transient--copy-state))
|
|
912
|
+
(child (eliscript-transient--make-scope scope)))
|
|
913
|
+
(dolist (entry (eliscript-form-value (car arguments)))
|
|
914
|
+
(let ((entry entry))
|
|
915
|
+
(eliscript-transient--enqueue
|
|
916
|
+
(lambda ()
|
|
917
|
+
(pcase-let* ((`(,target ,initializer)
|
|
918
|
+
(eliscript-transient--binding-pair entry))
|
|
919
|
+
(declared (eliscript-transient--declare-pattern child target)))
|
|
920
|
+
(eliscript-transient--enqueue-initializer initializer scope declared))))))
|
|
921
|
+
(eliscript-transient--enqueue
|
|
922
|
+
(lambda ()
|
|
923
|
+
(let ((body-context (copy-sequence eliscript-transient--task-context)))
|
|
924
|
+
(aset body-context 0 eliscript-transient--state)
|
|
925
|
+
(aset body-context 3 (append (eliscript-transient--visible-active-resources)
|
|
926
|
+
eliscript-transient--loop-protected))
|
|
927
|
+
(eliscript-transient--enqueue-sequence
|
|
928
|
+
(cdr arguments) child value-context body-context)
|
|
929
|
+
(eliscript-transient--enqueue
|
|
930
|
+
(lambda ()
|
|
931
|
+
(setq eliscript-transient--state (aref body-context 0))
|
|
932
|
+
(eliscript-transient--retain-state-keys baseline))))))))
|
|
933
|
+
|
|
934
|
+
(defun eliscript-transient--enqueue-while (arguments scope)
|
|
935
|
+
"Schedule WHILE condition and conservatively merge repeated-body effects."
|
|
936
|
+
(eliscript-transient--enqueue-expression (car arguments) scope t)
|
|
937
|
+
(eliscript-transient--enqueue
|
|
938
|
+
(lambda ()
|
|
939
|
+
(let* ((baseline (eliscript-transient--copy-state))
|
|
940
|
+
(body-context (eliscript-transient--branch-context baseline)))
|
|
941
|
+
(aset body-context 3 (append (eliscript-transient--visible-active-resources)
|
|
942
|
+
eliscript-transient--loop-protected))
|
|
943
|
+
(eliscript-transient--enqueue-sequence (cdr arguments) scope nil body-context)
|
|
944
|
+
(eliscript-transient--enqueue
|
|
945
|
+
(lambda ()
|
|
946
|
+
(setq eliscript-transient--state
|
|
947
|
+
(eliscript-transient--merge-state
|
|
948
|
+
baseline (list baseline (aref body-context 0))))))))))
|
|
949
|
+
|
|
950
|
+
(defun eliscript-transient--enqueue-assignment (arguments scope)
|
|
951
|
+
"Schedule each reassignment check before its corresponding value."
|
|
952
|
+
(while arguments
|
|
953
|
+
(let ((name (pop arguments)) (value (pop arguments)))
|
|
954
|
+
(eliscript-transient--enqueue
|
|
955
|
+
(lambda ()
|
|
956
|
+
(let ((binding (eliscript-transient--lookup scope (eliscript-form-value name))))
|
|
957
|
+
(when (and binding (eliscript-transient--binding-resource binding))
|
|
958
|
+
(let ((eliscript-transient--current-span
|
|
959
|
+
(or (eliscript-form-span name) eliscript-transient--current-span)))
|
|
960
|
+
(eliscript-transient--fail "transient binding %s cannot be reassigned"
|
|
961
|
+
(eliscript-form-value name))))
|
|
962
|
+
(eliscript-transient--enqueue-expression value scope t)))))))
|
|
963
|
+
|
|
964
|
+
(defun eliscript-transient--analyze-call-tasks (form scope value-context)
|
|
965
|
+
"Analyze one call FORM and schedule descendants in SCOPE."
|
|
966
|
+
(let* ((items (eliscript-form-value form)) (operator-form (car items))
|
|
967
|
+
(operator (eliscript-form-value operator-form)) (arguments (cdr items))
|
|
968
|
+
(operation-binding (eliscript-transient--operator-binding operator-form scope)))
|
|
969
|
+
(if operation-binding
|
|
970
|
+
(eliscript-transient--analyze-operation
|
|
971
|
+
(eliscript-transient--binding-operation operation-binding)
|
|
972
|
+
form arguments scope value-context)
|
|
973
|
+
(pcase operator
|
|
974
|
+
((or 'lambda 'fn 'async)
|
|
975
|
+
(eliscript-transient--enqueue-function (car arguments) (cdr arguments) scope))
|
|
976
|
+
('await
|
|
977
|
+
(eliscript-transient--enqueue-expression (car arguments) scope t)
|
|
978
|
+
(eliscript-transient--enqueue
|
|
979
|
+
(lambda ()
|
|
980
|
+
(let ((active (eliscript-transient--visible-active-resources)))
|
|
981
|
+
(when active
|
|
982
|
+
(eliscript-transient--fail
|
|
983
|
+
"transient binding %s cannot remain active across await"
|
|
984
|
+
(eliscript-transient--resource-name (car active))))))))
|
|
985
|
+
((or 'quote 'js*) nil)
|
|
986
|
+
('let (eliscript-transient--enqueue-let arguments scope nil value-context))
|
|
987
|
+
('let* (eliscript-transient--enqueue-let arguments scope t value-context))
|
|
988
|
+
('loop (eliscript-transient--enqueue-loop arguments scope value-context))
|
|
989
|
+
('while (eliscript-transient--enqueue-while arguments scope))
|
|
990
|
+
((or 'setq 'set!) (eliscript-transient--enqueue-assignment arguments scope))
|
|
991
|
+
('if (eliscript-transient--enqueue-if arguments scope value-context))
|
|
992
|
+
((or 'when 'unless)
|
|
993
|
+
(eliscript-transient--enqueue-when arguments scope value-context))
|
|
994
|
+
((or 'and 'or)
|
|
995
|
+
(eliscript-transient--enqueue-short-circuit arguments scope value-context))
|
|
996
|
+
('cond
|
|
997
|
+
(eliscript-transient--enqueue-cond-step
|
|
998
|
+
arguments scope value-context (eliscript-transient--copy-state) (list nil)))
|
|
999
|
+
('try (eliscript-transient--enqueue-try arguments scope value-context))
|
|
1000
|
+
((or 'progn 'do)
|
|
1001
|
+
(eliscript-transient--enqueue-sequence arguments scope value-context))
|
|
1002
|
+
(_
|
|
1003
|
+
(let ((binding (and (symbolp operator)
|
|
1004
|
+
(eliscript-transient--lookup scope operator))))
|
|
1005
|
+
(when (and binding
|
|
1006
|
+
(or (eliscript-transient--binding-operation binding)
|
|
1007
|
+
(eliscript-transient--binding-resource binding)))
|
|
1008
|
+
(eliscript-transient--analyze-reference operator-form scope)))
|
|
1009
|
+
;; Ordinary call arguments are all value positions, not a body sequence.
|
|
1010
|
+
(dolist (argument arguments)
|
|
1011
|
+
(eliscript-transient--enqueue-expression argument scope t)))))))
|
|
1012
|
+
|
|
1013
|
+
(defun eliscript-transient--analyze-expression (form scope value-context)
|
|
1014
|
+
"Analyze FORM in SCOPE using explicit control and ownership state frames."
|
|
1015
|
+
(if eliscript-transient--task-active
|
|
1016
|
+
(eliscript-transient--enqueue-expression form scope value-context)
|
|
1017
|
+
(let* ((eliscript-transient--task-active t)
|
|
1018
|
+
(eliscript-transient--pending-tasks nil)
|
|
1019
|
+
(root (vector eliscript-transient--state eliscript-transient--function-id
|
|
1020
|
+
eliscript-transient--next-function-id
|
|
1021
|
+
eliscript-transient--loop-protected
|
|
1022
|
+
(and eliscript-transient--try-prefix-states
|
|
1023
|
+
(list eliscript-transient--try-prefix-states))))
|
|
1024
|
+
(eliscript-transient--task-context root)
|
|
1025
|
+
tasks)
|
|
1026
|
+
(eliscript-transient--enqueue-expression form scope value-context)
|
|
1027
|
+
(setq tasks (nreverse eliscript-transient--pending-tasks))
|
|
1028
|
+
(while tasks
|
|
1029
|
+
(let* ((task (pop tasks)) (context (aref task 1))
|
|
1030
|
+
(eliscript-transient--task-context context)
|
|
1031
|
+
(eliscript-transient--pending-tasks nil)
|
|
1032
|
+
(eliscript-transient--current-span (aref task 2))
|
|
1033
|
+
(eliscript-transient--state (aref context 0))
|
|
1034
|
+
(eliscript-transient--function-id (aref context 1))
|
|
1035
|
+
(eliscript-transient--next-function-id (aref context 2))
|
|
1036
|
+
(eliscript-transient--loop-protected (aref context 3))
|
|
1037
|
+
(prefixes (aref context 4))
|
|
1038
|
+
(eliscript-transient--try-prefix-states (and prefixes (car prefixes))))
|
|
1039
|
+
(funcall (aref task 0))
|
|
1040
|
+
(aset context 0 eliscript-transient--state)
|
|
1041
|
+
(when prefixes (setcar prefixes eliscript-transient--try-prefix-states))
|
|
1042
|
+
(setq tasks (nconc (nreverse eliscript-transient--pending-tasks) tasks))))
|
|
1043
|
+
(setq eliscript-transient--state (aref root 0))
|
|
1044
|
+
(when (aref root 4)
|
|
1045
|
+
(setq eliscript-transient--try-prefix-states (car (aref root 4)))))))
|
|
698
1046
|
|
|
699
1047
|
(defun eliscript-transient--import-declarations (arguments scope)
|
|
700
1048
|
"Declare import ARGUMENTS in SCOPE with canonical transient provenance."
|
|
@@ -794,6 +1142,20 @@ When PREDECLARED is non-nil, reuse an already attached top-level resource."
|
|
|
794
1142
|
(eliscript-transient--analyze-expression argument scope t)))
|
|
795
1143
|
(_ (eliscript-transient--analyze-expression form scope nil)))))
|
|
796
1144
|
|
|
1145
|
+
(defun eliscript-transient--scope-has-provenance-p (scope)
|
|
1146
|
+
"Return non-nil when SCOPE exposes any canonical transient operation.
|
|
1147
|
+
|
|
1148
|
+
Only imported operation bindings and namespace families create provenance.
|
|
1149
|
+
Without either, no resource can be created and no ownership rule can fire.
|
|
1150
|
+
The ordinary analyzer still validates every expression and binding."
|
|
1151
|
+
(let (found)
|
|
1152
|
+
(maphash (lambda (_name binding)
|
|
1153
|
+
(when (or (eliscript-transient--binding-operation binding)
|
|
1154
|
+
(eliscript-transient--binding-namespace binding))
|
|
1155
|
+
(setq found t)))
|
|
1156
|
+
(eliscript-transient--scope-names scope))
|
|
1157
|
+
found))
|
|
1158
|
+
|
|
797
1159
|
(defun eliscript-transient--analyze-module (forms &optional filename)
|
|
798
1160
|
"Validate transient ownership and escape rules in expanded FORMS."
|
|
799
1161
|
(if (eliscript-transient--trusted-core-source-p filename)
|
|
@@ -808,8 +1170,9 @@ When PREDECLARED is non-nil, reuse an already attached top-level resource."
|
|
|
808
1170
|
(flattened (eliscript-transient--flatten-modules forms))
|
|
809
1171
|
(scope (eliscript-transient--make-scope)))
|
|
810
1172
|
(eliscript-transient--predeclare-top-level flattened scope)
|
|
811
|
-
(
|
|
812
|
-
(
|
|
1173
|
+
(when (eliscript-transient--scope-has-provenance-p scope)
|
|
1174
|
+
(dolist (form flattened)
|
|
1175
|
+
(eliscript-transient--analyze-top-level form scope)))
|
|
813
1176
|
forms)))
|
|
814
1177
|
|
|
815
1178
|
(provide 'eliscript-transient-analysis)
|