eliscript 0.1.3 → 0.1.4
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/COPYING.RUNTIME +93 -0
- package/README.md +15 -3
- package/bin/eliscript-test +29 -0
- package/bootstrap/backends/README.md +5 -4
- package/bootstrap/backends/binary.eli +89 -22
- package/bootstrap/backends/capabilities.eli +9 -4
- package/bootstrap/backends/managed-layout.eli +93 -81
- package/bootstrap/backends/managed.eli +651 -125
- package/bootstrap/backends/native.eli +1791 -324
- package/bootstrap/backends/numeric.eli +71 -7
- package/bootstrap/backends/sha256.eli +165 -68
- package/bootstrap/backends/wasm.eli +461 -52
- package/bootstrap/compiler/analyzer.eli +692 -2
- package/bootstrap/compiler/compiler.eli +16 -3
- package/bootstrap/compiler/emitter.eli +80 -35
- package/bootstrap/compiler/project.eli +175 -1
- package/bootstrap/compiler/transient-analysis.eli +2 -2
- package/bootstrap/host/build.eli +1 -0
- package/bootstrap/host/build.mjs +1 -1
- package/bootstrap/host/build.mjs.map +1 -1
- package/bootstrap/host/bun.mjs +7 -9
- package/bootstrap/host/bun.mjs.map +1 -1
- package/bootstrap/host/check-cli-ground.eli +47 -5
- package/bootstrap/host/check-cli-ground.mjs +60 -19
- package/bootstrap/host/check-cli-ground.mjs.map +1 -1
- package/bootstrap/host/check-cli.mjs +41 -1
- package/bootstrap/host/check-cli.mjs.map +1 -1
- package/bootstrap/host/compiler-session.eli +136 -22
- package/bootstrap/host/eliscript-cli.mjs +1 -1
- package/bootstrap/host/eliscript-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation-cli.eli +33 -1
- package/bootstrap/host/evaluation-cli.mjs +65 -28
- package/bootstrap/host/evaluation-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation.eli +651 -42
- package/bootstrap/host/evaluation.mjs +884 -72
- package/bootstrap/host/evaluation.mjs.map +1 -1
- package/bootstrap/host/project-cli-ground.eli +6 -1
- package/bootstrap/host/project-cli-ground.mjs +33 -32
- package/bootstrap/host/project-cli-ground.mjs.map +1 -1
- package/bootstrap/host/project-cli.mjs +1 -1
- package/bootstrap/host/project-cli.mjs.map +1 -1
- package/bootstrap/host/project-ground.eli +266 -45
- package/bootstrap/host/project-ground.mjs +429 -159
- package/bootstrap/host/project-ground.mjs.map +1 -1
- package/bootstrap/host/project.mjs +30 -40
- package/bootstrap/host/project.mjs.map +1 -1
- package/bootstrap/host/test-cli.eli +379 -0
- package/bootstrap/host/test-cli.mjs +494 -0
- package/bootstrap/host/test-cli.mjs.map +1 -0
- package/browser/README.md +7 -0
- package/browser/host.mjs +21 -29
- package/browser/host.mjs.map +1 -1
- package/browser/worker.mjs +7 -9
- package/browser/worker.mjs.map +1 -1
- package/compiler/eliscript-analyzer.el +694 -0
- package/compiler/eliscript-cli.el +66 -22
- package/compiler/eliscript-emitter.el +67 -43
- package/compiler/eliscript-ir-emitter.el +71 -36
- package/compiler/eliscript-project.el +360 -80
- package/compiler/eliscript-transient-analysis.el +5 -5
- package/compiler/eliscript.el +6 -0
- package/dist/backends/binary.mjs +148 -26
- package/dist/backends/binary.mjs.map +1 -1
- package/dist/backends/capabilities.mjs +11 -4
- package/dist/backends/capabilities.mjs.map +1 -1
- package/dist/backends/elf.mjs +4 -4
- package/dist/backends/elf.mjs.map +1 -1
- package/dist/backends/managed-layout.mjs +53 -56
- package/dist/backends/managed-layout.mjs.map +1 -1
- package/dist/backends/managed.mjs +1116 -375
- package/dist/backends/managed.mjs.map +1 -1
- package/dist/backends/memory.mjs +24 -26
- package/dist/backends/memory.mjs.map +1 -1
- package/dist/backends/native.mjs +2529 -434
- package/dist/backends/native.mjs.map +1 -1
- package/dist/backends/numeric.mjs +140 -33
- package/dist/backends/numeric.mjs.map +1 -1
- package/dist/backends/optimize.mjs +2 -2
- package/dist/backends/optimize.mjs.map +1 -1
- package/dist/backends/regexp.mjs +33 -35
- package/dist/backends/regexp.mjs.map +1 -1
- package/dist/backends/sha256.mjs +159 -59
- package/dist/backends/sha256.mjs.map +1 -1
- package/dist/backends/wasm.mjs +609 -73
- package/dist/backends/wasm.mjs.map +1 -1
- package/dist/bootstrap/analyzer.mjs +1018 -2
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +30 -23
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +206 -161
- package/dist/bootstrap/emitter.mjs.macro-origins.json +16 -16
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +27 -31
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +22 -24
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/project.mjs +246 -1
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +2 -2
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/source-map.mjs +34 -48
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +2 -2
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +106 -106
- package/dist/browser/host.mjs +21 -29
- package/dist/browser/loader.js +1 -1
- package/dist/browser/worker.mjs +95 -95
- package/dist/compiler-artifact.json +1 -1
- package/dist/host/compiler-session.mjs +405 -228
- package/dist/host/compiler-session.mjs.map +1 -1
- package/dist/host/compiler-tools.mjs +44 -46
- package/dist/host/compiler-tools.mjs.map +1 -1
- package/dist/literal-sources/runtime/core/array-map.eli +45 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +22 -2
- package/dist/literal-sources/runtime/core/collection.eli +282 -23
- package/dist/literal-sources/runtime/core/data-text.eli +196 -13
- package/dist/literal-sources/runtime/core/data.eli +1 -1
- package/dist/literal-sources/runtime/core/identifier.eli +1 -1
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +822 -44
- package/dist/literal-sources/runtime/core/list.eli +1 -1
- package/dist/literal-sources/runtime/core/map.eli +1 -1
- package/dist/literal-sources/runtime/core/metadata-internals.eli +2 -2
- package/dist/literal-sources/runtime/core/metadata.eli +2 -2
- package/dist/literal-sources/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/dist/literal-sources/runtime/core/object.eli +1 -1
- package/dist/literal-sources/runtime/core/order.eli +3 -3
- package/dist/literal-sources/runtime/core/persistent-kind.eli +1 -1
- package/dist/literal-sources/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/protocol.eli +5 -3
- package/dist/literal-sources/runtime/core/queue.eli +1 -1
- package/dist/literal-sources/runtime/core/record.eli +3 -3
- package/dist/literal-sources/runtime/core/regex.eli +2 -2
- package/dist/literal-sources/runtime/core/sequence.eli +1 -1
- package/dist/literal-sources/runtime/core/set-algebra.eli +1 -1
- package/dist/literal-sources/runtime/core/set.eli +1 -1
- package/dist/literal-sources/runtime/core/sorted.eli +4 -4
- package/dist/literal-sources/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/text.eli +1 -1
- package/dist/literal-sources/runtime/core/transducer.eli +24 -2
- package/dist/literal-sources/runtime/core/transient.eli +7 -5
- package/dist/literal-sources/runtime/core/type.eli +1 -1
- package/dist/literal-sources/runtime/core/value-internals.eli +3 -3
- package/dist/literal-sources/runtime/core/value.eli +2 -2
- package/dist/literal-sources/runtime/core/vector.eli +5 -2
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-queue-state.eli +1 -1
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-sorted-state.eli +1 -1
- package/dist/literal-sources/runtime/managed/managed-transient-state.eli +1206 -0
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-value-state.eli +30 -6
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/dist/literal-sources/runtime/wire/http-rpc.eli +1 -1
- package/dist/literal-sources/runtime/wire/markdown.eli +1 -1
- package/dist/literal-sources/runtime/wire/schema.eli +1 -1
- package/dist/literal-sources/stdlib/bit.eli +89 -1
- package/dist/literal-sources/stdlib/data.eli +522 -0
- package/dist/literal-sources/stdlib/interop/object.eli +39 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +60 -21
- package/dist/literal-sources/stdlib/persistent-map.eli +335 -324
- package/dist/literal-sources/stdlib/persistent-set.eli +8 -6
- package/dist/literal-sources/stdlib/persistent-vector.eli +18 -18
- package/dist/literal-sources/stdlib/protocol.eli +63 -0
- package/{stdlib/core → dist/literal-sources/stdlib}/set.eli +8 -8
- package/dist/literal-sources/stdlib/string.eli +362 -0
- package/dist/runtime/lisp/async-runtime.mjs +55 -59
- package/dist/runtime/lisp/async-runtime.mjs.map +1 -1
- package/dist/runtime/lisp/builtins.mjs +232 -280
- package/dist/runtime/lisp/builtins.mjs.map +1 -1
- package/dist/runtime/lisp/cli.mjs +159 -167
- package/dist/runtime/lisp/cli.mjs.map +1 -1
- package/dist/runtime/lisp/compiler.mjs +359 -419
- package/dist/runtime/lisp/compiler.mjs.map +1 -1
- package/dist/runtime/lisp/core.mjs +24 -24
- package/dist/runtime/lisp/core.mjs.map +1 -1
- package/dist/runtime/lisp/evaluator.mjs +315 -385
- package/dist/runtime/lisp/evaluator.mjs.map +1 -1
- package/dist/runtime/lisp/extensions.mjs +85 -103
- package/dist/runtime/lisp/extensions.mjs.map +1 -1
- package/dist/runtime/lisp/host-io.mjs +106 -122
- package/dist/runtime/lisp/host-io.mjs.map +1 -1
- package/dist/runtime/lisp/io-worker.mjs +117 -135
- package/dist/runtime/lisp/io-worker.mjs.map +1 -1
- package/dist/runtime/lisp/keymap.mjs +5 -5
- package/dist/runtime/lisp/keymap.mjs.map +1 -1
- package/dist/runtime/lisp/macros-forms.mjs +49 -51
- package/dist/runtime/lisp/macros-forms.mjs.map +1 -1
- package/dist/runtime/lisp/reader-format.mjs +31 -31
- package/dist/runtime/lisp/reader-format.mjs.map +1 -1
- package/dist/runtime/lisp/regexp-buffer.mjs +9 -9
- package/dist/runtime/lisp/regexp-buffer.mjs.map +1 -1
- package/dist/runtime/math.mjs +32 -38
- package/dist/runtime/math.mjs.map +1 -1
- package/dist/runtime/number-radix.mjs +5 -7
- package/dist/runtime/number-radix.mjs.map +1 -1
- package/dist/runtime/primitives.mjs +81 -46
- package/dist/runtime/primitives.mjs.macro-origins.json +294 -44
- package/dist/runtime/primitives.mjs.map +1 -1
- package/dist/runtime/unicode-case.mjs +6 -6
- package/dist/runtime/unicode-case.mjs.map +1 -1
- package/dist/runtime.eli +3068 -1882
- package/dist/stage3-release.json +1 -1
- package/dist/stdlib/async.mjs +1838 -0
- package/dist/stdlib/bit.mjs +116 -0
- package/dist/stdlib/collection.mjs +193 -0
- package/dist/stdlib/core.mjs +28 -0
- package/dist/stdlib/data-text.mjs +54 -0
- package/dist/stdlib/data.mjs +601 -0
- package/dist/stdlib/devtools.mjs +565 -0
- package/dist/stdlib/diff.mjs +180 -0
- package/dist/stdlib/fn.mjs +164 -0
- package/dist/stdlib/hierarchy.mjs +189 -0
- package/dist/stdlib/identifier.mjs +33 -0
- package/dist/stdlib/interop/js.mjs +706 -0
- package/dist/stdlib/interop/object.mjs +40 -0
- package/dist/stdlib/json.mjs +843 -0
- package/dist/stdlib/lazy-sequence.mjs +117 -0
- package/dist/stdlib/math.mjs +386 -0
- package/dist/stdlib/meta.mjs +21 -0
- package/dist/stdlib/multimethod.mjs +345 -0
- package/dist/stdlib/numeric.mjs +327 -0
- package/dist/stdlib/order.mjs +194 -0
- package/dist/stdlib/persistent-list.mjs +171 -0
- package/dist/stdlib/persistent-map.mjs +781 -0
- package/dist/stdlib/persistent-queue.mjs +44 -0
- package/dist/stdlib/persistent-set.mjs +225 -0
- package/dist/stdlib/persistent-vector.mjs +316 -0
- package/dist/stdlib/portable/data-text.mjs +1094 -0
- package/dist/stdlib/portable/data.mjs +62 -0
- package/dist/stdlib/portable/identifier.mjs +179 -0
- package/dist/stdlib/portable/metadata.mjs +63 -0
- package/dist/stdlib/portable/object.mjs +140 -0
- package/dist/stdlib/portable/sequence.mjs +142 -0
- package/dist/stdlib/portable/text.mjs +111 -0
- package/dist/stdlib/pprint.mjs +807 -0
- package/dist/stdlib/protocol.mjs +61 -0
- package/dist/stdlib/record.mjs +25 -0
- package/dist/stdlib/regex.mjs +115 -0
- package/dist/stdlib/result.mjs +198 -0
- package/dist/stdlib/schema.mjs +2828 -0
- package/dist/stdlib/seq.mjs +913 -0
- package/dist/stdlib/set.mjs +317 -0
- package/dist/stdlib/sorted.mjs +56 -0
- package/dist/stdlib/state.mjs +451 -0
- package/dist/stdlib/string.mjs +494 -0
- package/dist/stdlib/tap.mjs +187 -0
- package/dist/stdlib/test.mjs +669 -0
- package/dist/stdlib/time.mjs +522 -0
- package/dist/stdlib/transducer.mjs +85 -0
- package/dist/stdlib/transient.mjs +32 -0
- package/dist/stdlib/type.mjs +28 -0
- package/dist/stdlib/uuid.mjs +377 -0
- package/dist/stdlib/value.mjs +334 -0
- package/dist/stdlib/walk.mjs +243 -0
- package/dist/stdlib/wire/gepo.mjs +28 -0
- package/dist/stdlib/wire/mdp.mjs +13 -0
- package/dist/stdlib/wire/mds.mjs +10 -0
- package/dist/stdlib/zipper.mjs +1025 -0
- package/editor/README.md +15 -0
- package/editor/eliscript-data.el +221 -8
- package/editor/eliscript-mode.el +207 -48
- package/editor/eliscript-runtime.el +6 -3
- package/package.json +49 -15
- package/platform/README.md +6 -0
- package/platform/browser.mjs +10 -12
- package/platform/browser.mjs.map +1 -1
- package/runtime/README.md +12 -5
- package/runtime/core/array-map.eli +538 -0
- package/runtime/core/array-map.mjs +651 -0
- package/runtime/core/array-map.mjs.map +1 -0
- package/runtime/core/collection-internals.eli +85 -33
- package/runtime/core/collection-internals.mjs +245 -193
- package/runtime/core/collection-internals.mjs.map +1 -1
- package/runtime/core/collection.eli +105 -3
- package/runtime/core/collection.mjs +190 -53
- package/runtime/core/collection.mjs.map +1 -1
- package/runtime/core/data-text.eli +224 -16
- package/runtime/core/data-text.mjs +345 -83
- package/runtime/core/data-text.mjs.map +1 -1
- package/runtime/core/data.eli +50 -33
- package/runtime/core/data.mjs +72 -36
- package/runtime/core/data.mjs.map +1 -1
- package/runtime/core/identifier.mjs +15 -19
- package/runtime/core/identifier.mjs.map +1 -1
- package/runtime/core/lazy-sequence.eli +885 -15
- package/runtime/core/lazy-sequence.mjs +1265 -38
- package/runtime/core/lazy-sequence.mjs.map +1 -1
- package/runtime/core/map-internals.eli +209 -1
- package/runtime/core/map-internals.mjs +359 -71
- package/runtime/core/map-internals.mjs.map +1 -1
- package/runtime/core/map.eli +75 -7
- package/runtime/core/map.mjs +122 -47
- package/runtime/core/map.mjs.map +1 -1
- package/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/runtime/core/object-impl.mjs +5 -5
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/order.eli +15 -3
- package/runtime/core/order.mjs +23 -8
- package/runtime/core/order.mjs.map +1 -1
- package/runtime/core/persistent-kind.mjs +9 -13
- package/runtime/core/persistent-kind.mjs.map +1 -1
- package/runtime/core/protocol-error.mjs +9 -11
- package/runtime/core/protocol-error.mjs.map +1 -1
- package/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/runtime/core/protocol-impl.mjs +10 -10
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/queue.mjs +14 -16
- package/runtime/core/queue.mjs.map +1 -1
- package/runtime/core/record.eli +2 -2
- package/runtime/core/record.mjs +13 -17
- package/runtime/core/record.mjs.map +1 -1
- package/runtime/core/regex.mjs +18 -22
- package/runtime/core/regex.mjs.map +1 -1
- package/runtime/core/sequence.eli +33 -31
- package/runtime/core/sequence.mjs +60 -93
- package/runtime/core/sequence.mjs.map +1 -1
- package/runtime/core/set.eli +53 -27
- package/runtime/core/set.mjs +113 -82
- package/runtime/core/set.mjs.map +1 -1
- package/runtime/core/sorted.mjs +91 -108
- package/runtime/core/sorted.mjs.map +1 -1
- package/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/runtime/core/text-impl.mjs +1 -1
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/transducer.eli +24 -0
- package/runtime/core/transducer.mjs +27 -1
- package/runtime/core/transducer.mjs.map +1 -1
- package/runtime/core/transient-internals.eli +12 -4
- package/runtime/core/transient-internals.mjs +19 -6
- package/runtime/core/transient-internals.mjs.map +1 -1
- package/runtime/core/transient.eli +31 -0
- package/runtime/core/transient.mjs +33 -2
- package/runtime/core/transient.mjs.map +1 -1
- package/runtime/core/value-internals.mjs +29 -35
- package/runtime/core/value-internals.mjs.map +1 -1
- package/runtime/core/vector.eli +73 -20
- package/runtime/core/vector.mjs +159 -156
- package/runtime/core/vector.mjs.map +1 -1
- package/runtime/literals.eli +16 -9
- package/runtime/literals.mjs +25 -9
- package/runtime/literals.mjs.map +1 -1
- package/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-queue-state.eli +1 -1
- package/runtime/managed/managed-runtime-array-map.eli +45 -0
- package/{stdlib → runtime/managed}/managed-runtime-collection-internals.eli +22 -2
- package/{stdlib → runtime/managed}/managed-runtime-collection.eli +282 -23
- package/{stdlib → runtime/managed}/managed-runtime-data-text.eli +196 -13
- package/{stdlib → runtime/managed}/managed-runtime-data.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-identifier.eli +1 -1
- package/runtime/managed/managed-runtime-lazy-sequence.eli +935 -0
- package/{stdlib → runtime/managed}/managed-runtime-list.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-map.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-metadata-internals.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-metadata.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-object.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-order.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-persistent-kind.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-protocol.eli +5 -3
- package/{stdlib → runtime/managed}/managed-runtime-queue.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-record.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-regex.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-sequence.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set-algebra.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-sorted.eli +4 -4
- package/{stdlib → runtime/managed}/managed-runtime-text.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-transducer.eli +24 -2
- package/{stdlib → runtime/managed}/managed-runtime-transient.eli +7 -5
- package/{stdlib → runtime/managed}/managed-runtime-type.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-value-internals.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-value.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-vector.eli +5 -2
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-sorted-state.eli +1 -1
- package/runtime/managed/managed-transient-state.eli +1206 -0
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-value-state.eli +30 -6
- package/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-http-rpc.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-markdown.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-schema.eli +1 -1
- package/runtime/math.mjs +32 -38
- package/runtime/math.mjs.map +1 -1
- package/runtime/number-radix.mjs +5 -7
- package/runtime/number-radix.mjs.map +1 -1
- package/runtime/primitives.eli +19 -6
- package/runtime/primitives.mjs +81 -46
- package/runtime/primitives.mjs.map +1 -1
- package/runtime/source-mapping.mjs +17 -23
- package/runtime/source-mapping.mjs.map +1 -1
- package/runtime/testing/map.eli +70 -41
- package/runtime/testing/map.mjs +57 -34
- package/runtime/testing/map.mjs.map +1 -1
- package/runtime/unicode-case.mjs +6 -6
- package/runtime/unicode-case.mjs.map +1 -1
- package/runtime/wire/http-rpc.mjs +12 -18
- package/runtime/wire/http-rpc.mjs.map +1 -1
- package/runtime/wire/markdown.mjs +42 -42
- package/runtime/wire/markdown.mjs.map +1 -1
- package/runtime/wire/schema.mjs +13 -13
- package/runtime/wire/schema.mjs.map +1 -1
- package/runtime/worker-value-codec.mjs +5 -7
- package/runtime/worker-value-codec.mjs.map +1 -1
- package/runtime/worker-value-stream.mjs +128 -135
- package/runtime/worker-value-stream.mjs.map +1 -1
- package/runtime/worker.mjs +75 -89
- package/runtime/worker.mjs.map +1 -1
- package/stdlib/README.md +25 -18
- package/stdlib/async.eli +1245 -0
- package/stdlib/bit.eli +89 -1
- package/stdlib/bit.mjs +89 -2
- package/stdlib/bit.mjs.map +1 -1
- package/stdlib/{core/collection.eli → collection.eli} +39 -4
- package/stdlib/core.eli +956 -0
- package/stdlib/data-text.eli +62 -1091
- package/stdlib/data.eli +517 -37
- package/stdlib/devtools.eli +399 -0
- package/stdlib/diff.eli +134 -0
- package/stdlib/{function.eli → fn.eli} +1 -1
- package/stdlib/identifier.eli +21 -136
- package/stdlib/interop/object.eli +39 -0
- package/stdlib/{core/lazy-sequence.eli → lazy-sequence.eli} +28 -2
- package/stdlib/math.eli +267 -0
- package/stdlib/{core/metadata.eli → meta.eli} +2 -2
- package/stdlib/{core/order.eli → order.eli} +6 -6
- package/stdlib/persistent-list.eli +60 -21
- package/stdlib/persistent-map.eli +335 -324
- package/stdlib/persistent-set.eli +8 -6
- package/stdlib/persistent-vector.eli +18 -18
- package/stdlib/portable/data-text.eli +1092 -0
- package/stdlib/portable/data.eli +42 -0
- package/stdlib/portable/identifier.eli +147 -0
- package/stdlib/{metadata.eli → portable/metadata.eli} +5 -5
- package/stdlib/{object.eli → portable/object.eli} +1 -1
- package/stdlib/{sequence.eli → portable/sequence.eli} +1 -1
- package/stdlib/{text.eli → portable/text.eli} +1 -1
- package/stdlib/pprint.eli +588 -0
- package/stdlib/protocol.eli +63 -0
- package/stdlib/{core/record.eli → record.eli} +2 -2
- package/stdlib/regex.eli +70 -0
- package/stdlib/result.eli +53 -44
- package/stdlib/schema.eli +1886 -0
- package/stdlib/{core/seq.eli → seq.eli} +97 -90
- package/{dist/literal-sources/stdlib/core → stdlib}/set.eli +8 -8
- package/stdlib/{core/sorted.eli → sorted.eli} +2 -2
- package/stdlib/{state/atom.eli → state.eli} +137 -7
- package/stdlib/string.eli +362 -0
- package/stdlib/tap.eli +135 -0
- package/stdlib/test.eli +566 -0
- package/stdlib/time.eli +419 -0
- package/stdlib/{core/transducer.eli → transducer.eli} +4 -2
- package/stdlib/{core/transient.eli → transient.eli} +11 -5
- package/stdlib/{core/type.eli → type.eli} +2 -2
- package/stdlib/uuid.eli +288 -0
- package/stdlib/{core/walk.eli → walk.eli} +6 -6
- package/stdlib/{gepo.eli → wire/gepo.eli} +2 -2
- package/stdlib/{mdp.eli → wire/mdp.eli} +2 -2
- package/stdlib/{mds.eli → wire/mds.eli} +2 -2
- package/stdlib/{core/zipper.eli → zipper.eli} +179 -138
- package/tests/helpers/wasm-managed-math-node.mjs +495 -582
- package/tools/acceptance/check-ground.mjs +106 -132
- package/tools/acceptance/check.mjs +16 -16
- package/tools/acceptance/retained-performance-snapshot.mjs +265 -149
- package/tools/acceptance/retained-soak.mjs +5 -7
- package/tools/acceptance/retained-transient.mjs +5 -7
- package/tools/backends/build.mjs +373 -95
- package/tools/backends/compiler-bootstrap.mjs +271 -317
- package/tools/backends/compiler-browser.mjs +7 -9
- package/tools/backends/compiler-build.mjs +77 -97
- package/tools/backends/compiler-cli-ground.mjs +47 -47
- package/tools/backends/compiler-data-transport.mjs +27 -31
- package/tools/backends/compiler-host-iteration.mjs +13 -21
- package/tools/backends/compiler-host-record.mjs +28 -34
- package/tools/backends/compiler-metadata.mjs +145 -53
- package/tools/backends/compiler-package-ground.mjs +39 -47
- package/tools/backends/compiler-package-loader.mjs +164 -206
- package/tools/backends/compiler-session.mjs +432 -324
- package/tools/backends/compiler-worker.mjs +79 -89
- package/tools/backends/dist/bootstrap-js-stages.mjs +17 -19
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
- package/tools/backends/dist/release-cli.mjs +151 -22
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/dist/run-artifact.mjs +54 -76
- package/tools/backends/dist/run-artifact.mjs.map +1 -1
- package/tools/backends/managed-foreign-binding.mjs +370 -114
- package/tools/backends/managed-host-ground.mjs +14 -17
- package/tools/backends/managed-host-lifecycle.mjs +42 -53
- package/tools/backends/managed-host-object-realm.mjs +121 -111
- package/tools/backends/managed-host-proxy.mjs +5 -7
- package/tools/backends/managed-host-runtime.mjs +6295 -4350
- package/tools/backends/managed-host.mjs +234 -188
- package/tools/backends/managed-layout.mjs +53 -56
- package/tools/backends/managed-module-graph-ground.mjs +488 -568
- package/tools/backends/managed-module-graph.mjs +62 -76
- package/tools/backends/managed-runtime-host-ground.mjs +352 -400
- package/tools/backends/managed-runtime.mjs +227 -266
- package/tools/backends/managed-source-view-ground.mjs +165 -161
- package/tools/backends/managed-source-view.mjs +415 -154
- package/tools/backends/native-managed-runtime.mjs +96 -138
- package/tools/backends/native-memory.mjs +1122 -742
- package/tools/backends/native-node-ffi.mjs +2439 -0
- package/tools/backends/native-node-memory.mjs +793 -383
- package/tools/backends/native-node-runner.mjs +1458 -579
- package/tools/backends/native-node-watchdog.mjs +12 -14
- package/tools/backends/native-node-worker.mjs +46 -50
- package/tools/backends/stage3-targets.mjs +2 -2
- package/tools/bootstrap-runtime.el +4 -4
- package/tools/collections/transient-builder-benchmark.mjs +17 -17
- package/tools/project/check-cli.eli +27 -3
- package/tools/project/project-cli.eli +1 -1
- package/tools/testing/maintained-suite-source.mjs +5 -7
- package/tools/testing/maintained-suite-source.mjs.map +1 -1
- package/dist/literal-sources/stdlib/core/data.eli +0 -306
- package/dist/literal-sources/stdlib/managed-transient-state.eli +0 -353
- package/stdlib/core/data-text.eli +0 -16
- package/stdlib/core/data.eli +0 -306
- package/stdlib/core/identifier.eli +0 -32
- package/stdlib/core/regex.eli +0 -17
- package/stdlib/deferred.eli +0 -70
- package/stdlib/managed-runtime-lazy-sequence.eli +0 -157
- package/stdlib/managed-transient-state.eli +0 -353
- /package/{stdlib → runtime/managed}/managed-protocol-error.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-literals.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-truth.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-testing-value.eli +0 -0
package/runtime/testing/map.eli
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
(module eliscript.runtime.testing.map
|
|
2
2
|
(import "../core/map-internals.mjs" :as map-internals)
|
|
3
|
+
(import "../core/array-map.mjs"
|
|
4
|
+
isPersistentArrayMap
|
|
5
|
+
readArrayMapState
|
|
6
|
+
readTransientArrayMapState)
|
|
3
7
|
(import "../core/map-internals.mjs"
|
|
4
8
|
MAP_STATE
|
|
5
9
|
TRANSIENT_MAP_STATE
|
|
@@ -86,51 +90,76 @@
|
|
|
86
90
|
(readTransientMapMetrics))
|
|
87
91
|
|
|
88
92
|
(defun inspectTransientMap (map)
|
|
89
|
-
(let ((state (
|
|
90
|
-
|
|
91
|
-
(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
:
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
(let ((array-state (readTransientArrayMapState map)))
|
|
94
|
+
(if (not (undefined? array-state))
|
|
95
|
+
(if (not (nil? (get array-state :promoted)))
|
|
96
|
+
(inspectTransientMap (get array-state :promoted))
|
|
97
|
+
(Object/freeze
|
|
98
|
+
(js-object
|
|
99
|
+
:active (get array-state :active)
|
|
100
|
+
:count (/ (js-length (get array-state :items)) 2)
|
|
101
|
+
:nodeCount 0
|
|
102
|
+
:ownedNodeCount 0
|
|
103
|
+
:sharesSourceRoot false)))
|
|
104
|
+
(let ((state (transient-state-of map))
|
|
105
|
+
(nodes (new globalThis/Set))
|
|
106
|
+
(owned-node-count 0))
|
|
107
|
+
(collect-nodes (get state :root) nodes)
|
|
108
|
+
(js-call nodes :forEach
|
|
109
|
+
(lambda (node)
|
|
110
|
+
(when (eq (get node :owner) (get state :owner))
|
|
111
|
+
(setq owned-node-count (+ owned-node-count 1)))))
|
|
112
|
+
(let* ((source (get state :source))
|
|
113
|
+
(source-state (if (nil? source) undefined (aref source MAP_STATE))))
|
|
114
|
+
(Object/freeze
|
|
115
|
+
(js-object
|
|
116
|
+
:active (get state :active)
|
|
117
|
+
:count (get state :count)
|
|
118
|
+
:nodeCount (get nodes :size)
|
|
119
|
+
:ownedNodeCount owned-node-count
|
|
120
|
+
:sharesSourceRoot (and (not (undefined? source-state))
|
|
121
|
+
(eq (get state :root) (get source-state :root))))))))))
|
|
107
122
|
|
|
108
123
|
(defun inspectPersistentMap (map)
|
|
109
|
-
(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
(if (isPersistentArrayMap map)
|
|
125
|
+
(let ((array-state (readArrayMapState map)))
|
|
126
|
+
(Object/freeze
|
|
127
|
+
(js-object
|
|
128
|
+
:representation "array-map"
|
|
129
|
+
:count (get array-state :count)
|
|
130
|
+
:bitmapNodes 0
|
|
131
|
+
:arrayNodes 0
|
|
132
|
+
:collisionNodes 0
|
|
133
|
+
:entries (get array-state :count)
|
|
134
|
+
:nodeCount 0
|
|
135
|
+
:maxDepth 0)))
|
|
136
|
+
(let* ((state (state-of map))
|
|
137
|
+
(result (js-object
|
|
138
|
+
:count (get state :count)
|
|
139
|
+
:bitmapNodes 0
|
|
140
|
+
:arrayNodes 0
|
|
141
|
+
:collisionNodes 0
|
|
142
|
+
:entries 0
|
|
143
|
+
:nodeCount 0
|
|
144
|
+
:maxDepth 0))
|
|
145
|
+
(nodes (new globalThis/Set)))
|
|
146
|
+
(inspect-item (get state :root) 1 result nodes)
|
|
147
|
+
(put result "nodeCount" (get nodes :size))
|
|
148
|
+
(Object/freeze result))))
|
|
122
149
|
|
|
123
150
|
(defun sharedPersistentMapNodes (left right)
|
|
124
|
-
(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
(
|
|
132
|
-
(
|
|
133
|
-
|
|
151
|
+
(if (or (isPersistentArrayMap left) (isPersistentArrayMap right))
|
|
152
|
+
0
|
|
153
|
+
(let ((left-nodes (new globalThis/Set))
|
|
154
|
+
(right-nodes (new globalThis/Set))
|
|
155
|
+
(shared 0))
|
|
156
|
+
(collect-nodes (get (state-of left) :root) left-nodes)
|
|
157
|
+
(collect-nodes (get (state-of right) :root) right-nodes)
|
|
158
|
+
(js-call left-nodes :forEach
|
|
159
|
+
(lambda (node)
|
|
160
|
+
(when (js-call right-nodes :has node)
|
|
161
|
+
(setq shared (+ shared 1)))))
|
|
162
|
+
shared)))
|
|
134
163
|
|
|
135
164
|
(export
|
|
136
165
|
resetPersistentMapMetrics
|
package/runtime/testing/map.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numer
|
|
|
7
7
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
8
8
|
|
|
9
9
|
import * as map_internals from "../core/map-internals.mjs";
|
|
10
|
+
import {isPersistentArrayMap, readArrayMapState, readTransientArrayMapState} from "../core/array-map.mjs";
|
|
10
11
|
import {MAP_STATE, TRANSIENT_MAP_STATE, ArrayNode, BitmapIndexedNode, HashCollisionNode, MapEntry, readMapMetrics, readTransientMapMetrics, resetMapMetrics} from "../core/map-internals.mjs";
|
|
11
12
|
const instance_of_QMARK_ = (value, Constructor) => value instanceof Constructor;
|
|
12
13
|
__eliscript_tdz_ready_0 = true;
|
|
@@ -121,49 +122,71 @@ function transientMapMetrics() {
|
|
|
121
122
|
}
|
|
122
123
|
function inspectTransientMap(map) {
|
|
123
124
|
{
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
(nodes)["forEach"](((node) => {
|
|
129
|
-
if (((node)["owner"] === (state)["owner"])) {
|
|
130
|
-
return ((owned_node_count = (owned_node_count + 1)));
|
|
125
|
+
let array_state = readTransientArrayMapState(map);
|
|
126
|
+
if (!((array_state === undefined))) {
|
|
127
|
+
if (!(((array_state)["promoted"] === null))) {
|
|
128
|
+
return inspectTransientMap((array_state)["promoted"]);
|
|
131
129
|
} else {
|
|
132
|
-
return
|
|
130
|
+
return Object.freeze(({"active": (array_state)["active"], "count": __eliscript_numeric_div((((array_state)["items"]) ?? []).length, 2), "nodeCount": 0, "ownedNodeCount": 0, "sharesSourceRoot": false}));
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
{
|
|
134
|
+
let state = transient_state_of(map);
|
|
135
|
+
let nodes = new (globalThis.Set)();
|
|
136
|
+
let owned_node_count = 0;
|
|
137
|
+
collect_nodes((state)["root"], nodes);
|
|
138
|
+
(nodes)["forEach"](((node) => {
|
|
139
|
+
if (((node)["owner"] === (state)["owner"])) {
|
|
140
|
+
return ((owned_node_count = (owned_node_count + 1)));
|
|
141
|
+
} else {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}));
|
|
145
|
+
{
|
|
146
|
+
let source = (state)["source"];
|
|
147
|
+
let source_state = ((source === null) ? undefined : (source)[MAP_STATE]);
|
|
148
|
+
return Object.freeze(({"active": (state)["active"], "count": (state)["count"], "nodeCount": (nodes)["size"], "ownedNodeCount": owned_node_count, "sharesSourceRoot": ((!(source_state === undefined)) && ((state)["root"] === (source_state)["root"]))}));
|
|
149
|
+
}
|
|
133
150
|
}
|
|
134
|
-
}));
|
|
135
|
-
{
|
|
136
|
-
let source = (state)["source"];
|
|
137
|
-
let source_state = ((source === null) ? undefined : (source)[MAP_STATE]);
|
|
138
|
-
return Object.freeze(({"active": (state)["active"], "count": (state)["count"], "nodeCount": (nodes)["size"], "ownedNodeCount": owned_node_count, "sharesSourceRoot": ((!(source_state === undefined)) && ((state)["root"] === (source_state)["root"]))}));
|
|
139
151
|
}
|
|
140
152
|
}
|
|
141
153
|
}
|
|
142
154
|
function inspectPersistentMap(map) {
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
155
|
+
if (__eliscript_truthy(isPersistentArrayMap(map))) {
|
|
156
|
+
{
|
|
157
|
+
let array_state = readArrayMapState(map);
|
|
158
|
+
return Object.freeze(({"representation": "array-map", "count": (array_state)["count"], "bitmapNodes": 0, "arrayNodes": 0, "collisionNodes": 0, "entries": (array_state)["count"], "nodeCount": 0, "maxDepth": 0}));
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
{
|
|
162
|
+
let state = state_of(map);
|
|
163
|
+
let result = ({"count": (state)["count"], "bitmapNodes": 0, "arrayNodes": 0, "collisionNodes": 0, "entries": 0, "nodeCount": 0, "maxDepth": 0});
|
|
164
|
+
let nodes = new (globalThis.Set)();
|
|
165
|
+
inspect_item((state)["root"], 1, result, nodes);
|
|
166
|
+
((result)["nodeCount"] = (nodes)["size"]);
|
|
167
|
+
return Object.freeze(result);
|
|
168
|
+
}
|
|
150
169
|
}
|
|
151
170
|
}
|
|
152
171
|
function sharedPersistentMapNodes(left, right) {
|
|
153
|
-
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
if ((__eliscript_truthy(isPersistentArrayMap(left)) || __eliscript_truthy(isPersistentArrayMap(right)))) {
|
|
173
|
+
return 0;
|
|
174
|
+
} else {
|
|
175
|
+
{
|
|
176
|
+
let left_nodes = new (globalThis.Set)();
|
|
177
|
+
let right_nodes = new (globalThis.Set)();
|
|
178
|
+
let shared = 0;
|
|
179
|
+
collect_nodes((state_of(left))["root"], left_nodes);
|
|
180
|
+
collect_nodes((state_of(right))["root"], right_nodes);
|
|
181
|
+
(left_nodes)["forEach"](((node) => {
|
|
182
|
+
if (__eliscript_truthy((right_nodes)["has"](node))) {
|
|
183
|
+
return ((shared = (shared + 1)));
|
|
184
|
+
} else {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
}));
|
|
188
|
+
return shared;
|
|
189
|
+
}
|
|
167
190
|
}
|
|
168
191
|
}
|
|
169
192
|
export {resetPersistentMapMetrics, persistentMapMetrics, resetTransientMapMetrics, transientMapMetrics, inspectTransientMap, inspectPersistentMap, sharedPersistentMapNodes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.mjs","sources":["map.eli"],"sourcesContent":["(module eliscript.runtime.testing.map\n (import \"../core/map-internals.mjs\" :as map-internals)\n (import \"../core/map-internals.mjs\"\n MAP_STATE\n TRANSIENT_MAP_STATE\n ArrayNode\n BitmapIndexedNode\n HashCollisionNode\n MapEntry\n readMapMetrics\n readTransientMapMetrics\n resetMapMetrics)\n\n (defconst instance-of? (js* \"(value, Constructor) => value instanceof Constructor\"))\n\n (defun state-of (map)\n (let ((state (if (nil? map) undefined (aref map MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript persistent hash map\")))\n state))\n\n (defun transient-state-of (map)\n (let ((state (if (nil? map) undefined (aref map TRANSIENT_MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript transient hash map\")))\n state))\n\n (defun inspect-item (item depth result nodes)\n (cond\n ((funcall instance-of? item MapEntry)\n (put result \"entries\" (+ (get result :entries) 1))\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth)))\n ((not (js-call nodes :has item))\n (js-call nodes :add item)\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth))\n (cond\n ((funcall instance-of? item BitmapIndexedNode)\n (put result \"bitmapNodes\" (+ (get result :bitmapNodes) 1))\n (let ((items (get item :items))\n (index 0))\n (while (< index (js-length items))\n (inspect-item (get items index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))\n ((funcall instance-of? item ArrayNode)\n (put result \"arrayNodes\" (+ (get result :arrayNodes) 1))\n (let ((children (get item :children))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (inspect-item child (+ depth 1) result nodes)))\n (setq index (+ index 1)))))\n ((funcall instance-of? item HashCollisionNode)\n (put result \"collisionNodes\" (+ (get result :collisionNodes) 1))\n (let ((entries (get item :entries))\n (index 0))\n (while (< index (js-length entries))\n (inspect-item (get entries index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))))))\n\n (defun collect-nodes (item nodes)\n (unless (or (funcall instance-of? item MapEntry)\n (js-call nodes :has item))\n (js-call nodes :add item)\n (let ((children (cond\n ((funcall instance-of? item BitmapIndexedNode) (get item :items))\n ((funcall instance-of? item ArrayNode) (get item :children))\n (t (get item :entries))))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (collect-nodes child nodes)))\n (setq index (+ index 1))))))\n\n (defun resetPersistentMapMetrics ()\n (resetMapMetrics))\n\n (defun persistentMapMetrics ()\n (readMapMetrics))\n\n (defun resetTransientMapMetrics ()\n (map-internals/resetTransientMapMetrics))\n\n (defun transientMapMetrics ()\n (readTransientMapMetrics))\n\n (defun inspectTransientMap (map)\n (let ((state (transient-state-of map))\n (nodes (new globalThis/Set))\n (owned-node-count 0))\n (collect-nodes (get state :root) nodes)\n (js-call nodes :forEach\n (lambda (node)\n (when (eq (get node :owner) (get state :owner))\n (setq owned-node-count (+ owned-node-count 1)))))\n (let* ((source (get state :source))\n (source-state (if (nil? source) undefined (aref source MAP_STATE))))\n (Object/freeze\n (js-object\n :active (get state :active)\n :count (get state :count)\n :nodeCount (get nodes :size)\n :ownedNodeCount owned-node-count\n :sharesSourceRoot (and (not (undefined? source-state))\n (eq (get state :root) (get source-state :root))))))))\n\n (defun inspectPersistentMap (map)\n (let* ((state (state-of map))\n (result (js-object\n :count (get state :count)\n :bitmapNodes 0\n :arrayNodes 0\n :collisionNodes 0\n :entries 0\n :nodeCount 0\n :maxDepth 0))\n (nodes (new globalThis/Set)))\n (inspect-item (get state :root) 1 result nodes)\n (put result \"nodeCount\" (get nodes :size))\n (Object/freeze result)))\n\n (defun sharedPersistentMapNodes (left right)\n (let ((left-nodes (new globalThis/Set))\n (right-nodes (new globalThis/Set))\n (shared 0))\n (collect-nodes (get (state-of left) :root) left-nodes)\n (collect-nodes (get (state-of right) :root) right-nodes)\n (js-call left-nodes :forEach\n (lambda (node)\n (when (js-call right-nodes :has node)\n (setq shared (+ shared 1)))))\n shared))\n\n (export\n resetPersistentMapMetrics\n persistentMapMetrics\n resetTransientMapMetrics\n transientMapMetrics\n inspectTransientMap\n inspectPersistentMap\n sharedPersistentMapNodes))\n"],"names":[],"mappings":";;;;;;;;AACE,YAAwC;AACxC,QACE,WACA,qBACA,WACA,mBACA,mBACA,UACA,gBACA,yBACA;AAEF,2BAAuB;;AAEvB,kBAAiB;EACf;QAAM,QAAO,CAAI,CAAM,gBAAK,YAAU,CAAM,KAAI;IAC9C,IAAM,CAAY;MAChB,0DAAO,KAAK,sBAAqB;;IACnC,OAAA;;;AAEJ,4BAA2B;EACzB;QAAM,QAAO,CAAI,CAAM,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AClB,SAAQ;IACX,cAAc,CAAM,SAAS,OAAM,SAAO;IAC1C,cAAc,CAAM,SAAS,QAAO,SAAO;IAC5C,CAAS,YAAW,WAClB,EAAS;MACP,uBAAM,CAAS,aAAY,OAAK;QAC9B,OAAA,CAAM,CAAA,SAAO,CAAG,SAAO;;;;;IAC7B,OAAA;;;AAEJ,QACE,2BACA,sBACA,0BACA,qBACA,qBACA,sBACA"}
|
|
1
|
+
{"version":3,"file":"map.mjs","sources":["map.eli"],"sourcesContent":["(module eliscript.runtime.testing.map\n (import \"../core/map-internals.mjs\" :as map-internals)\n (import \"../core/array-map.mjs\"\n isPersistentArrayMap\n readArrayMapState\n readTransientArrayMapState)\n (import \"../core/map-internals.mjs\"\n MAP_STATE\n TRANSIENT_MAP_STATE\n ArrayNode\n BitmapIndexedNode\n HashCollisionNode\n MapEntry\n readMapMetrics\n readTransientMapMetrics\n resetMapMetrics)\n\n (defconst instance-of? (js* \"(value, Constructor) => value instanceof Constructor\"))\n\n (defun state-of (map)\n (let ((state (if (nil? map) undefined (aref map MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript persistent hash map\")))\n state))\n\n (defun transient-state-of (map)\n (let ((state (if (nil? map) undefined (aref map TRANSIENT_MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript transient hash map\")))\n state))\n\n (defun inspect-item (item depth result nodes)\n (cond\n ((funcall instance-of? item MapEntry)\n (put result \"entries\" (+ (get result :entries) 1))\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth)))\n ((not (js-call nodes :has item))\n (js-call nodes :add item)\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth))\n (cond\n ((funcall instance-of? item BitmapIndexedNode)\n (put result \"bitmapNodes\" (+ (get result :bitmapNodes) 1))\n (let ((items (get item :items))\n (index 0))\n (while (< index (js-length items))\n (inspect-item (get items index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))\n ((funcall instance-of? item ArrayNode)\n (put result \"arrayNodes\" (+ (get result :arrayNodes) 1))\n (let ((children (get item :children))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (inspect-item child (+ depth 1) result nodes)))\n (setq index (+ index 1)))))\n ((funcall instance-of? item HashCollisionNode)\n (put result \"collisionNodes\" (+ (get result :collisionNodes) 1))\n (let ((entries (get item :entries))\n (index 0))\n (while (< index (js-length entries))\n (inspect-item (get entries index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))))))\n\n (defun collect-nodes (item nodes)\n (unless (or (funcall instance-of? item MapEntry)\n (js-call nodes :has item))\n (js-call nodes :add item)\n (let ((children (cond\n ((funcall instance-of? item BitmapIndexedNode) (get item :items))\n ((funcall instance-of? item ArrayNode) (get item :children))\n (t (get item :entries))))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (collect-nodes child nodes)))\n (setq index (+ index 1))))))\n\n (defun resetPersistentMapMetrics ()\n (resetMapMetrics))\n\n (defun persistentMapMetrics ()\n (readMapMetrics))\n\n (defun resetTransientMapMetrics ()\n (map-internals/resetTransientMapMetrics))\n\n (defun transientMapMetrics ()\n (readTransientMapMetrics))\n\n (defun inspectTransientMap (map)\n (let ((array-state (readTransientArrayMapState map)))\n (if (not (undefined? array-state))\n (if (not (nil? (get array-state :promoted)))\n (inspectTransientMap (get array-state :promoted))\n (Object/freeze\n (js-object\n :active (get array-state :active)\n :count (/ (js-length (get array-state :items)) 2)\n :nodeCount 0\n :ownedNodeCount 0\n :sharesSourceRoot false)))\n (let ((state (transient-state-of map))\n (nodes (new globalThis/Set))\n (owned-node-count 0))\n (collect-nodes (get state :root) nodes)\n (js-call nodes :forEach\n (lambda (node)\n (when (eq (get node :owner) (get state :owner))\n (setq owned-node-count (+ owned-node-count 1)))))\n (let* ((source (get state :source))\n (source-state (if (nil? source) undefined (aref source MAP_STATE))))\n (Object/freeze\n (js-object\n :active (get state :active)\n :count (get state :count)\n :nodeCount (get nodes :size)\n :ownedNodeCount owned-node-count\n :sharesSourceRoot (and (not (undefined? source-state))\n (eq (get state :root) (get source-state :root))))))))))\n\n (defun inspectPersistentMap (map)\n (if (isPersistentArrayMap map)\n (let ((array-state (readArrayMapState map)))\n (Object/freeze\n (js-object\n :representation \"array-map\"\n :count (get array-state :count)\n :bitmapNodes 0\n :arrayNodes 0\n :collisionNodes 0\n :entries (get array-state :count)\n :nodeCount 0\n :maxDepth 0)))\n (let* ((state (state-of map))\n (result (js-object\n :count (get state :count)\n :bitmapNodes 0\n :arrayNodes 0\n :collisionNodes 0\n :entries 0\n :nodeCount 0\n :maxDepth 0))\n (nodes (new globalThis/Set)))\n (inspect-item (get state :root) 1 result nodes)\n (put result \"nodeCount\" (get nodes :size))\n (Object/freeze result))))\n\n (defun sharedPersistentMapNodes (left right)\n (if (or (isPersistentArrayMap left) (isPersistentArrayMap right))\n 0\n (let ((left-nodes (new globalThis/Set))\n (right-nodes (new globalThis/Set))\n (shared 0))\n (collect-nodes (get (state-of left) :root) left-nodes)\n (collect-nodes (get (state-of right) :root) right-nodes)\n (js-call left-nodes :forEach\n (lambda (node)\n (when (js-call right-nodes :has node)\n (setq shared (+ shared 1)))))\n shared)))\n\n (export\n resetPersistentMapMetrics\n persistentMapMetrics\n resetTransientMapMetrics\n transientMapMetrics\n inspectTransientMap\n inspectPersistentMap\n sharedPersistentMapNodes))\n"],"names":[],"mappings":";;;;;;;;AACE,YAAwC;AACxC,QACE,sBACA,mBACA;AACF,QACE,WACA,qBACA,WACA,mBACA,mBACA,UACA,gBACA,yBACA;AAEF,2BAAuB;;AAEvB,kBAAiB;EACf;QAAM,QAAO,CAAI,CAAM,gBAAK,YAAU,CAAM,KAAI;IAC9C,IAAM,CAAY;MAChB,0DAAO,KAAK,sBAAqB;;IACnC,OAAA;;;AAEJ,4BAA2B;EACzB;QAAM,QAAO,CAAI,CAAM,gBAAK,YAAU,CAAM,KAAI;IAC9C,IAAM,CAAY;MAChB,0DAAO,KAAK,s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,GACZ,kBAAgB,GAChB,WAAS,CAAK,aAAY,UAC1B,aAAW,GACX,YAAU;;;IAChB;UAAO,QAAQ,SAAS;UACjB,SAAQ,EACE,SAAO,CAAK,OAAM,UAClB,eAAa,GACb,cAAY,GACZ,kBAAgB,GAChB,WAAS,GACT,aAAW,GACX,YAAU;UACpB,QAAO,KAAK;MAChB,aAAa,CAAK,OAAM,SAAO,GAAE,QAAO;MACzC,EAAK,QAAO,eAAY,CAAK,OAAM;MACnC,OAAC,cAAc;;;;AAEvB,kCAAiC,MAAK;EACpC,IAAI,oBAAK,qBAAqB,6BAAO,qBAAqB;IACtD,OAAA;;IACA;UAAM,aAAY,KAAK;UACjB,cAAa,KAAK;UAClB,SAAQ;MACX,cAAc,CAAM,SAAS,OAAM,SAAO;MAC1C,cAAc,CAAM,SAAS,QAAO,SAAO;MAC5C,CAAS,YAAW,WAClB,EAAS;QACP,uBAAM,CAAS,aAAY,OAAK;UAC9B,OAAA,CAAM,CAAA,SAAO,CAAG,SAAO;;;;;MAC7B,OAAA;;;;AAER,QACE,2BACA,sBACA,0BACA,qBACA,qBACA,sBACA"}
|
package/runtime/unicode-case.mjs
CHANGED
|
@@ -99,10 +99,10 @@ function convert_profile(text, upper, rules) {
|
|
|
99
99
|
((first = 962));
|
|
100
100
|
}
|
|
101
101
|
((chunk = (chunk + characters(first))));
|
|
102
|
-
if ((
|
|
102
|
+
if ((second !== 0)) {
|
|
103
103
|
((chunk = (chunk + characters(second))));
|
|
104
104
|
}
|
|
105
|
-
if ((
|
|
105
|
+
if ((third !== 0)) {
|
|
106
106
|
((chunk = (chunk + characters(third))));
|
|
107
107
|
}
|
|
108
108
|
if (__eliscript_numeric_relation(">=", ((chunk) ?? []).length, 4096)) {
|
|
@@ -138,10 +138,10 @@ function profile_method(name, upper, rules, string_constructor, function_prototy
|
|
|
138
138
|
Object.defineProperty(target, "length", ({"value": 0, "configurable": true}));
|
|
139
139
|
return new (globalThis.Proxy)(target, ({"apply": ((ignored, receiver, arguments$) => {
|
|
140
140
|
if ((receiver == null)) {
|
|
141
|
-
((
|
|
141
|
+
((__eliscript_value_2) => { throw __eliscript_value_2; })(new (type_error)(("String.prototype." + name + " called on null or undefined")));
|
|
142
142
|
}
|
|
143
143
|
if ((__eliscript_value_type(receiver) === "symbol")) {
|
|
144
|
-
((
|
|
144
|
+
((__eliscript_value_3) => { throw __eliscript_value_3; })(new (type_error)("Cannot convert a Symbol value to a string"));
|
|
145
145
|
}
|
|
146
146
|
{
|
|
147
147
|
let text = (__eliscript_tdz_ready_1 === true ? apply_native : __eliscript_tdz_error("apply_native"))(string_constructor, undefined, [receiver]);
|
|
@@ -156,7 +156,7 @@ function installUnicodeCaseProfile(version, ...arguments$) {
|
|
|
156
156
|
let requested_realm = ((((arguments$) ?? []).length === 0) ? undefined : (arguments$)[0]);
|
|
157
157
|
let realm = ((requested_realm === undefined) ? globalThis.globalThis : requested_realm);
|
|
158
158
|
if ((!(__eliscript_truthy(realm) && (__eliscript_value_type((realm)["String"]) === "function") && (__eliscript_value_type((realm)["Function"]) === "function") && (__eliscript_value_type((realm)["TypeError"]) === "function")))) {
|
|
159
|
-
((
|
|
159
|
+
((__eliscript_value_4) => { throw __eliscript_value_4; })(new (globalThis.TypeError)("Unicode case profile requires a real String realm"));
|
|
160
160
|
}
|
|
161
161
|
{
|
|
162
162
|
let string_constructor = (realm)["String"];
|
|
@@ -174,7 +174,7 @@ function installUnicodeCaseProfile(version, ...arguments$) {
|
|
|
174
174
|
{
|
|
175
175
|
let descriptor = Object.getOwnPropertyDescriptor(prototype, (names)[index]);
|
|
176
176
|
if (__eliscript_truthy((__eliscript_truthy(descriptor) ? (!__eliscript_truthy((descriptor)["configurable"])) : (!__eliscript_truthy(Object.isExtensible(prototype)))))) {
|
|
177
|
-
((
|
|
177
|
+
((__eliscript_value_5) => { throw __eliscript_value_5; })(new (type_error)("Unicode case profile cannot replace a fixed String method"));
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
((index = (index + 1)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime/unicode-case.mjs","sources":["runtime/unicode-case.eli"],"sourcesContent":["(module eliscript.runtime.unicode-case\n (import \"./unicode-case-data.mjs\" :as data)\n\n ;; Ordinary Eliscript JavaScript uses the same Unicode 17 default as the\n ;; owned runtime. Explicit profile selection remains available below.\n ;; Tables are derived from the one maintained Unicode-3.0 region in memory.eli.\n (defconst installed (new globalThis.WeakMap))\n (defconst apply-native Reflect/apply)\n (defconst intrinsic-array-join (get (get globalThis.Array :prototype) :join))\n (defconst intrinsic-string globalThis.String)\n (defconst intrinsic-code-point (get (get intrinsic-string :prototype) :codePointAt))\n (defconst intrinsic-from-code-point (get intrinsic-string :fromCodePoint))\n (defconst intrinsic-regexp-exec (get (get globalThis.RegExp :prototype) :exec))\n (defconst non-ascii (new globalThis.RegExp \"[^\\\\x00-\\\\x7f]\"))\n (defconst ascii-upper (new globalThis.RegExp \"[A-Z]\"))\n (defconst ascii-lower (new globalThis.RegExp \"[a-z]\"))\n\n (defun case-pattern? (pattern text)\n ;; RegExp.prototype.test would consult a replaceable .exec on every call.\n ;; String casing must not acquire that unrelated observable dependency.\n (not (eq (funcall apply-native intrinsic-regexp-exec pattern (js-array text)) nil)))\n\n (defun point (text index)\n (funcall apply-native intrinsic-code-point text (js-array index)))\n (defun characters (code)\n (funcall apply-native intrinsic-from-code-point intrinsic-string (js-array code)))\n (defun tables (version)\n ;; Static export references keep the table module's namespace out of every\n ;; browser bundle while retaining each profile's exact function identities.\n (cond\n ((= version 15.1)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_151)\n (get data :unicode_case_data_upper_1_151) (get data :unicode_case_data_upper_2_151))\n :lower (js-array (get data :unicode_case_data_lower_0_151)\n (get data :unicode_case_data_lower_1_151) (get data :unicode_case_data_lower_2_151))\n :cased (get data :unicode_case_data_cased_151)\n :ignorable (get data :unicode_case_data_case_ignorable_151)))\n ((= version 16)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_160)\n (get data :unicode_case_data_upper_1_160) (get data :unicode_case_data_upper_2_160))\n :lower (js-array (get data :unicode_case_data_lower_0_160)\n (get data :unicode_case_data_lower_1_160) (get data :unicode_case_data_lower_2_160))\n :cased (get data :unicode_case_data_cased_160)\n :ignorable (get data :unicode_case_data_case_ignorable_160)))\n ((= version 17)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_17)\n (get data :unicode_case_data_upper_1_17) (get data :unicode_case_data_upper_2_17))\n :lower (js-array (get data :unicode_case_data_lower_0_17)\n (get data :unicode_case_data_lower_1_17) (get data :unicode_case_data_lower_2_17))\n :cased (get data :unicode_case_data_cased_17)\n :ignorable (get data :unicode_case_data_case_ignorable_17)))\n (t (throw (new globalThis.TypeError \"Unicode case profile must be 15.1, 16, or 17\")))))\n\n (defun final-sigma (text index before rules)\n (let ((result before) (done false))\n (while (and (= before 1) (not done) (< index (js-length text)))\n (let ((code (point text index)))\n (when (= (funcall (get rules :ignorable) code) 0)\n (setq done t)\n (when (= (funcall (get rules :cased) code) 1) (setq result 0)))\n (setq index (+ index (if (> code 65535) 2 1))))) result))\n\n (defun convert-profile (text upper rules)\n (let* ((mapping (get rules (if upper \"upper\" \"lower\")))\n (first-map (aref mapping 0)) (second-map (aref mapping 1)) (third-map (aref mapping 2))\n (pieces (js-array)) (chunk \"\") (index 0) (before 0))\n (while (< index (js-length text))\n (let* ((code (point text index)) (step (if (> code 65535) 2 1))\n (first (funcall first-map code)) (second (funcall second-map code)) (third (funcall third-map code)))\n (when (and (not upper) (= code 931) (= (final-sigma text (+ index step) before rules) 1))\n (setq first 962))\n (setq chunk (+ chunk (characters first)))\n (when (/= second 0) (setq chunk (+ chunk (characters second))))\n (when (/= third 0) (setq chunk (+ chunk (characters third))))\n (when (>= (js-length chunk) 4096) (js-call pieces :push chunk) (setq chunk \"\"))\n (when (and (not upper) (= (funcall (get rules :ignorable) code) 0))\n (setq before (funcall (get rules :cased) code)))\n (setq index (+ index step))))\n (when (> (js-length chunk) 0) (js-call pieces :push chunk))\n (funcall apply-native intrinsic-array-join pieces (js-array \"\"))))\n\n (defun convert (text upper rules)\n ;; Already-cased ASCII is an identity under every supported profile. Avoid\n ;; three table lookups per character for this common path. Do not delegate\n ;; casing to replaceable host String methods: changed ASCII and every\n ;; non-ASCII code unit still use our exact tables and final-sigma rules.\n (if (or (case-pattern? non-ascii text)\n (case-pattern? (if upper ascii-lower ascii-upper) text))\n (convert-profile text upper rules)\n text))\n\n (defun profile-method (name upper rules string-constructor function-prototype type-error)\n ;; An arrow target is intrinsically nonconstructible. Proxy [[Call]] gives\n ;; Eli the actual method receiver without embedded foreign-language code.\n (let ((target (lambda () undefined)))\n (Object/setPrototypeOf target function-prototype)\n (Object/defineProperty target \"name\" (js-object :value name :configurable t))\n (Object/defineProperty target \"length\" (js-object :value 0 :configurable t))\n (new globalThis.Proxy target (js-object :apply (lambda (ignored receiver arguments)\n (when (nullish? receiver)\n (throw (new type-error (+ \"String.prototype.\" name \" called on null or undefined\"))))\n ;; String(Symbol) has a special exception to abstract ToString; the\n ;; String prototype algorithms do not have that exception.\n (when (= (value-type receiver) \"symbol\")\n (throw (new type-error \"Cannot convert a Symbol value to a string\")))\n (let ((text (funcall apply-native string-constructor undefined (js-array receiver))))\n (convert text upper rules)))))))\n\n (defun installUnicodeCaseProfile (version &rest arguments)\n (let* ((rules (tables version))\n (requested-realm (if (= (js-length arguments) 0) undefined (aref arguments 0)))\n (realm (if (undefined? requested-realm) globalThis.globalThis requested-realm)))\n (unless (and realm (= (value-type (get realm :String)) \"function\")\n (= (value-type (get realm :Function)) \"function\")\n (= (value-type (get realm :TypeError)) \"function\"))\n (throw (new globalThis.TypeError \"Unicode case profile requires a real String realm\")))\n (let* ((string-constructor (get realm :String)) (prototype (get string-constructor :prototype))\n (function-prototype (get (get realm :Function) :prototype)) (type-error (get realm :TypeError))\n (previous (js-call installed :get prototype)))\n (if (and previous (= (get previous :version) version)) previous\n (let ((names (js-array \"toUpperCase\" \"toLowerCase\")) (index 0))\n ;; Check both ordinary intrinsic properties before publishing any\n ;; method, including the deleted-property/nonextensible boundary.\n (while (< index 2)\n (let ((descriptor (Object/getOwnPropertyDescriptor prototype (aref names index))))\n (when (if descriptor (not (get descriptor :configurable)) (not (Object/isExtensible prototype)))\n (throw (new type-error \"Unicode case profile cannot replace a fixed String method\"))))\n (setq index (1+ index)))\n (let* ((upper (profile-method \"toUpperCase\" t rules string-constructor function-prototype type-error))\n (lower (profile-method \"toLowerCase\" false rules string-constructor function-prototype type-error))\n (state (Object/freeze (js-object :version version :upper upper :lower lower))))\n (Object/defineProperty prototype \"toUpperCase\" (js-object :value upper :writable t :enumerable false :configurable t))\n (Object/defineProperty prototype \"toLowerCase\" (js-object :value lower :writable t :enumerable false :configurable t))\n (js-call installed :set prototype state) state))))))\n ;; ESM evaluation installs once, before the importing user module executes.\n ;; A later import is cached, so user getters, replacements and deletion remain.\n (installUnicodeCaseProfile 17)\n (export installUnicodeCaseProfile))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACE,YAAsC;AAKtC,kBAAoB,KAAK;;AACzB,qBAAuB;;AACvB,6BAA+B,CAAK,CAAK,kBAAiB,cAAY;;AACtE,yBAA2B;;AAC3B,6BAA+B,CAAK,CAAK,kBAAiB,cAAY;;AACtE,kCAAoC,CAAK,kBAAiB;;AAC1D,8BAAgC,CAAK,CAAK,mBAAkB,cAAY;;AACxE,kBAAoB,KAAK,mBAAkB;;AAC3C,oBAAsB,KAAK,mBAAkB;;AAC7C,oBAAsB,KAAK,mBAAkB;;AAE7C,6BAAsB,SAAQ;EAG5B,OAAA,EAAK,CAAa,0FAAa,6GAAsB,SAAQ,CAAU,WAAO;;AAEhF,eAAc,MAAK;EACjB,OAAS,0FAAa,2GAAqB,MAAK,CAAU;;AAC5D,oBAAmB;EACjB,OAAS,0FAAa,qHAA0B,mGAAiB,CAAU;;AAC7E,gBAAe;EAIX,IAAC,CAAG,YAAQ;IACV,OAAA,EACE,SAAO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c,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YAClH,sBAAsB,WAAU,eAAc,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YACnH,CAAS,qFAAU,OAAK,WAAU;YAAO,OAAA;;;;;;;AAGpD,0BAA0B;AAC3B,QAAQ"}
|
|
1
|
+
{"version":3,"file":"runtime/unicode-case.mjs","sources":["runtime/unicode-case.eli"],"sourcesContent":["(module eliscript.runtime.unicode-case\n (import \"./unicode-case-data.mjs\" :as data)\n\n ;; Ordinary Eliscript JavaScript uses the same Unicode 17 default as the\n ;; owned runtime. Explicit profile selection remains available below.\n ;; Tables are derived from the one maintained Unicode-3.0 region in memory.eli.\n (defconst installed (new globalThis.WeakMap))\n (defconst apply-native Reflect/apply)\n (defconst intrinsic-array-join (get (get globalThis.Array :prototype) :join))\n (defconst intrinsic-string globalThis.String)\n (defconst intrinsic-code-point (get (get intrinsic-string :prototype) :codePointAt))\n (defconst intrinsic-from-code-point (get intrinsic-string :fromCodePoint))\n (defconst intrinsic-regexp-exec (get (get globalThis.RegExp :prototype) :exec))\n (defconst non-ascii (new globalThis.RegExp \"[^\\\\x00-\\\\x7f]\"))\n (defconst ascii-upper (new globalThis.RegExp \"[A-Z]\"))\n (defconst ascii-lower (new globalThis.RegExp \"[a-z]\"))\n\n (defun case-pattern? (pattern text)\n ;; RegExp.prototype.test would consult a replaceable .exec on every call.\n ;; String casing must not acquire that unrelated observable dependency.\n (not (eq (funcall apply-native intrinsic-regexp-exec pattern (js-array text)) nil)))\n\n (defun point (text index)\n (funcall apply-native intrinsic-code-point text (js-array index)))\n (defun characters (code)\n (funcall apply-native intrinsic-from-code-point intrinsic-string (js-array code)))\n (defun tables (version)\n ;; Static export references keep the table module's namespace out of every\n ;; browser bundle while retaining each profile's exact function identities.\n (cond\n ((= version 15.1)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_151)\n (get data :unicode_case_data_upper_1_151) (get data :unicode_case_data_upper_2_151))\n :lower (js-array (get data :unicode_case_data_lower_0_151)\n (get data :unicode_case_data_lower_1_151) (get data :unicode_case_data_lower_2_151))\n :cased (get data :unicode_case_data_cased_151)\n :ignorable (get data :unicode_case_data_case_ignorable_151)))\n ((= version 16)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_160)\n (get data :unicode_case_data_upper_1_160) (get data :unicode_case_data_upper_2_160))\n :lower (js-array (get data :unicode_case_data_lower_0_160)\n (get data :unicode_case_data_lower_1_160) (get data :unicode_case_data_lower_2_160))\n :cased (get data :unicode_case_data_cased_160)\n :ignorable (get data :unicode_case_data_case_ignorable_160)))\n ((= version 17)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_17)\n (get data :unicode_case_data_upper_1_17) (get data :unicode_case_data_upper_2_17))\n :lower (js-array (get data :unicode_case_data_lower_0_17)\n (get data :unicode_case_data_lower_1_17) (get data :unicode_case_data_lower_2_17))\n :cased (get data :unicode_case_data_cased_17)\n :ignorable (get data :unicode_case_data_case_ignorable_17)))\n (t (throw (new globalThis.TypeError \"Unicode case profile must be 15.1, 16, or 17\")))))\n\n (defun final-sigma (text index before rules)\n (let ((result before) (done false))\n (while (and (= before 1) (not done) (< index (js-length text)))\n (let ((code (point text index)))\n (when (= (funcall (get rules :ignorable) code) 0)\n (setq done t)\n (when (= (funcall (get rules :cased) code) 1) (setq result 0)))\n (setq index (+ index (if (> code 65535) 2 1))))) result))\n\n (defun convert-profile (text upper rules)\n (let* ((mapping (get rules (if upper \"upper\" \"lower\")))\n (first-map (aref mapping 0)) (second-map (aref mapping 1)) (third-map (aref mapping 2))\n (pieces (js-array)) (chunk \"\") (index 0) (before 0))\n (while (< index (js-length text))\n (let* ((code (point text index)) (step (if (> code 65535) 2 1))\n (first (funcall first-map code)) (second (funcall second-map code)) (third (funcall third-map code)))\n (when (and (not upper) (= code 931) (= (final-sigma text (+ index step) before rules) 1))\n (setq first 962))\n (setq chunk (+ chunk (characters first)))\n (when (/= second 0) (setq chunk (+ chunk (characters second))))\n (when (/= third 0) (setq chunk (+ chunk (characters third))))\n (when (>= (js-length chunk) 4096) (js-call pieces :push chunk) (setq chunk \"\"))\n (when (and (not upper) (= (funcall (get rules :ignorable) code) 0))\n (setq before (funcall (get rules :cased) code)))\n (setq index (+ index step))))\n (when (> (js-length chunk) 0) (js-call pieces :push chunk))\n (funcall apply-native intrinsic-array-join pieces (js-array \"\"))))\n\n (defun convert (text upper rules)\n ;; Already-cased ASCII is an identity under every supported profile. Avoid\n ;; three table lookups per character for this common path. Do not delegate\n ;; casing to replaceable host String methods: changed ASCII and every\n ;; non-ASCII code unit still use our exact tables and final-sigma rules.\n (if (or (case-pattern? non-ascii text)\n (case-pattern? (if upper ascii-lower ascii-upper) text))\n (convert-profile text upper rules)\n text))\n\n (defun profile-method (name upper rules string-constructor function-prototype type-error)\n ;; An arrow target is intrinsically nonconstructible. Proxy [[Call]] gives\n ;; Eli the actual method receiver without embedded foreign-language code.\n (let ((target (lambda () undefined)))\n (Object/setPrototypeOf target function-prototype)\n (Object/defineProperty target \"name\" (js-object :value name :configurable t))\n (Object/defineProperty target \"length\" (js-object :value 0 :configurable t))\n (new globalThis.Proxy target (js-object :apply (lambda (ignored receiver arguments)\n (when (nullish? receiver)\n (throw (new type-error (+ \"String.prototype.\" name \" called on null or undefined\"))))\n ;; String(Symbol) has a special exception to abstract ToString; the\n ;; String prototype algorithms do not have that exception.\n (when (= (value-type receiver) \"symbol\")\n (throw (new type-error \"Cannot convert a Symbol value to a string\")))\n (let ((text (funcall apply-native string-constructor undefined (js-array receiver))))\n (convert text upper rules)))))))\n\n (defun installUnicodeCaseProfile (version &rest arguments)\n (let* ((rules (tables version))\n (requested-realm (if (= (js-length arguments) 0) undefined (aref arguments 0)))\n (realm (if (undefined? requested-realm) globalThis.globalThis requested-realm)))\n (unless (and realm (= (value-type (get realm :String)) \"function\")\n (= (value-type (get realm :Function)) \"function\")\n (= (value-type (get realm :TypeError)) \"function\"))\n (throw (new globalThis.TypeError \"Unicode case profile requires a real String realm\")))\n (let* ((string-constructor (get realm :String)) (prototype (get string-constructor :prototype))\n (function-prototype (get (get realm :Function) :prototype)) (type-error (get realm :TypeError))\n (previous (js-call installed :get prototype)))\n (if (and previous (= (get previous :version) version)) previous\n (let ((names (js-array \"toUpperCase\" \"toLowerCase\")) (index 0))\n ;; Check both ordinary intrinsic properties before publishing any\n ;; method, including the deleted-property/nonextensible boundary.\n (while (< index 2)\n (let ((descriptor (Object/getOwnPropertyDescriptor prototype (aref names index))))\n (when (if descriptor (not (get descriptor :configurable)) (not (Object/isExtensible prototype)))\n (throw (new type-error \"Unicode case profile cannot replace a fixed String method\"))))\n (setq index (1+ index)))\n (let* ((upper (profile-method \"toUpperCase\" t rules string-constructor function-prototype type-error))\n (lower (profile-method \"toLowerCase\" false rules string-constructor function-prototype type-error))\n (state (Object/freeze (js-object :version version :upper upper :lower lower))))\n (Object/defineProperty prototype \"toUpperCase\" (js-object :value upper :writable t :enumerable false :configurable t))\n (Object/defineProperty prototype \"toLowerCase\" (js-object :value lower :writable t :enumerable false :configurable t))\n (js-call installed :set prototype state) state))))))\n ;; ESM evaluation installs once, before the importing user module executes.\n ;; A later import is cached, so user getters, replacements and deletion remain.\n (installUnicodeCaseProfile 17)\n (export installUnicodeCaseProfile))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACE,YAAsC;AAKtC,kBAAoB,KAAK;;AACzB,qBAAuB;;AACvB,6BAA+B,CAAK,CAAK,kBAAiB,cAAY;;AACtE,yBAA2B;;AAC3B,6BAA+B,CAAK,CAAK,kBAAiB,cAAY;;AACtE,kCAAoC,CAAK,kBAAiB;;AAC1D,8BAAgC,CAAK,CAAK,mBAAkB,cAAY;;AACxE,kBAAoB,KAAK,mBAAkB;;AAC3C,oBAAsB,KAAK,mBAAkB;;AAC7C,oBAAsB,KAAK,mBAAkB;;AAE7C,6BAAsB,SAAQ;EAG5B,OAAA,EAAK,CAAa,0FAAa,6GAAsB,SAAQ,CAAU,WA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,eAAe,eAAc,MAAE,OAAM,oBAAmB,oBAAmB;gBACnF,QAAQ,eAAe,eAAc,OAAM,OAAM,oBAAmB,oBAAmB;gBACvF,QAAQ,cAAc,EAAW,WAAS,SAAQ,SAAO,OAAM,SAAO;YAC1E,sBAAsB,WAAU,eAAc,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YAClH,sBAAsB,WAAU,eAAc,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YACnH,CAAS,qFAAU,OAAK,WAAU;YAAO,OAAA;;;;;;;AAGpD,0BAA0B;AAC3B,QAAQ"}
|
|
@@ -341,15 +341,13 @@ function createService(...optional_arguments) {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
function cancel_after_failure(stream, reason) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return (Promise.resolve((stream)["cancel"](reason)))["catch"]((() => {
|
|
347
|
-
return undefined;
|
|
348
|
-
}));
|
|
349
|
-
} catch (_ignored) {
|
|
344
|
+
try {
|
|
345
|
+
(Promise.resolve((stream)["cancel"](reason)))["catch"]((() => {
|
|
350
346
|
return undefined;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
347
|
+
}));
|
|
348
|
+
} catch (_ignored) {
|
|
349
|
+
undefined;
|
|
350
|
+
}
|
|
353
351
|
return undefined;
|
|
354
352
|
}
|
|
355
353
|
function createClient(...optional_arguments) {
|
|
@@ -448,17 +446,13 @@ function createClient(...optional_arguments) {
|
|
|
448
446
|
cancel_after_failure(reader, error);
|
|
449
447
|
return ((__eliscript_value_9) => { throw __eliscript_value_9; })(error);
|
|
450
448
|
} finally {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
return ((__eliscript_value_10) => { throw __eliscript_value_10; })(cleanup_error);
|
|
457
|
-
} else {
|
|
458
|
-
return null;
|
|
459
|
-
}
|
|
449
|
+
try {
|
|
450
|
+
(reader)["releaseLock"]();
|
|
451
|
+
} catch (cleanup_error) {
|
|
452
|
+
if ((!__eliscript_truthy(failed))) {
|
|
453
|
+
((__eliscript_value_10) => { throw __eliscript_value_10; })(cleanup_error);
|
|
460
454
|
}
|
|
461
|
-
}
|
|
455
|
+
}
|
|
462
456
|
}
|
|
463
457
|
})());
|
|
464
458
|
})(((reply)["body"])["getReader"](), false)) : null);
|