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
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "eliscript/runtime/errors.mjs";
|
|
3
|
+
var __eliscript_tdz_ready_1;
|
|
4
|
+
var __eliscript_tdz_ready_2;
|
|
5
|
+
var __eliscript_tdz_ready_3;
|
|
6
|
+
var __eliscript_tdz_ready_4;
|
|
7
|
+
var __eliscript_tdz_ready_5;
|
|
8
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
9
|
+
import { __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
10
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
11
|
+
|
|
12
|
+
import {existsSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, statSync, symlinkSync} from "node:fs";
|
|
13
|
+
import {tmpdir} from "node:os";
|
|
14
|
+
import {dirname, join, relative, resolve, sep} from "node:path";
|
|
15
|
+
import {fileURLToPath, pathToFileURL} from "node:url";
|
|
16
|
+
import {diagnosticFromError, renderDiagnostic, requestedDiagnosticFormat} from "./bun.mjs";
|
|
17
|
+
import {buildProject} from "./project.mjs";
|
|
18
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
const packageRoot = resolve(here, "../..");
|
|
20
|
+
__eliscript_tdz_ready_1 = true;
|
|
21
|
+
const digitsPattern = new (globalThis.RegExp)("^[0-9]+$", "u");
|
|
22
|
+
__eliscript_tdz_ready_2 = true;
|
|
23
|
+
const importPattern = new (globalThis.RegExp)("\\(import(?:-portable)?\\s+\"([^\"]+)\"", "gu");
|
|
24
|
+
__eliscript_tdz_ready_3 = true;
|
|
25
|
+
const dynamicImport = (url) => import(url);
|
|
26
|
+
__eliscript_tdz_ready_4 = true;
|
|
27
|
+
const usage = (String("Usage: eliscript-test [OPTIONS] [TARGET ...]\n\n") + String("Options:\n") + String(" --filter PATTERN Run only tests whose names contain PATTERN\n") + String(" --tag TAG Run only tests matching TAG\n") + String(" --seed NUMBER Use deterministic seed metadata for test runs\n") + String(" --fail-fast Stop running tests after the first failure or error\n") + String(" --watch Re-run tests when matching .eli files change\n") + String(" --root DIR Set explicit project root for compiling test files\n") + String(" --json Emit structured JSON test report\n") + String(" -h, --help Show this help\n"));
|
|
28
|
+
__eliscript_tdz_ready_5 = true;
|
|
29
|
+
function parseArguments(arguments_) {
|
|
30
|
+
{
|
|
31
|
+
let argumentsList = Array.from(arguments_);
|
|
32
|
+
let targets = [];
|
|
33
|
+
let filter = undefined;
|
|
34
|
+
let tag = undefined;
|
|
35
|
+
let seed = undefined;
|
|
36
|
+
let failFast = false;
|
|
37
|
+
let watch = false;
|
|
38
|
+
let root = undefined;
|
|
39
|
+
let json = false;
|
|
40
|
+
let helpResult = null;
|
|
41
|
+
if (((argumentsList)[0] === "--")) {
|
|
42
|
+
(argumentsList)["shift"]();
|
|
43
|
+
}
|
|
44
|
+
while (((helpResult === null) && __eliscript_numeric_relation(">", ((argumentsList) ?? []).length, 0))) {
|
|
45
|
+
{
|
|
46
|
+
let argument = (argumentsList)["shift"]();
|
|
47
|
+
if (((argument === "-h") || (argument === "--help"))) {
|
|
48
|
+
((helpResult = ({"help": true})));
|
|
49
|
+
} else {
|
|
50
|
+
if ((argument === "--filter")) {
|
|
51
|
+
if ((((argumentsList) ?? []).length === 0)) {
|
|
52
|
+
((__eliscript_value_1) => { throw __eliscript_value_1; })(new (globalThis.Error)("--filter requires a pattern"));
|
|
53
|
+
}
|
|
54
|
+
((filter = (argumentsList)["shift"]()));
|
|
55
|
+
} else {
|
|
56
|
+
if ((argument === "--tag")) {
|
|
57
|
+
if ((((argumentsList) ?? []).length === 0)) {
|
|
58
|
+
((__eliscript_value_2) => { throw __eliscript_value_2; })(new (globalThis.Error)("--tag requires a tag name"));
|
|
59
|
+
}
|
|
60
|
+
((tag = (argumentsList)["shift"]()));
|
|
61
|
+
} else {
|
|
62
|
+
if ((argument === "--seed")) {
|
|
63
|
+
if ((((argumentsList) ?? []).length === 0)) {
|
|
64
|
+
((__eliscript_value_3) => { throw __eliscript_value_3; })(new (globalThis.Error)("--seed requires an integer"));
|
|
65
|
+
}
|
|
66
|
+
{
|
|
67
|
+
let text = (argumentsList)["shift"]();
|
|
68
|
+
if ((!__eliscript_truthy(((__eliscript_tdz_ready_2 === true ? digitsPattern : __eliscript_tdz_error("digitsPattern")))["test"](text)))) {
|
|
69
|
+
((__eliscript_value_4) => { throw __eliscript_value_4; })(new (globalThis.Error)("--seed requires a non-negative integer"));
|
|
70
|
+
}
|
|
71
|
+
((seed = globalThis.Number(text)));
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
if ((argument === "--fail-fast")) {
|
|
75
|
+
((failFast = true));
|
|
76
|
+
} else {
|
|
77
|
+
if ((argument === "--watch")) {
|
|
78
|
+
((watch = true));
|
|
79
|
+
} else {
|
|
80
|
+
if ((argument === "--root")) {
|
|
81
|
+
if ((((argumentsList) ?? []).length === 0)) {
|
|
82
|
+
((__eliscript_value_5) => { throw __eliscript_value_5; })(new (globalThis.Error)("--root requires a directory"));
|
|
83
|
+
}
|
|
84
|
+
((root = (argumentsList)["shift"]()));
|
|
85
|
+
} else {
|
|
86
|
+
if ((argument === "--json")) {
|
|
87
|
+
((json = true));
|
|
88
|
+
} else {
|
|
89
|
+
if (__eliscript_truthy((argument)["startsWith"]("-"))) {
|
|
90
|
+
((__eliscript_value_6) => { throw __eliscript_value_6; })(new (globalThis.Error)((String("unknown option: ") + String(argument))));
|
|
91
|
+
} else {
|
|
92
|
+
(targets)["push"](argument);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (__eliscript_truthy(helpResult)) {
|
|
105
|
+
return helpResult;
|
|
106
|
+
} else {
|
|
107
|
+
return ({"targets": targets, "filter": filter, "tag": tag, "seed": seed, "failFast": failFast, "watch": watch, "root": root, "json": json});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function walkTestDirectory(directory, files, seen) {
|
|
112
|
+
{
|
|
113
|
+
let entries = (readdirSync(directory, ({"withFileTypes": true})))["sort"](((a, b) => {
|
|
114
|
+
if (__eliscript_numeric_relation("<", (a)["name"], (b)["name"])) {
|
|
115
|
+
return -1;
|
|
116
|
+
} else {
|
|
117
|
+
if (__eliscript_numeric_relation(">", (a)["name"], (b)["name"])) {
|
|
118
|
+
return 1;
|
|
119
|
+
} else {
|
|
120
|
+
return 0;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
let i = 0;
|
|
125
|
+
while (__eliscript_numeric_relation("<", i, ((entries) ?? []).length)) {
|
|
126
|
+
{
|
|
127
|
+
let entry = (entries)[i];
|
|
128
|
+
let name = (entry)["name"];
|
|
129
|
+
let full = join(directory, name);
|
|
130
|
+
if (__eliscript_truthy((entry)["isDirectory"]())) {
|
|
131
|
+
if ((!((name === "node_modules") || (name === "dist") || (name === ".git") || __eliscript_truthy((name)["startsWith"](".eliscript-"))))) {
|
|
132
|
+
walkTestDirectory(full, files, seen);
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
if ((__eliscript_truthy((entry)["isFile"]()) && __eliscript_truthy((name)["endsWith"](".test.eli")))) {
|
|
136
|
+
{
|
|
137
|
+
let canonical = realpathSync(full);
|
|
138
|
+
if ((!__eliscript_truthy((seen)["has"](canonical)))) {
|
|
139
|
+
(seen)["add"](canonical);
|
|
140
|
+
(files)["push"](canonical);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
((i = (i + 1)));
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function discoverTestFiles(targets, root = null) {
|
|
154
|
+
{
|
|
155
|
+
let effective_targets = (((targets == null) || (((targets) ?? []).length === 0)) ? [((root == null) ? "tests" : root)] : targets);
|
|
156
|
+
let files = [];
|
|
157
|
+
let seen = new (globalThis.Set)();
|
|
158
|
+
let i = 0;
|
|
159
|
+
while (__eliscript_numeric_relation("<", i, ((effective_targets) ?? []).length)) {
|
|
160
|
+
{
|
|
161
|
+
let raw = (effective_targets)[i];
|
|
162
|
+
let resolved = resolve(raw);
|
|
163
|
+
let st = statSync(resolved);
|
|
164
|
+
if (__eliscript_truthy((st)["isFile"]())) {
|
|
165
|
+
if ((!__eliscript_truthy((resolved)["endsWith"](".eli")))) {
|
|
166
|
+
((__eliscript_value_7) => { throw __eliscript_value_7; })(new (globalThis.Error)((String("test target must use .eli extension: ") + String(raw))));
|
|
167
|
+
}
|
|
168
|
+
{
|
|
169
|
+
let canonical = realpathSync(resolved);
|
|
170
|
+
if ((!__eliscript_truthy((seen)["has"](canonical)))) {
|
|
171
|
+
(seen)["add"](canonical);
|
|
172
|
+
(files)["push"](canonical);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
if (__eliscript_truthy((st)["isDirectory"]())) {
|
|
177
|
+
walkTestDirectory(resolved, files, seen);
|
|
178
|
+
} else {
|
|
179
|
+
((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.Error)((String("unsupported test target: ") + String(raw))));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
((i = (i + 1)));
|
|
184
|
+
}
|
|
185
|
+
return (files)["sort"]();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function insideDirectory(parent, child) {
|
|
189
|
+
{
|
|
190
|
+
let rel = relative(parent, child);
|
|
191
|
+
return ((rel === "") || ((!(rel === "..")) && (!__eliscript_truthy((rel)["startsWith"]((String("..") + String(sep)))))));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function commonRoot(paths) {
|
|
195
|
+
{
|
|
196
|
+
let current = dirname((paths)[0]);
|
|
197
|
+
let i = 1;
|
|
198
|
+
while (__eliscript_numeric_relation("<", i, ((paths) ?? []).length)) {
|
|
199
|
+
{
|
|
200
|
+
let candidate = (paths)[i];
|
|
201
|
+
while (!(__eliscript_truthy(insideDirectory(current, candidate)))) {
|
|
202
|
+
{
|
|
203
|
+
let parent = dirname(current);
|
|
204
|
+
if ((parent === current)) {
|
|
205
|
+
((__eliscript_value_9) => { throw __eliscript_value_9; })(new (globalThis.Error)("cannot determine common root directory"));
|
|
206
|
+
}
|
|
207
|
+
((current = parent));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
((i = (i + 1)));
|
|
212
|
+
}
|
|
213
|
+
return current;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function collectStdlibClosure(sourceFiles) {
|
|
217
|
+
{
|
|
218
|
+
let stdlibDir = realpathSync(resolve((__eliscript_tdz_ready_1 === true ? packageRoot : __eliscript_tdz_error("packageRoot")), "stdlib"));
|
|
219
|
+
let visited = new (globalThis.Set)();
|
|
220
|
+
let queue = [realpathSync(resolve(stdlibDir, "bit.eli")), realpathSync(resolve(stdlibDir, "test.eli"))];
|
|
221
|
+
let result = [];
|
|
222
|
+
{
|
|
223
|
+
let si = 0;
|
|
224
|
+
while (__eliscript_numeric_relation("<", si, ((sourceFiles) ?? []).length)) {
|
|
225
|
+
{
|
|
226
|
+
let sf = (sourceFiles)[si];
|
|
227
|
+
let text = readFileSync(sf, "utf8");
|
|
228
|
+
let dir = dirname(sf);
|
|
229
|
+
let matches = Array.from((text)["matchAll"](new (globalThis.RegExp)(((__eliscript_tdz_ready_3 === true ? importPattern : __eliscript_tdz_error("importPattern")))["source"], "gu")));
|
|
230
|
+
let mi = 0;
|
|
231
|
+
while (__eliscript_numeric_relation("<", mi, ((matches) ?? []).length)) {
|
|
232
|
+
{
|
|
233
|
+
let spec = ((matches)[mi])[1];
|
|
234
|
+
if (((spec === "eliscript/core") || (spec === "eliscript/dist/stdlib/core.mjs"))) {
|
|
235
|
+
(queue)["push"](resolve(stdlibDir, "core.eli"));
|
|
236
|
+
} else {
|
|
237
|
+
if (__eliscript_truthy((spec)["includes"]("stdlib/"))) {
|
|
238
|
+
{
|
|
239
|
+
let idx = (spec)["indexOf"]("stdlib/");
|
|
240
|
+
let sub = (spec)["slice"]((idx + 7));
|
|
241
|
+
let eli_sub = (__eliscript_truthy((sub)["endsWith"](".mjs")) ? (String((sub)["slice"](0, -4)) + String(".eli")) : (__eliscript_truthy((sub)["endsWith"](".eli")) ? sub : (String(sub) + String(".eli"))));
|
|
242
|
+
let candidate = resolve(stdlibDir, eli_sub);
|
|
243
|
+
if (__eliscript_truthy(existsSync(candidate))) {
|
|
244
|
+
(queue)["push"](realpathSync(candidate));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
if ((__eliscript_truthy((spec)["startsWith"]("./")) || __eliscript_truthy((spec)["startsWith"]("../")))) {
|
|
249
|
+
{
|
|
250
|
+
let resolved = resolve(dir, spec);
|
|
251
|
+
let eli_candidate = (__eliscript_truthy((resolved)["endsWith"](".mjs")) ? (String((resolved)["slice"](0, -4)) + String(".eli")) : (__eliscript_truthy((resolved)["endsWith"](".eli")) ? resolved : null));
|
|
252
|
+
if ((!((eli_candidate === null)) && __eliscript_truthy(insideDirectory(stdlibDir, eli_candidate)) && __eliscript_truthy(existsSync(eli_candidate)))) {
|
|
253
|
+
(queue)["push"](realpathSync(eli_candidate));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
((mi = (mi + 1)));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
((si = (si + 1)));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
while (__eliscript_numeric_relation(">", ((queue) ?? []).length, 0)) {
|
|
269
|
+
{
|
|
270
|
+
let next_file = realpathSync((queue)["shift"]());
|
|
271
|
+
if ((!(__eliscript_truthy((visited)["has"](next_file)) || !(__eliscript_truthy(insideDirectory(stdlibDir, next_file)))))) {
|
|
272
|
+
(visited)["add"](next_file);
|
|
273
|
+
(result)["push"](next_file);
|
|
274
|
+
{
|
|
275
|
+
let text = readFileSync(next_file, "utf8");
|
|
276
|
+
let dir = dirname(next_file);
|
|
277
|
+
let matches = Array.from((text)["matchAll"](new (globalThis.RegExp)(((__eliscript_tdz_ready_3 === true ? importPattern : __eliscript_tdz_error("importPattern")))["source"], "gu")));
|
|
278
|
+
let mi = 0;
|
|
279
|
+
while (__eliscript_numeric_relation("<", mi, ((matches) ?? []).length)) {
|
|
280
|
+
{
|
|
281
|
+
let spec = ((matches)[mi])[1];
|
|
282
|
+
if ((__eliscript_truthy((spec)["startsWith"]("./")) || __eliscript_truthy((spec)["startsWith"]("../")))) {
|
|
283
|
+
{
|
|
284
|
+
let resolved = resolve(dir, spec);
|
|
285
|
+
let eli_candidate = (__eliscript_truthy((resolved)["endsWith"](".mjs")) ? (String((resolved)["slice"](0, -4)) + String(".eli")) : (__eliscript_truthy((resolved)["endsWith"](".eli")) ? resolved : null));
|
|
286
|
+
if ((!((eli_candidate === null)) && __eliscript_truthy(insideDirectory(stdlibDir, eli_candidate)) && __eliscript_truthy(existsSync(eli_candidate)))) {
|
|
287
|
+
(queue)["push"](realpathSync(eli_candidate));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
((mi = (mi + 1)));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return (result)["sort"]();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
async function runTestFiles(files, options = null) {
|
|
302
|
+
if ((((files) ?? []).length === 0)) {
|
|
303
|
+
((__eliscript_value_10) => { throw __eliscript_value_10; })(new (globalThis.Error)("no matching .test.eli files found"));
|
|
304
|
+
}
|
|
305
|
+
return (await (async (opts) => {
|
|
306
|
+
return (await (async (hasCustomCompiler) => {
|
|
307
|
+
return (await (async (canonPackageRoot) => {
|
|
308
|
+
return (await (async (stdlibDir) => {
|
|
309
|
+
return (await (async (allUnderPackage) => {
|
|
310
|
+
return (await (async (projectRoot) => {
|
|
311
|
+
return (await (async (tempDir) => {
|
|
312
|
+
return (await (async (stdlibOutDir) => {
|
|
313
|
+
return (await (async (stdlibEntries) => {
|
|
314
|
+
return (await (async (baseBuildOpts) => {
|
|
315
|
+
return (await (async () => {
|
|
316
|
+
try {
|
|
317
|
+
return (await (async () => {
|
|
318
|
+
await (buildProject(Object.assign(({"entries": stdlibEntries, "root": stdlibDir, "outDir": stdlibOutDir}), baseBuildOpts)));
|
|
319
|
+
await (buildProject(Object.assign(({"entries": files, "root": projectRoot, "outDir": tempDir}), baseBuildOpts)));
|
|
320
|
+
{
|
|
321
|
+
let runtimeLink = resolve(tempDir, "runtime");
|
|
322
|
+
if ((!__eliscript_truthy(existsSync(runtimeLink)))) {
|
|
323
|
+
symlinkSync(resolve(canonPackageRoot, "runtime"), runtimeLink, "dir");
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return (await (async (testLibUrl) => {
|
|
327
|
+
return (await (async (testLib) => {
|
|
328
|
+
return (await (async () => {
|
|
329
|
+
(testLib)["clear_tests_BANG_"]();
|
|
330
|
+
(await (async (i) => {
|
|
331
|
+
return (await (async () => {
|
|
332
|
+
while (__eliscript_numeric_relation("<", i, ((files) ?? []).length)) {
|
|
333
|
+
(await (async (srcFile) => {
|
|
334
|
+
return (await (async (rel) => {
|
|
335
|
+
return (await (async (compiledPath) => {
|
|
336
|
+
return await ((__eliscript_tdz_ready_4 === true ? dynamicImport : __eliscript_tdz_error("dynamicImport"))((pathToFileURL(compiledPath))["href"]));
|
|
337
|
+
})(resolve(tempDir, (String((rel)["slice"](0, -4)) + String(".mjs")))));
|
|
338
|
+
})(relative(projectRoot, srcFile)));
|
|
339
|
+
})((files)[i]));
|
|
340
|
+
((i = (i + 1)));
|
|
341
|
+
}
|
|
342
|
+
return null;
|
|
343
|
+
})());
|
|
344
|
+
})(0));
|
|
345
|
+
return (await (async (runOpts) => {
|
|
346
|
+
return ((report) => {
|
|
347
|
+
return ({"report": report, "summary": (testLib)["test_summary"](report), "textReport": (testLib)["test_report"](report)});
|
|
348
|
+
})(await ((testLib)["run_all_tests"](runOpts)));
|
|
349
|
+
})(({"filter": (opts)["filter"], "tag": (opts)["tag"], "seed": (opts)["seed"], "failFast": (opts)["failFast"], "file": ((((files) ?? []).length === 1) ? relative(projectRoot, (files)[0]) : null)})));
|
|
350
|
+
})());
|
|
351
|
+
})(await ((__eliscript_tdz_ready_4 === true ? dynamicImport : __eliscript_tdz_error("dynamicImport"))(testLibUrl))));
|
|
352
|
+
})((pathToFileURL(resolve(stdlibOutDir, "test.mjs")))["href"]));
|
|
353
|
+
})());
|
|
354
|
+
} finally {
|
|
355
|
+
rmSync(tempDir, ({"recursive": true, "force": true}));
|
|
356
|
+
}
|
|
357
|
+
})());
|
|
358
|
+
})((__eliscript_truthy(hasCustomCompiler) ? ({"compiler": (opts)["compiler"], "compilerDigest": (opts)["compilerDigest"], "useCache": false}) : ({"moduleDirectory": (opts)["moduleDirectory"], "useCache": false}))));
|
|
359
|
+
})(collectStdlibClosure(files)));
|
|
360
|
+
})(resolve(tempDir, "stdlib")));
|
|
361
|
+
})(realpathSync(mkdtempSync((__eliscript_truthy(allUnderPackage) ? resolve(canonPackageRoot, ".eliscript-test.") : join(tmpdir(), "eliscript-test-runner-"))))));
|
|
362
|
+
})((!(((opts)["root"] === undefined)) ? realpathSync(resolve((opts)["root"])) : (__eliscript_truthy(allUnderPackage) ? canonPackageRoot : commonRoot(files)))));
|
|
363
|
+
})((files)["every"](((f) => {
|
|
364
|
+
return insideDirectory(canonPackageRoot, f);
|
|
365
|
+
}))));
|
|
366
|
+
})(resolve(canonPackageRoot, "stdlib")));
|
|
367
|
+
})(realpathSync((__eliscript_tdz_ready_1 === true ? packageRoot : __eliscript_tdz_error("packageRoot")))));
|
|
368
|
+
})((!((opts)["compiler"] == null))));
|
|
369
|
+
})(((options === undefined) ? ({}) : options)));
|
|
370
|
+
}
|
|
371
|
+
async function runWatchLoop(files, parsed, actual_options) {
|
|
372
|
+
return (await (async (mtimes, stopped, stop) => {
|
|
373
|
+
{
|
|
374
|
+
let i = 0;
|
|
375
|
+
while (__eliscript_numeric_relation("<", i, ((files) ?? []).length)) {
|
|
376
|
+
{
|
|
377
|
+
let f = (files)[i];
|
|
378
|
+
(mtimes)["set"](f, (statSync(f))["mtimeMs"]);
|
|
379
|
+
}
|
|
380
|
+
((i = (i + 1)));
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return (await (async (handleSignal) => {
|
|
384
|
+
(globalThis.process)["once"]("SIGINT", handleSignal);
|
|
385
|
+
(globalThis.process)["once"]("SIGTERM", handleSignal);
|
|
386
|
+
return (await (async () => {
|
|
387
|
+
try {
|
|
388
|
+
return (await (async () => {
|
|
389
|
+
while (!(__eliscript_truthy(stopped))) {
|
|
390
|
+
((out) => {
|
|
391
|
+
((globalThis.process)["stdout"])["write"]((__eliscript_truthy((parsed)["json"]) ? (String(JSON.stringify((out)["report"])) + String("\n")) : (out)["textReport"]));
|
|
392
|
+
if ((!__eliscript_truthy(((out)["report"])["passed"]))) {
|
|
393
|
+
return ((globalThis.process)["exitCode"] = 1);
|
|
394
|
+
} else {
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
})(await (runTestFiles(files, ({"root": (parsed)["root"], "filter": (parsed)["filter"], "tag": (parsed)["tag"], "seed": (parsed)["seed"], "failFast": (parsed)["failFast"], "moduleDirectory": (actual_options)["moduleDirectory"]}))));
|
|
398
|
+
(await (async (changed) => {
|
|
399
|
+
return (await (async () => {
|
|
400
|
+
while ((!(__eliscript_truthy(stopped)) && !(__eliscript_truthy(changed)))) {
|
|
401
|
+
await (new (globalThis.Promise)(((r) => {
|
|
402
|
+
((stop = r));
|
|
403
|
+
return globalThis.setTimeout(r, 300);
|
|
404
|
+
})));
|
|
405
|
+
{
|
|
406
|
+
let j = 0;
|
|
407
|
+
while (__eliscript_numeric_relation("<", j, ((files) ?? []).length)) {
|
|
408
|
+
{
|
|
409
|
+
let f = (files)[j];
|
|
410
|
+
let cur = (__eliscript_truthy(existsSync(f)) ? (statSync(f))["mtimeMs"] : 0);
|
|
411
|
+
if (!((cur === (mtimes)["get"](f)))) {
|
|
412
|
+
(mtimes)["set"](f, cur);
|
|
413
|
+
((changed = true));
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
((j = (j + 1)));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return null;
|
|
421
|
+
})());
|
|
422
|
+
})(false));
|
|
423
|
+
}
|
|
424
|
+
return null;
|
|
425
|
+
})());
|
|
426
|
+
} finally {
|
|
427
|
+
(globalThis.process)["removeListener"]("SIGINT", handleSignal);
|
|
428
|
+
(globalThis.process)["removeListener"]("SIGTERM", handleSignal);
|
|
429
|
+
}
|
|
430
|
+
})());
|
|
431
|
+
})((() => {
|
|
432
|
+
((stopped = true));
|
|
433
|
+
if (__eliscript_truthy(stop)) {
|
|
434
|
+
return stop();
|
|
435
|
+
} else {
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
})));
|
|
439
|
+
})(new (globalThis.Map)(), false, null));
|
|
440
|
+
}
|
|
441
|
+
async function execute(arguments_, ...__opt) {
|
|
442
|
+
return (await (async (options) => {
|
|
443
|
+
return (await (async (actual_options) => {
|
|
444
|
+
return (await (async (parsed) => {
|
|
445
|
+
return (__eliscript_truthy((parsed)["help"]) ? ({"help": true}) : (await (async (files) => {
|
|
446
|
+
return (__eliscript_truthy((parsed)["watch"]) ? (await (async () => {
|
|
447
|
+
await (runWatchLoop(files, parsed, actual_options));
|
|
448
|
+
return ({"help": false, "watched": true});
|
|
449
|
+
})()) : ((out) => {
|
|
450
|
+
return ({"help": false, "json": (parsed)["json"], "report": (out)["report"], "textReport": (out)["textReport"]});
|
|
451
|
+
})(await (runTestFiles(files, ({"root": (parsed)["root"], "filter": (parsed)["filter"], "tag": (parsed)["tag"], "seed": (parsed)["seed"], "failFast": (parsed)["failFast"], "compiler": (actual_options)["compiler"], "moduleDirectory": (actual_options)["moduleDirectory"]})))));
|
|
452
|
+
})(discoverTestFiles((parsed)["targets"], (parsed)["root"]))));
|
|
453
|
+
})(parseArguments(arguments_)));
|
|
454
|
+
})(((options === undefined) ? ({}) : options)));
|
|
455
|
+
})((__opt)[0]));
|
|
456
|
+
}
|
|
457
|
+
async function main(...__opt) {
|
|
458
|
+
return (await (async (arguments_) => {
|
|
459
|
+
return (await (async (actual_args) => {
|
|
460
|
+
return ((result) => {
|
|
461
|
+
return (__eliscript_truthy((result)["help"]) ? ((globalThis.process)["stdout"])["write"]((__eliscript_tdz_ready_5 === true ? usage : __eliscript_tdz_error("usage"))) : ((!__eliscript_truthy((result)["watched"])) ? (() => {
|
|
462
|
+
((globalThis.process)["stdout"])["write"]((__eliscript_truthy((result)["json"]) ? (String(JSON.stringify((result)["report"])) + String("\n")) : (result)["textReport"]));
|
|
463
|
+
if ((!__eliscript_truthy(((result)["report"])["passed"]))) {
|
|
464
|
+
return ((globalThis.process)["exitCode"] = 1);
|
|
465
|
+
} else {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
})() : null));
|
|
469
|
+
})(await (execute(actual_args)));
|
|
470
|
+
})(((arguments_ === undefined) ? ((globalThis.process)["argv"])["slice"](2) : arguments_)));
|
|
471
|
+
})((__opt)[0]));
|
|
472
|
+
}
|
|
473
|
+
((entry) => {
|
|
474
|
+
if ((!((entry === undefined)) && (resolve(entry) === fileURLToPath(import.meta.url)))) {
|
|
475
|
+
{
|
|
476
|
+
let outputFormat = requestedDiagnosticFormat(((globalThis.process)["argv"])["slice"](2));
|
|
477
|
+
return (main())["catch"](((error) => {
|
|
478
|
+
{
|
|
479
|
+
let diagnostic = diagnosticFromError(error);
|
|
480
|
+
if ((outputFormat === "json")) {
|
|
481
|
+
console.error(JSON.stringify(diagnostic));
|
|
482
|
+
} else {
|
|
483
|
+
console.error((String("eliscript-test: ") + String(renderDiagnostic(diagnostic))));
|
|
484
|
+
}
|
|
485
|
+
return ((globalThis.process)["exitCode"] = 1);
|
|
486
|
+
}
|
|
487
|
+
}));
|
|
488
|
+
}
|
|
489
|
+
} else {
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
})(((globalThis.process)["argv"])[1]);
|
|
493
|
+
export {discoverTestFiles, execute, main, parseArguments, runTestFiles};
|
|
494
|
+
//# sourceMappingURL=test-cli.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-cli.mjs","sources":["test-cli.eli"],"sourcesContent":["(module bootstrap.host.test-cli\n (import \"node:fs\" existsSync mkdtempSync readdirSync readFileSync realpathSync rmSync statSync symlinkSync)\n (import \"node:os\" tmpdir)\n (import \"node:path\" dirname join relative resolve sep)\n (import \"node:url\" fileURLToPath pathToFileURL)\n (import \"./bun.mjs\"\n diagnosticFromError renderDiagnostic requestedDiagnosticFormat)\n (import \"./project.mjs\" buildProject)\n\n (defconst here (dirname (fileURLToPath (js* \"import.meta.url\"))))\n (defconst packageRoot (resolve here \"../..\"))\n (defconst digitsPattern (new globalThis.RegExp \"^[0-9]+$\" \"u\"))\n (defconst importPattern (new globalThis.RegExp \"\\\\(import(?:-portable)?\\\\s+\\\"([^\\\"]+)\\\"\" \"gu\"))\n (defconst dynamicImport (js* \"(url) => import(url)\"))\n\n (defconst usage\n (str \"Usage: eliscript-test [OPTIONS] [TARGET ...]\\n\\n\"\n \"Options:\\n\"\n \" --filter PATTERN Run only tests whose names contain PATTERN\\n\"\n \" --tag TAG Run only tests matching TAG\\n\"\n \" --seed NUMBER Use deterministic seed metadata for test runs\\n\"\n \" --fail-fast Stop running tests after the first failure or error\\n\"\n \" --watch Re-run tests when matching .eli files change\\n\"\n \" --root DIR Set explicit project root for compiling test files\\n\"\n \" --json Emit structured JSON test report\\n\"\n \" -h, --help Show this help\\n\"))\n\n (defun parseArguments (arguments_)\n (let ((argumentsList (Array/from arguments_))\n (targets (js-array))\n (filter undefined)\n (tag undefined)\n (seed undefined)\n (failFast false)\n (watch false)\n (root undefined)\n (json false)\n (helpResult nil))\n (when (= (aref argumentsList 0) \"--\")\n (js-call argumentsList :shift))\n (while (and (nil? helpResult) (> (js-length argumentsList) 0))\n (let ((argument (js-call argumentsList :shift)))\n (cond\n ((or (= argument \"-h\") (= argument \"--help\"))\n (setq helpResult (js-object :help t)))\n ((= argument \"--filter\")\n (when (= (js-length argumentsList) 0)\n (throw (new globalThis.Error \"--filter requires a pattern\")))\n (setq filter (js-call argumentsList :shift)))\n ((= argument \"--tag\")\n (when (= (js-length argumentsList) 0)\n (throw (new globalThis.Error \"--tag requires a tag name\")))\n (setq tag (js-call argumentsList :shift)))\n ((= argument \"--seed\")\n (when (= (js-length argumentsList) 0)\n (throw (new globalThis.Error \"--seed requires an integer\")))\n (let ((text (js-call argumentsList :shift)))\n (unless (js-call digitsPattern :test text)\n (throw (new globalThis.Error \"--seed requires a non-negative integer\")))\n (setq seed (globalThis.Number text))))\n ((= argument \"--fail-fast\")\n (setq failFast t))\n ((= argument \"--watch\")\n (setq watch t))\n ((= argument \"--root\")\n (when (= (js-length argumentsList) 0)\n (throw (new globalThis.Error \"--root requires a directory\")))\n (setq root (js-call argumentsList :shift)))\n ((= argument \"--json\")\n (setq json t))\n ((js-call argument :startsWith \"-\")\n (throw (new globalThis.Error (str \"unknown option: \" argument))))\n (t\n (js-call targets :push argument)))))\n (if helpResult\n helpResult\n (js-object\n :targets targets\n :filter filter\n :tag tag\n :seed seed\n :failFast failFast\n :watch watch\n :root root\n :json json))))\n\n (defun walkTestDirectory (directory files seen)\n (let ((entries (js-call (readdirSync directory (js-object :withFileTypes t))\n :sort (lambda (a b)\n (if (< (get a :name) (get b :name))\n -1\n (if (> (get a :name) (get b :name)) 1 0)))))\n (i 0))\n (while (< i (js-length entries))\n (let* ((entry (aref entries i))\n (name (get entry :name))\n (full (join directory name)))\n (cond\n ((js-call entry :isDirectory)\n (unless (or (= name \"node_modules\")\n (= name \"dist\")\n (= name \".git\")\n (js-call name :startsWith \".eliscript-\"))\n (walkTestDirectory full files seen)))\n ((and (js-call entry :isFile) (js-call name :endsWith \".test.eli\"))\n (let ((canonical (realpathSync full)))\n (unless (js-call seen :has canonical)\n (js-call seen :add canonical)\n (js-call files :push canonical))))))\n (setq i (1+ i)))))\n\n (defun discoverTestFiles (targets &optional root)\n (let ((effective-targets (if (or (nullish? targets) (= (js-length targets) 0))\n (js-array (if (nullish? root) \"tests\" root))\n targets))\n (files (js-array))\n (seen (new globalThis.Set))\n (i 0))\n (while (< i (js-length effective-targets))\n (let* ((raw (aref effective-targets i))\n (resolved (resolve raw))\n (st (statSync resolved)))\n (cond\n ((js-call st :isFile)\n (unless (js-call resolved :endsWith \".eli\")\n (throw (new globalThis.Error (str \"test target must use .eli extension: \" raw))))\n (let ((canonical (realpathSync resolved)))\n (unless (js-call seen :has canonical)\n (js-call seen :add canonical)\n (js-call files :push canonical))))\n ((js-call st :isDirectory)\n (walkTestDirectory resolved files seen))\n (t\n (throw (new globalThis.Error (str \"unsupported test target: \" raw))))))\n (setq i (1+ i)))\n (js-call files :sort)))\n\n (defun insideDirectory (parent child)\n (let ((rel (relative parent child)))\n (or (= rel \"\")\n (and (not (= rel \"..\"))\n (not (js-call rel :startsWith (str \"..\" sep)))))))\n\n (defun commonRoot (paths)\n (let ((current (dirname (aref paths 0)))\n (i 1))\n (while (< i (js-length paths))\n (let ((candidate (aref paths i)))\n (while (not (insideDirectory current candidate))\n (let ((parent (dirname current)))\n (when (= parent current)\n (throw (new globalThis.Error \"cannot determine common root directory\")))\n (setq current parent))))\n (setq i (1+ i)))\n current))\n\n (defun collectStdlibClosure (sourceFiles)\n (let* ((stdlibDir (realpathSync (resolve packageRoot \"stdlib\")))\n (visited (new globalThis.Set))\n (queue (js-array\n (realpathSync (resolve stdlibDir \"bit.eli\"))\n (realpathSync (resolve stdlibDir \"test.eli\"))))\n (result (js-array)))\n (let ((si 0))\n (while (< si (js-length sourceFiles))\n (let* ((sf (aref sourceFiles si))\n (text (readFileSync sf \"utf8\"))\n (dir (dirname sf))\n (matches (Array/from (js-call text :matchAll (new globalThis.RegExp (get importPattern :source) \"gu\"))))\n (mi 0))\n (while (< mi (js-length matches))\n (let ((spec (aref (aref matches mi) 1)))\n (cond\n ((or (= spec \"eliscript/core\") (= spec \"eliscript/dist/stdlib/core.mjs\"))\n (js-call queue :push (resolve stdlibDir \"core.eli\")))\n ((js-call spec :includes \"stdlib/\")\n (let* ((idx (js-call spec :indexOf \"stdlib/\"))\n (sub (js-call spec :slice (+ idx 7)))\n (eli-sub (cond\n ((js-call sub :endsWith \".mjs\") (str (js-call sub :slice 0 -4) \".eli\"))\n ((js-call sub :endsWith \".eli\") sub)\n (t (str sub \".eli\"))))\n (candidate (resolve stdlibDir eli-sub)))\n (when (existsSync candidate)\n (js-call queue :push (realpathSync candidate)))))\n ((or (js-call spec :startsWith \"./\") (js-call spec :startsWith \"../\"))\n (let* ((resolved (resolve dir spec))\n (eli-candidate (cond\n ((js-call resolved :endsWith \".mjs\") (str (js-call resolved :slice 0 -4) \".eli\"))\n ((js-call resolved :endsWith \".eli\") resolved)\n (t nil))))\n (when (and (not (nil? eli-candidate))\n (insideDirectory stdlibDir eli-candidate)\n (existsSync eli-candidate))\n (js-call queue :push (realpathSync eli-candidate)))))))\n (setq mi (1+ mi))))\n (setq si (1+ si))))\n (while (> (js-length queue) 0)\n (let ((next-file (realpathSync (js-call queue :shift))))\n (unless (or (js-call visited :has next-file) (not (insideDirectory stdlibDir next-file)))\n (js-call visited :add next-file)\n (js-call result :push next-file)\n (let* ((text (readFileSync next-file \"utf8\"))\n (dir (dirname next-file))\n (matches (Array/from (js-call text :matchAll (new globalThis.RegExp (get importPattern :source) \"gu\"))))\n (mi 0))\n (while (< mi (js-length matches))\n (let ((spec (aref (aref matches mi) 1)))\n (when (or (js-call spec :startsWith \"./\") (js-call spec :startsWith \"../\"))\n (let* ((resolved (resolve dir spec))\n (eli-candidate (cond\n ((js-call resolved :endsWith \".mjs\") (str (js-call resolved :slice 0 -4) \".eli\"))\n ((js-call resolved :endsWith \".eli\") resolved)\n (t nil))))\n (when (and (not (nil? eli-candidate))\n (insideDirectory stdlibDir eli-candidate)\n (existsSync eli-candidate))\n (js-call queue :push (realpathSync eli-candidate))))))\n (setq mi (1+ mi)))))))\n (js-call result :sort)))\n\n (defasync runTestFiles (files &optional options)\n (when (= (js-length files) 0)\n (throw (new globalThis.Error \"no matching .test.eli files found\")))\n (let* ((opts (if (undefined? options) (js-object) options))\n (hasCustomCompiler (not (nullish? (get opts :compiler))))\n (canonPackageRoot (realpathSync packageRoot))\n (stdlibDir (resolve canonPackageRoot \"stdlib\"))\n (allUnderPackage (js-call files :every (lambda (f) (insideDirectory canonPackageRoot f))))\n (projectRoot (cond\n ((not (undefined? (get opts :root))) (realpathSync (resolve (get opts :root))))\n (allUnderPackage canonPackageRoot)\n (t (commonRoot files))))\n (tempDir (realpathSync\n (mkdtempSync\n (if allUnderPackage\n (resolve canonPackageRoot \".eliscript-test.\")\n (join (tmpdir) \"eliscript-test-runner-\")))))\n (stdlibOutDir (resolve tempDir \"stdlib\"))\n (stdlibEntries (collectStdlibClosure files))\n (baseBuildOpts (if hasCustomCompiler\n (js-object :compiler (get opts :compiler) :compilerDigest (get opts :compilerDigest) :useCache false)\n (js-object :moduleDirectory (get opts :moduleDirectory) :useCache false))))\n (try\n (progn\n (await (buildProject\n (Object/assign (js-object\n :entries stdlibEntries\n :root stdlibDir\n :outDir stdlibOutDir)\n baseBuildOpts)))\n (await (buildProject\n (Object/assign (js-object\n :entries files\n :root projectRoot\n :outDir tempDir)\n baseBuildOpts)))\n (let ((runtimeLink (resolve tempDir \"runtime\")))\n (unless (existsSync runtimeLink)\n (symlinkSync (resolve canonPackageRoot \"runtime\") runtimeLink \"dir\")))\n (let* ((testLibUrl (get (pathToFileURL (resolve stdlibOutDir \"test.mjs\")) :href))\n (testLib (await (funcall dynamicImport testLibUrl))))\n (js-call testLib :clear_tests_BANG_)\n (let ((i 0))\n (while (< i (js-length files))\n (let* ((srcFile (aref files i))\n (rel (relative projectRoot srcFile))\n (compiledPath (resolve tempDir (str (js-call rel :slice 0 -4) \".mjs\"))))\n (await (funcall dynamicImport (get (pathToFileURL compiledPath) :href))))\n (setq i (1+ i))))\n (let* ((runOpts (js-object\n :filter (get opts :filter)\n :tag (get opts :tag)\n :seed (get opts :seed)\n :failFast (get opts :failFast)\n :file (if (= (js-length files) 1) (relative projectRoot (aref files 0)) nil)))\n (report (await (js-call testLib :run_all_tests runOpts))))\n (js-object :report report :summary (js-call testLib :test_summary report)\n :textReport (js-call testLib :test_report report)))))\n (finally\n (rmSync tempDir (js-object :recursive t :force t))))))\n\n (defasync runWatchLoop (files parsed actual-options)\n (let ((mtimes (new globalThis.Map))\n (stopped false)\n (stop nil))\n (let ((i 0))\n (while (< i (js-length files))\n (let ((f (aref files i)))\n (js-call mtimes :set f (get (statSync f) :mtimeMs)))\n (setq i (1+ i))))\n (let ((handleSignal (lambda ()\n (setq stopped t)\n (when stop (funcall stop)))))\n (js-call globalThis.process :once \"SIGINT\" handleSignal)\n (js-call globalThis.process :once \"SIGTERM\" handleSignal)\n (try\n (while (not stopped)\n (let ((out (await (runTestFiles files\n (js-object\n :root (get parsed :root)\n :filter (get parsed :filter)\n :tag (get parsed :tag)\n :seed (get parsed :seed)\n :failFast (get parsed :failFast)\n :moduleDirectory (get actual-options :moduleDirectory))))))\n (js-call (get globalThis.process :stdout) :write\n (if (get parsed :json)\n (str (JSON/stringify (get out :report)) \"\\n\")\n (get out :textReport)))\n (unless (get (get out :report) :passed)\n (put globalThis.process :exitCode 1)))\n (let ((changed false))\n (while (and (not stopped) (not changed))\n (await (new globalThis.Promise (lambda (r) (setq stop r) (globalThis/setTimeout r 300))))\n (let ((j 0))\n (while (< j (js-length files))\n (let* ((f (aref files j))\n (cur (if (existsSync f) (get (statSync f) :mtimeMs) 0)))\n (when (not (= cur (js-call mtimes :get f)))\n (js-call mtimes :set f cur)\n (setq changed t)))\n (setq j (1+ j)))))))\n (finally\n (js-call globalThis.process :removeListener \"SIGINT\" handleSignal)\n (js-call globalThis.process :removeListener \"SIGTERM\" handleSignal))))))\n\n (defasync execute (arguments_ &rest __opt)\n (let* ((options (aref __opt 0))\n (actual-options (if (undefined? options) (js-object) options))\n (parsed (parseArguments arguments_)))\n (if (get parsed :help)\n (js-object :help t)\n (let ((files (discoverTestFiles (get parsed :targets) (get parsed :root))))\n (if (get parsed :watch)\n (progn\n (await (runWatchLoop files parsed actual-options))\n (js-object :help false :watched t))\n (let ((out (await (runTestFiles files\n (js-object\n :root (get parsed :root)\n :filter (get parsed :filter)\n :tag (get parsed :tag)\n :seed (get parsed :seed)\n :failFast (get parsed :failFast)\n :compiler (get actual-options :compiler)\n :moduleDirectory (get actual-options :moduleDirectory))))))\n (js-object :help false :json (get parsed :json)\n :report (get out :report) :textReport (get out :textReport))))))))\n\n (defasync main (&rest __opt)\n (let* ((arguments_ (aref __opt 0))\n (actual-args (if (undefined? arguments_)\n (js-call (get globalThis.process :argv) :slice 2)\n arguments_))\n (result (await (execute actual-args))))\n (if (get result :help)\n (js-call (get globalThis.process :stdout) :write usage)\n (unless (get result :watched)\n (js-call (get globalThis.process :stdout) :write\n (if (get result :json)\n (str (JSON/stringify (get result :report)) \"\\n\")\n (get result :textReport)))\n (unless (get (get result :report) :passed)\n (put globalThis.process :exitCode 1))))))\n\n (let ((entry (aref (get globalThis.process :argv) 1)))\n (when (and (not (undefined? entry))\n (= (resolve entry) (fileURLToPath (js* \"import.meta.url\"))))\n (let ((outputFormat (requestedDiagnosticFormat (js-call (get globalThis.process :argv) :slice 2))))\n (js-call (main) :catch\n (lambda (error)\n (let ((diagnostic (diagnosticFromError error)))\n (if (= outputFormat \"json\")\n (console/error (JSON/stringify diagnostic))\n (console/error (str \"eliscript-test: \" (renderDiagnostic diagnostic))))\n (put globalThis.process :exitCode 1)))))))\n\n (export discoverTestFiles execute main parseArguments runTestFiles))\n"],"names":[],"mappings":";;;;;;;;;;;AACE,QAAkB,YAAW,aAAY,aAAY,cAAa,cAAa,QAAO,UAAS;AAC/F,QAAkB;AAClB,QAAoB,SAAQ,MAAK,UAAS,SAAQ;AAClD,QAAmB,eAAc;AACjC,QACE,qBAAoB,kBAAiB;AACvC,QAAwB;AAExB,aAAgB,QAAS,cAAc;AACvC,oBAAuB,QAAQ,M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GED
|
@@ -31,3 +31,10 @@ Import `eliscript/browser` to compile single modules (`compileSource`,
|
|
|
31
31
|
Closure-style IR optimization (`optimizeProgramIr`), optional JavaScript
|
|
32
32
|
compaction (`optimizeJavaScript` / `{ minify: true }`), and extensionless
|
|
33
33
|
`eliscript/*` package subpath resolution.
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
All files in `browser/` (and materialized `dist/browser/` outputs) are governed
|
|
38
|
+
by `GPL-3.0-or-later` ([`../LICENSE`](../LICENSE)) **with the Eliscript Runtime
|
|
39
|
+
Library Exception** ([`../COPYING.RUNTIME`](../COPYING.RUNTIME)) under Section 7
|
|
40
|
+
of the GNU GPLv3.
|
package/browser/host.mjs
CHANGED
|
@@ -1077,18 +1077,14 @@ function compileProject(request) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
{
|
|
1079
1079
|
let program = null;
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
return optimizeProgramIr(program);
|
|
1085
|
-
} else {
|
|
1086
|
-
return null;
|
|
1087
|
-
}
|
|
1088
|
-
} catch (error) {
|
|
1089
|
-
return ((__eliscript_value_16) => { throw __eliscript_value_16; })(new ((__eliscript_tdz_ready_8 === true ? BrowserCompileError : __eliscript_tdz_error("BrowserCompileError")))([diagnosticOf(error, id)]));
|
|
1080
|
+
try {
|
|
1081
|
+
((program = compile_ir_string((files)[id], id, macroContext)));
|
|
1082
|
+
if ((!(optimize === false))) {
|
|
1083
|
+
optimizeProgramIr(program);
|
|
1090
1084
|
}
|
|
1091
|
-
}
|
|
1085
|
+
} catch (error) {
|
|
1086
|
+
((__eliscript_value_16) => { throw __eliscript_value_16; })(new ((__eliscript_tdz_ready_8 === true ? BrowserCompileError : __eliscript_tdz_error("BrowserCompileError")))([diagnosticOf(error, id)]));
|
|
1087
|
+
}
|
|
1092
1088
|
(programs)["set"](id, program);
|
|
1093
1089
|
return program;
|
|
1094
1090
|
}
|
|
@@ -1271,26 +1267,22 @@ function scriptFilename(script, index) {
|
|
|
1271
1267
|
{
|
|
1272
1268
|
let found = null;
|
|
1273
1269
|
if ((!((script == null)) && (host_typeof((script)["src"]) === "string") && __eliscript_numeric_relation(">", (((script)["src"]) ?? []).length, 0))) {
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
return ((found = tail));
|
|
1286
|
-
} else {
|
|
1287
|
-
return null;
|
|
1288
|
-
}
|
|
1270
|
+
try {
|
|
1271
|
+
{
|
|
1272
|
+
let loc = globalThis.location;
|
|
1273
|
+
let base = (((loc == null) || ((loc)["href"] == null)) ? "http://localhost/" : (loc)["href"]);
|
|
1274
|
+
let url = new (globalThis.URL)((script)["src"], base);
|
|
1275
|
+
let segments = (((url)["pathname"])["split"]("/"))["filter"](((part) => {
|
|
1276
|
+
return __eliscript_numeric_relation(">", ((part) ?? []).length, 0);
|
|
1277
|
+
}));
|
|
1278
|
+
let tail = (segments)["pop"]();
|
|
1279
|
+
if ((__eliscript_truthy(tail) && __eliscript_truthy((tail)["endsWith"]((__eliscript_tdz_ready_2 === true ? SOURCE_EXTENSION : __eliscript_tdz_error("SOURCE_EXTENSION")))))) {
|
|
1280
|
+
((found = tail));
|
|
1289
1281
|
}
|
|
1290
|
-
} catch (err) {
|
|
1291
|
-
return null;
|
|
1292
1282
|
}
|
|
1293
|
-
}
|
|
1283
|
+
} catch (err) {
|
|
1284
|
+
null;
|
|
1285
|
+
}
|
|
1294
1286
|
}
|
|
1295
1287
|
if (__eliscript_truthy(found)) {
|
|
1296
1288
|
return found;
|