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
|
@@ -4,6 +4,8 @@ var __eliscript_tdz_ready_0;
|
|
|
4
4
|
var __eliscript_tdz_ready_1;
|
|
5
5
|
var __eliscript_tdz_ready_2;
|
|
6
6
|
var __eliscript_tdz_ready_3;
|
|
7
|
+
var __eliscript_tdz_ready_4;
|
|
8
|
+
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("cachedCoreBarrelExportMap"); return (cachedCoreBarrelExportMap = __eliscript_tdz_value_4); }
|
|
7
9
|
import "eliscript/runtime/unicode-case.mjs";
|
|
8
10
|
import "eliscript/runtime/math.mjs";
|
|
9
11
|
import { __eliscript_at, __eliscript_at_direct, __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";
|
|
@@ -23,6 +25,8 @@ const hostDirectory = dirname(fileURLToPath(import.meta.url));
|
|
|
23
25
|
__eliscript_tdz_ready_2 = true;
|
|
24
26
|
const sha256_pattern = new (globalThis.RegExp)("^[0-9a-f]{64}$", "u");
|
|
25
27
|
__eliscript_tdz_ready_3 = true;
|
|
28
|
+
let cachedCoreBarrelExportMap = undefined;
|
|
29
|
+
__eliscript_tdz_ready_4 = true;
|
|
26
30
|
function host_typeof(value) {
|
|
27
31
|
return typeof value;
|
|
28
32
|
}
|
|
@@ -44,13 +48,11 @@ function canonicalDirectory(path, label) {
|
|
|
44
48
|
{
|
|
45
49
|
let expanded = resolve(path);
|
|
46
50
|
let attributes = null;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
})();
|
|
51
|
+
try {
|
|
52
|
+
((attributes = statSync(expanded)));
|
|
53
|
+
} catch (_err) {
|
|
54
|
+
projectError((String(label) + String(" is not a directory")), expanded);
|
|
55
|
+
}
|
|
54
56
|
if ((!__eliscript_truthy((attributes)["isDirectory"]()))) {
|
|
55
57
|
projectError((String(label) + String(" is not a directory")), expanded);
|
|
56
58
|
}
|
|
@@ -73,13 +75,11 @@ function canonicalSource(path, root, importer) {
|
|
|
73
75
|
{
|
|
74
76
|
let expanded = resolve(path);
|
|
75
77
|
let attributes = null;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
})();
|
|
78
|
+
try {
|
|
79
|
+
((attributes = statSync(expanded)));
|
|
80
|
+
} catch (_err) {
|
|
81
|
+
projectError((String("local Eliscript module does not exist: ") + String(path)), importer);
|
|
82
|
+
}
|
|
83
83
|
if ((!__eliscript_truthy((attributes)["isFile"]()))) {
|
|
84
84
|
projectError((String("local Eliscript module does not exist: ") + String(path)), importer);
|
|
85
85
|
}
|
|
@@ -96,13 +96,11 @@ function macroDependency(specifier, root, importer) {
|
|
|
96
96
|
{
|
|
97
97
|
let expanded = resolve(root, specifier);
|
|
98
98
|
let attributes = null;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
})();
|
|
99
|
+
try {
|
|
100
|
+
((attributes = statSync(expanded)));
|
|
101
|
+
} catch (_err) {
|
|
102
|
+
projectError((String("macro file dependency does not exist: ") + String(specifier)), importer);
|
|
103
|
+
}
|
|
106
104
|
if ((!__eliscript_truthy((attributes)["isFile"]()))) {
|
|
107
105
|
projectError((String("macro file dependency does not exist: ") + String(specifier)), importer);
|
|
108
106
|
}
|
|
@@ -114,13 +112,11 @@ function macroDependency(specifier, root, importer) {
|
|
|
114
112
|
{
|
|
115
113
|
let bytes = readFileSync(source);
|
|
116
114
|
let content = null;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
})();
|
|
115
|
+
try {
|
|
116
|
+
((content = (new (globalThis.TextDecoder)("utf-8", ({"fatal": true})))["decode"](bytes)));
|
|
117
|
+
} catch (_err) {
|
|
118
|
+
projectError((String("macro file dependency is not valid UTF-8: ") + String(specifier)), importer);
|
|
119
|
+
}
|
|
124
120
|
return ({"specifier": specifier, "source": source, "digest": ((createHash("sha256"))["update"](bytes))["digest"]("hex"), "content": content});
|
|
125
121
|
}
|
|
126
122
|
}
|
|
@@ -160,56 +156,50 @@ function physicalWritePath(path) {
|
|
|
160
156
|
let cursor = resolve(path);
|
|
161
157
|
let resolved = null;
|
|
162
158
|
while ((resolved === null)) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
((
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
} catch (_err) {
|
|
172
|
-
return projectError((String("generated artifact contains an unresolved symlink: ") + String(expanded)));
|
|
173
|
-
}
|
|
174
|
-
})();
|
|
175
|
-
return ((resolved = __eliscript_at(resolve, "apply")(null, ([canonical])["concat"]((Array.from(suffix))["reverse"]()))));
|
|
176
|
-
}
|
|
177
|
-
} catch (error) {
|
|
178
|
-
if ((__eliscript_truthy(error) && __eliscript_truthy((error)["eliscriptDiagnostic"]))) {
|
|
179
|
-
((__eliscript_value_2) => { throw __eliscript_value_2; })(error);
|
|
159
|
+
try {
|
|
160
|
+
lstatSync(cursor);
|
|
161
|
+
{
|
|
162
|
+
let canonical = null;
|
|
163
|
+
try {
|
|
164
|
+
((canonical = realpathSync(cursor)));
|
|
165
|
+
} catch (_err) {
|
|
166
|
+
projectError((String("generated artifact contains an unresolved symlink: ") + String(expanded)));
|
|
180
167
|
}
|
|
181
|
-
|
|
168
|
+
((resolved = __eliscript_at(resolve, "apply")(null, ([canonical])["concat"]((Array.from(suffix))["reverse"]()))));
|
|
169
|
+
}
|
|
170
|
+
} catch (error) {
|
|
171
|
+
if ((__eliscript_truthy(error) && __eliscript_truthy((error)["eliscriptDiagnostic"]))) {
|
|
172
|
+
((__eliscript_value_2) => { throw __eliscript_value_2; })(error);
|
|
173
|
+
}
|
|
174
|
+
if ((!((__eliscript_truthy(error) ? (error)["code"] : null) === "ENOENT"))) {
|
|
175
|
+
projectError((String("generated artifact path cannot be resolved: ") + String(expanded)));
|
|
176
|
+
}
|
|
177
|
+
{
|
|
178
|
+
let parent = dirname(cursor);
|
|
179
|
+
if ((parent === cursor)) {
|
|
182
180
|
projectError((String("generated artifact path cannot be resolved: ") + String(expanded)));
|
|
183
181
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if ((parent === cursor)) {
|
|
187
|
-
projectError((String("generated artifact path cannot be resolved: ") + String(expanded)));
|
|
188
|
-
}
|
|
189
|
-
(suffix)["push"](basename(cursor));
|
|
190
|
-
return ((cursor = parent));
|
|
191
|
-
}
|
|
182
|
+
(suffix)["push"](basename(cursor));
|
|
183
|
+
((cursor = parent));
|
|
192
184
|
}
|
|
193
|
-
}
|
|
185
|
+
}
|
|
194
186
|
}
|
|
195
187
|
return resolved;
|
|
196
188
|
}
|
|
197
189
|
}
|
|
198
190
|
function existingFileIdentity(path) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
191
|
+
try {
|
|
192
|
+
{
|
|
193
|
+
let attributes = statSync(path);
|
|
194
|
+
if (__eliscript_truthy((attributes)["isFile"]())) {
|
|
195
|
+
return (String((attributes)["dev"]) + String(":") + String((attributes)["ino"]));
|
|
196
|
+
} else {
|
|
197
|
+
return null;
|
|
208
198
|
}
|
|
209
|
-
} catch (_err) {
|
|
210
|
-
return null;
|
|
211
199
|
}
|
|
212
|
-
}
|
|
200
|
+
} catch (_err) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
213
203
|
}
|
|
214
204
|
function validateOutputIsolation(options) {
|
|
215
205
|
{
|
|
@@ -349,17 +339,15 @@ function digestFile(filename) {
|
|
|
349
339
|
return digestBytes(readFileSync(filename));
|
|
350
340
|
}
|
|
351
341
|
function regularFile(filename) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
return ((__eliscript_value_5) => { throw __eliscript_value_5; })(error);
|
|
360
|
-
}
|
|
342
|
+
try {
|
|
343
|
+
return (statSync(filename))["isFile"]();
|
|
344
|
+
} catch (error) {
|
|
345
|
+
if (((__eliscript_truthy(error) ? (error)["code"] : null) === "ENOENT")) {
|
|
346
|
+
return false;
|
|
347
|
+
} else {
|
|
348
|
+
return ((__eliscript_value_5) => { throw __eliscript_value_5; })(error);
|
|
361
349
|
}
|
|
362
|
-
}
|
|
350
|
+
}
|
|
363
351
|
}
|
|
364
352
|
function compilerModuleDirectory(moduleDirectory) {
|
|
365
353
|
return resolve(((!((moduleDirectory === null)) && !((moduleDirectory === undefined))) ? moduleDirectory : ((env_dir) => {
|
|
@@ -519,20 +507,18 @@ function readCache(options) {
|
|
|
519
507
|
if (!(__eliscript_truthy(regularFile(manifestPath)))) {
|
|
520
508
|
return (compiler)["project_cache_lookup"](({"enabled": true, "manifestStatus": "missing"}));
|
|
521
509
|
} else {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
return (
|
|
529
|
-
|
|
530
|
-
})), "graphDigestValid": ((__eliscript_truthy(manifest) ? (manifest)["digest"] : undefined) === digestBytes(JSON.stringify(graphIdentity))), "cacheDigestValid": ((!(privateIdentity === undefined)) && (((__eliscript_truthy(manifest) && __eliscript_truthy((manifest)["cache"])) ? ((manifest)["cache"])["digest"] : undefined) === digestBytes(JSON.stringify(privateIdentity)))), "compilerDigest": compilerDigest, "mode": mode, "portableEntries": portableEntries}));
|
|
531
|
-
}
|
|
532
|
-
} catch (_err) {
|
|
533
|
-
return (compiler)["project_cache_lookup"](({"enabled": true, "manifestStatus": "unreadable"}));
|
|
510
|
+
try {
|
|
511
|
+
{
|
|
512
|
+
let manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
513
|
+
let graphIdentity = ({"format": (__eliscript_truthy(manifest) ? (manifest)["format"] : undefined), "entries": (__eliscript_truthy(manifest) ? (manifest)["entries"] : undefined), "modules": (__eliscript_truthy(manifest) ? (manifest)["modules"] : undefined)});
|
|
514
|
+
let privateIdentity = cacheIdentity((__eliscript_truthy(manifest) ? (manifest)["cache"] : undefined));
|
|
515
|
+
return (compiler)["project_cache_lookup"](({"enabled": true, "manifestStatus": "readable", "manifest": manifest, "expectedEntries": (entryOutputs)["map"](((entryOutput) => {
|
|
516
|
+
return relative(outDir, entryOutput);
|
|
517
|
+
})), "graphDigestValid": ((__eliscript_truthy(manifest) ? (manifest)["digest"] : undefined) === digestBytes(JSON.stringify(graphIdentity))), "cacheDigestValid": ((!(privateIdentity === undefined)) && (((__eliscript_truthy(manifest) && __eliscript_truthy((manifest)["cache"])) ? ((manifest)["cache"])["digest"] : undefined) === digestBytes(JSON.stringify(privateIdentity)))), "compilerDigest": compilerDigest, "mode": mode, "portableEntries": portableEntries}));
|
|
534
518
|
}
|
|
535
|
-
}
|
|
519
|
+
} catch (_err) {
|
|
520
|
+
return (compiler)["project_cache_lookup"](({"enabled": true, "manifestStatus": "unreadable"}));
|
|
521
|
+
}
|
|
536
522
|
}
|
|
537
523
|
}
|
|
538
524
|
}
|
|
@@ -562,47 +548,41 @@ function cachedModule(options) {
|
|
|
562
548
|
let outputExists = false;
|
|
563
549
|
let sourceMapExists = false;
|
|
564
550
|
let artifactFailure = undefined;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
((outputDigest = digestFile(output)));
|
|
572
|
-
}
|
|
573
|
-
if (__eliscript_truthy(sourceMapExists)) {
|
|
574
|
-
return ((sourceMapDigest = digestFile(sourceMap)));
|
|
575
|
-
} else {
|
|
576
|
-
return null;
|
|
577
|
-
}
|
|
578
|
-
} catch (_err) {
|
|
579
|
-
return ((artifactFailure = "artifact-unreadable"));
|
|
551
|
+
try {
|
|
552
|
+
((sourceDigest = digestFile(source)));
|
|
553
|
+
((outputExists = regularFile(output)));
|
|
554
|
+
((sourceMapExists = regularFile(sourceMap)));
|
|
555
|
+
if (__eliscript_truthy(outputExists)) {
|
|
556
|
+
((outputDigest = digestFile(output)));
|
|
580
557
|
}
|
|
581
|
-
|
|
558
|
+
if (__eliscript_truthy(sourceMapExists)) {
|
|
559
|
+
((sourceMapDigest = digestFile(sourceMap)));
|
|
560
|
+
}
|
|
561
|
+
} catch (_err) {
|
|
562
|
+
((artifactFailure = "artifact-unreadable"));
|
|
563
|
+
}
|
|
582
564
|
{
|
|
583
565
|
let dependencies = [];
|
|
584
566
|
let dependenciesValid = true;
|
|
585
567
|
let expectedMacroRecords = macroDependencyRecords(expectedMacroDependencies, root);
|
|
586
568
|
let macroDependenciesMatch = false;
|
|
587
|
-
|
|
588
|
-
|
|
569
|
+
try {
|
|
570
|
+
{
|
|
571
|
+
let metadata = (__eliscript_truthy(record) ? (record)["metadata"] : null);
|
|
572
|
+
if ((!(__eliscript_truthy(metadata)) || !(__eliscript_truthy(Array.isArray((metadata)["dependencies"]))) || !(__eliscript_truthy(Array.isArray((metadata)["portableEntries"]))))) {
|
|
573
|
+
((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("cache module metadata is invalid"));
|
|
574
|
+
}
|
|
575
|
+
((dependencies = ((metadata)["dependencies"])["map"](((dependency) => {
|
|
576
|
+
return canonicalSource(resolve(root, dependency), root, source);
|
|
577
|
+
}))));
|
|
589
578
|
{
|
|
590
|
-
let
|
|
591
|
-
|
|
592
|
-
((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("cache module metadata is invalid"));
|
|
593
|
-
}
|
|
594
|
-
((dependencies = ((metadata)["dependencies"])["map"](((dependency) => {
|
|
595
|
-
return canonicalSource(resolve(root, dependency), root, source);
|
|
596
|
-
}))));
|
|
597
|
-
{
|
|
598
|
-
let recordedMacroDependencies = ((((metadata)["macroDependencies"] === null) || ((metadata)["macroDependencies"] === undefined)) ? [] : (metadata)["macroDependencies"]);
|
|
599
|
-
return ((macroDependenciesMatch = (JSON.stringify(recordedMacroDependencies) === JSON.stringify(expectedMacroRecords))));
|
|
600
|
-
}
|
|
579
|
+
let recordedMacroDependencies = ((((metadata)["macroDependencies"] === null) || ((metadata)["macroDependencies"] === undefined)) ? [] : (metadata)["macroDependencies"]);
|
|
580
|
+
((macroDependenciesMatch = (JSON.stringify(recordedMacroDependencies) === JSON.stringify(expectedMacroRecords))));
|
|
601
581
|
}
|
|
602
|
-
} catch (_err) {
|
|
603
|
-
return ((dependenciesValid = false));
|
|
604
582
|
}
|
|
605
|
-
}
|
|
583
|
+
} catch (_err) {
|
|
584
|
+
((dependenciesValid = false));
|
|
585
|
+
}
|
|
606
586
|
{
|
|
607
587
|
let decision = (compiler)["project_cache_decision"](({"record": record, "output": relative(outDir, output), "sourceMap": relative(outDir, sourceMap), "expectedPortableEntries": expectedPortableEntries, "macroDependenciesMatch": macroDependenciesMatch, "sourceDigest": sourceDigest, "outputExists": outputExists, "sourceMapExists": sourceMapExists, "outputDigest": outputDigest, "sourceMapDigest": sourceMapDigest, "dependenciesValid": dependenciesValid, "artifactFailure": artifactFailure}));
|
|
608
588
|
return ({"decision": decision, "module": (__eliscript_truthy((decision)["reused"]) ? ({"source": source, "output": output, "sourceMap": sourceMap, "sourceDigest": sourceDigest, "outputDigest": outputDigest, "sourceMapDigest": sourceMapDigest, "dependencies": dependencies, "macroDependencies": expectedMacroDependencies, "portableEntries": Array.from(((record)["metadata"])["portableEntries"]), "reused": true, "reason": "verified"}) : undefined)});
|
|
@@ -610,27 +590,255 @@ function cachedModule(options) {
|
|
|
610
590
|
}
|
|
611
591
|
}
|
|
612
592
|
}
|
|
613
|
-
function
|
|
614
|
-
|
|
593
|
+
function loadCoreBarrelExportMap(compiler) {
|
|
594
|
+
if (((__eliscript_tdz_ready_4 === true ? cachedCoreBarrelExportMap : __eliscript_tdz_error("cachedCoreBarrelExportMap")) === undefined)) {
|
|
615
595
|
{
|
|
616
|
-
let
|
|
617
|
-
(
|
|
618
|
-
|
|
619
|
-
|
|
596
|
+
let corePath = resolve((__eliscript_tdz_ready_2 === true ? hostDirectory : __eliscript_tdz_error("hostDirectory")), "../../stdlib/core.eli");
|
|
597
|
+
(__eliscript_tdz_write_4((() => {
|
|
598
|
+
try {
|
|
599
|
+
{
|
|
600
|
+
let coreText = readFileSync(corePath, "utf8");
|
|
601
|
+
let coreProgram = (compiler)["compile_ir_string"](coreText, corePath);
|
|
602
|
+
let analyzed = (compiler)["analyze_pure_barrel"](coreProgram);
|
|
603
|
+
if (__eliscript_truthy(analyzed)) {
|
|
604
|
+
return analyzed;
|
|
605
|
+
} else {
|
|
606
|
+
return null;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
} catch (_err) {
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
})()));
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return (__eliscript_tdz_ready_4 === true ? cachedCoreBarrelExportMap : __eliscript_tdz_error("cachedCoreBarrelExportMap"));
|
|
616
|
+
}
|
|
617
|
+
function mergeDemand(requests, source, incoming) {
|
|
618
|
+
{
|
|
619
|
+
let existing = (requests)["get"](source);
|
|
620
|
+
if ((existing === "*")) {
|
|
621
|
+
return false;
|
|
622
|
+
} else {
|
|
623
|
+
if ((incoming === "*")) {
|
|
624
|
+
(requests)["set"](source, "*");
|
|
625
|
+
return true;
|
|
620
626
|
} else {
|
|
627
|
+
if ((existing === undefined)) {
|
|
628
|
+
{
|
|
629
|
+
let created = new (globalThis.Set)();
|
|
630
|
+
(incoming)["forEach"](((n) => {
|
|
631
|
+
return (created)["add"](n);
|
|
632
|
+
}));
|
|
633
|
+
(requests)["set"](source, created);
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
} else {
|
|
637
|
+
{
|
|
638
|
+
let changed = false;
|
|
639
|
+
(incoming)["forEach"](((n) => {
|
|
640
|
+
if ((!__eliscript_truthy((existing)["has"](n)))) {
|
|
641
|
+
(existing)["add"](n);
|
|
642
|
+
return ((changed = true));
|
|
643
|
+
} else {
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
}));
|
|
647
|
+
return changed;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
function standardPlan(compiler, entries, root, outDir, sourceCache, programCache, records, decisions, sourceOverrides, macroContext, macroDependencies, treeShake = null) {
|
|
655
|
+
if (!(__eliscript_truthy(treeShake))) {
|
|
656
|
+
return (compiler)["project_plan"](entries, ((source) => {
|
|
657
|
+
{
|
|
658
|
+
let cached = cachedModule(({"compiler": compiler, "source": source, "root": root, "outDir": outDir, "record": (records)["get"](relative(root, source)), "expectedPortableEntries": [], "expectedMacroDependencies": macroDependencies}));
|
|
659
|
+
(decisions)["set"](source, cached);
|
|
660
|
+
if (!(((cached)["module"] === undefined))) {
|
|
661
|
+
return ((cached)["module"])["dependencies"];
|
|
662
|
+
} else {
|
|
663
|
+
{
|
|
664
|
+
let overrideText = (sourceOverrides)["get"](source);
|
|
665
|
+
let sourceText = (!((overrideText === undefined)) ? overrideText : readFileSync(source, "utf8"));
|
|
666
|
+
let program = (compiler)["compile_ir_string"](sourceText, source, macroContext);
|
|
667
|
+
(sourceCache)["set"](source, sourceText);
|
|
668
|
+
(programCache)["set"](source, program);
|
|
669
|
+
return (projectImports(program, source, root, false))["map"](((imp) => {
|
|
670
|
+
return (imp)["dependency"];
|
|
671
|
+
}));
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}));
|
|
676
|
+
} else {
|
|
677
|
+
{
|
|
678
|
+
let coreExportMap = loadCoreBarrelExportMap(compiler);
|
|
679
|
+
let requests = new (globalThis.Map)();
|
|
680
|
+
let pending = new (globalThis.Set)();
|
|
681
|
+
let compiledRaw = new (globalThis.Map)();
|
|
682
|
+
let forceCompile = new (globalThis.Set)();
|
|
683
|
+
let recordMap = new (globalThis.Map)();
|
|
684
|
+
let iterations = 0;
|
|
685
|
+
(entries)["forEach"](((entry) => {
|
|
686
|
+
(requests)["set"](entry, "*");
|
|
687
|
+
return (pending)["add"](entry);
|
|
688
|
+
}));
|
|
689
|
+
while (__eliscript_numeric_relation(">", (pending)["size"], 0)) {
|
|
690
|
+
((iterations = (iterations + 1)));
|
|
691
|
+
if (__eliscript_numeric_relation(">", iterations, 10000)) {
|
|
692
|
+
projectError("project graph exceeded the planning iteration limit");
|
|
693
|
+
}
|
|
694
|
+
{
|
|
695
|
+
let ordered = (Array.from(pending))["sort"]();
|
|
696
|
+
let source = (ordered)[0];
|
|
697
|
+
(pending)["delete"](source);
|
|
698
|
+
{
|
|
699
|
+
let demand = (requests)["get"](source);
|
|
700
|
+
let existingDecision = (decisions)["get"](source);
|
|
701
|
+
let cached = (__eliscript_truthy((forceCompile)["has"](source)) ? undefined : ((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? __eliscript_value_9 : ((c) => {
|
|
702
|
+
(decisions)["set"](source, c);
|
|
703
|
+
return c;
|
|
704
|
+
})(cachedModule(({"compiler": compiler, "source": source, "root": root, "outDir": outDir, "record": (records)["get"](relative(root, source)), "expectedPortableEntries": [], "expectedMacroDependencies": macroDependencies})))))(existingDecision));
|
|
705
|
+
if ((__eliscript_truthy(cached) && !(((cached)["module"] === undefined)))) {
|
|
706
|
+
{
|
|
707
|
+
let deps = ((cached)["module"])["dependencies"];
|
|
708
|
+
let d_idx = 0;
|
|
709
|
+
(recordMap)["set"](source, Object.freeze(({"id": source, "dependencies": Object.freeze(deps)})));
|
|
710
|
+
while (__eliscript_numeric_relation("<", d_idx, ((deps) ?? []).length)) {
|
|
711
|
+
{
|
|
712
|
+
let dep = (deps)[d_idx];
|
|
713
|
+
if (__eliscript_truthy(mergeDemand(requests, dep, "*"))) {
|
|
714
|
+
if ((!__eliscript_truthy((recordMap)["has"](dep)))) {
|
|
715
|
+
(pending)["add"](dep);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
((d_idx = (d_idx + 1)));
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
} else {
|
|
723
|
+
{
|
|
724
|
+
let rawInfo = ((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? __eliscript_value_10 : ((overrideText) => {
|
|
725
|
+
return ((sourceText) => {
|
|
726
|
+
return ((parsedProgram) => {
|
|
727
|
+
return ((coreRewritten) => {
|
|
728
|
+
return ((barrelMap) => {
|
|
729
|
+
return ((info) => {
|
|
730
|
+
return (() => {
|
|
731
|
+
(sourceCache)["set"](source, sourceText);
|
|
732
|
+
(compiledRaw)["set"](source, info);
|
|
733
|
+
return info;
|
|
734
|
+
})();
|
|
735
|
+
})(({"sourceText": sourceText, "rawProgram": coreRewritten, "barrelMap": barrelMap}));
|
|
736
|
+
})((compiler)["analyze_pure_barrel"](coreRewritten));
|
|
737
|
+
})((__eliscript_truthy(coreExportMap) ? (compiler)["rewrite_package_barrel_imports"](parsedProgram, "eliscript/core", coreExportMap, "eliscript/") : parsedProgram));
|
|
738
|
+
})((compiler)["compile_ir_string"](sourceText, source, macroContext));
|
|
739
|
+
})((!((overrideText === undefined)) ? overrideText : readFileSync(source, "utf8")));
|
|
740
|
+
})((sourceOverrides)["get"](source))))((compiledRaw)["get"](source));
|
|
741
|
+
let effectiveProgram = ((__eliscript_truthy((rawInfo)["barrelMap"]) && !((demand === "*"))) ? (compiler)["prune_barrel_program"]((rawInfo)["rawProgram"], Array.from(demand)) : (rawInfo)["rawProgram"]);
|
|
742
|
+
let imports = projectImports(effectiveProgram, source, root, false);
|
|
743
|
+
let deps = (Array.from(new (globalThis.Set)((imports)["map"](((imp) => {
|
|
744
|
+
return (imp)["dependency"];
|
|
745
|
+
})))))["sort"]();
|
|
746
|
+
if (__eliscript_truthy((forceCompile)["has"](source))) {
|
|
747
|
+
(decisions)["set"](source, ({"decision": ({"reused": false, "reason": "barrel-demand-changed"}), "module": undefined}));
|
|
748
|
+
}
|
|
749
|
+
(programCache)["set"](source, effectiveProgram);
|
|
750
|
+
(recordMap)["set"](source, Object.freeze(({"id": source, "dependencies": Object.freeze(deps)})));
|
|
751
|
+
{
|
|
752
|
+
let i_idx = 0;
|
|
753
|
+
while (__eliscript_numeric_relation("<", i_idx, ((imports) ?? []).length)) {
|
|
754
|
+
{
|
|
755
|
+
let imp = (imports)[i_idx];
|
|
756
|
+
let dep = (imp)["dependency"];
|
|
757
|
+
let impNode = (imp)["node"];
|
|
758
|
+
let children = ((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? __eliscript_value_11 : []))((impNode)["children"]);
|
|
759
|
+
let allNamed = ((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? (children)["every"](((c) => {
|
|
760
|
+
return ((c)["kind"] === "import-named");
|
|
761
|
+
})) : __eliscript_value_12))(__eliscript_numeric_relation(">", ((children) ?? []).length, 0));
|
|
762
|
+
let childDemand = (__eliscript_truthy(allNamed) ? (children)["map"](((c) => {
|
|
763
|
+
return (c)["value"];
|
|
764
|
+
})) : "*");
|
|
765
|
+
{
|
|
766
|
+
let widened = mergeDemand(requests, dep, childDemand);
|
|
767
|
+
if (!(__eliscript_truthy((recordMap)["has"](dep)))) {
|
|
768
|
+
(pending)["add"](dep);
|
|
769
|
+
} else {
|
|
770
|
+
if (__eliscript_truthy(widened)) {
|
|
771
|
+
{
|
|
772
|
+
let depDecision = (decisions)["get"](dep);
|
|
773
|
+
if ((__eliscript_truthy(depDecision) && !(((depDecision)["module"] === undefined)))) {
|
|
774
|
+
{
|
|
775
|
+
let dOverride = (sourceOverrides)["get"](dep);
|
|
776
|
+
let dText = (!((dOverride === undefined)) ? dOverride : readFileSync(dep, "utf8"));
|
|
777
|
+
let dProg = (compiler)["compile_ir_string"](dText, dep, macroContext);
|
|
778
|
+
let dRewritten = (__eliscript_truthy(coreExportMap) ? (compiler)["rewrite_package_barrel_imports"](dProg, "eliscript/core", coreExportMap, "eliscript/") : dProg);
|
|
779
|
+
let dBarrel = (compiler)["analyze_pure_barrel"](dRewritten);
|
|
780
|
+
if (__eliscript_truthy(dBarrel)) {
|
|
781
|
+
(sourceCache)["set"](dep, dText);
|
|
782
|
+
(compiledRaw)["set"](dep, ({"sourceText": dText, "rawProgram": dRewritten, "barrelMap": dBarrel}));
|
|
783
|
+
(forceCompile)["add"](dep);
|
|
784
|
+
(pending)["add"](dep);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
} else {
|
|
788
|
+
{
|
|
789
|
+
let dRaw = (compiledRaw)["get"](dep);
|
|
790
|
+
if ((__eliscript_truthy(dRaw) && __eliscript_truthy((dRaw)["barrelMap"]))) {
|
|
791
|
+
(pending)["add"](dep);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
} else {
|
|
797
|
+
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
((i_idx = (i_idx + 1)));
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
{
|
|
811
|
+
let reachable = new (globalThis.Set)();
|
|
812
|
+
let walk = Array.from(entries);
|
|
813
|
+
while (__eliscript_numeric_relation(">", ((walk) ?? []).length, 0)) {
|
|
814
|
+
{
|
|
815
|
+
let cur = (walk)["pop"]();
|
|
816
|
+
if ((!__eliscript_truthy((reachable)["has"](cur)))) {
|
|
817
|
+
(reachable)["add"](cur);
|
|
818
|
+
{
|
|
819
|
+
let rec = (recordMap)["get"](cur);
|
|
820
|
+
if (__eliscript_truthy(rec)) {
|
|
821
|
+
((rec)["dependencies"])["forEach"](((d) => {
|
|
822
|
+
return (walk)["push"](d);
|
|
823
|
+
}));
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
621
829
|
{
|
|
622
|
-
let
|
|
623
|
-
let
|
|
624
|
-
let
|
|
625
|
-
(
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}));
|
|
830
|
+
let finalModules = [];
|
|
831
|
+
let keys = (Array.from(reachable))["sort"]();
|
|
832
|
+
let k_idx = 0;
|
|
833
|
+
while (__eliscript_numeric_relation("<", k_idx, ((keys) ?? []).length)) {
|
|
834
|
+
(finalModules)["push"]((recordMap)["get"]((keys)[k_idx]));
|
|
835
|
+
((k_idx = (k_idx + 1)));
|
|
836
|
+
}
|
|
837
|
+
return Object.freeze(({"format": "eliscript-project-plan", "mode": "standard", "entries": Object.freeze(Array.from(entries)), "modules": Object.freeze(finalModules)}));
|
|
630
838
|
}
|
|
631
839
|
}
|
|
632
840
|
}
|
|
633
|
-
}
|
|
841
|
+
}
|
|
634
842
|
}
|
|
635
843
|
function portablePlan(compiler, entry, entries, root, sourceCache, programCache, sourceOverrides, macroContext) {
|
|
636
844
|
return (compiler)["portable_project_plan"]([({"id": entry, "entries": entries})], ((source, requestedEntries) => {
|
|
@@ -690,24 +898,30 @@ function validateSourceOverrides(sourceOverrides, plan) {
|
|
|
690
898
|
}));
|
|
691
899
|
}
|
|
692
900
|
}
|
|
693
|
-
function checkStandardPlan(compiler, entries, root, sourceOverrides, macroContext) {
|
|
901
|
+
function checkStandardPlan(compiler, entries, root, sourceOverrides, macroContext, sourceCache = null) {
|
|
694
902
|
return (compiler)["project_plan"](entries, ((source) => {
|
|
695
903
|
{
|
|
696
904
|
let overrideText = (sourceOverrides)["get"](source);
|
|
697
905
|
let sourceText = (!((overrideText === undefined)) ? overrideText : readFileSync(source, "utf8"));
|
|
698
906
|
let program = (compiler)["compile_ir_string"](sourceText, source, macroContext);
|
|
907
|
+
if (__eliscript_truthy(sourceCache)) {
|
|
908
|
+
(sourceCache)["set"](source, sourceText);
|
|
909
|
+
}
|
|
699
910
|
return (projectImports(program, source, root, false))["map"](((imp) => {
|
|
700
911
|
return (imp)["dependency"];
|
|
701
912
|
}));
|
|
702
913
|
}
|
|
703
914
|
}));
|
|
704
915
|
}
|
|
705
|
-
function checkPortablePlan(compiler, entry, entries, root, sourceOverrides, macroContext) {
|
|
916
|
+
function checkPortablePlan(compiler, entry, entries, root, sourceOverrides, macroContext, sourceCache = null) {
|
|
706
917
|
return (compiler)["portable_project_plan"]([({"id": entry, "entries": entries})], ((source, requestedEntries) => {
|
|
707
918
|
{
|
|
708
919
|
let overrideText = (sourceOverrides)["get"](source);
|
|
709
920
|
let sourceText = (!((overrideText === undefined)) ? overrideText : readFileSync(source, "utf8"));
|
|
710
921
|
let program = (compiler)["compile_project_portable_ir_string"](sourceText, requestedEntries, source, macroContext);
|
|
922
|
+
if (__eliscript_truthy(sourceCache)) {
|
|
923
|
+
(sourceCache)["set"](source, sourceText);
|
|
924
|
+
}
|
|
711
925
|
return (projectImports(program, source, root, true))["map"](((dependency) => {
|
|
712
926
|
return ({"id": (dependency)["dependency"], "entries": (dependency)["entries"]});
|
|
713
927
|
}));
|
|
@@ -749,7 +963,9 @@ async function checkProject(options) {
|
|
|
749
963
|
let macro = macroInputs(request, root, (entries)[0]);
|
|
750
964
|
let sourceOverrides = sourceOverridesOption((options)["sourceOverrides"], root);
|
|
751
965
|
let portableEntries = Array.from((request)["portableEntries"]);
|
|
752
|
-
let
|
|
966
|
+
let sourceCache = new (globalThis.Map)();
|
|
967
|
+
let lintEnabled = globalThis.Boolean((options)["lint"]);
|
|
968
|
+
let plan = (__eliscript_numeric_relation(">", ((portableEntries) ?? []).length, 0) ? checkPortablePlan(compiler, (entries)[0], portableEntries, root, sourceOverrides, (macro)["context"], sourceCache) : checkStandardPlan(compiler, entries, root, sourceOverrides, (macro)["context"], sourceCache));
|
|
753
969
|
validateSourceOverrides(sourceOverrides, plan);
|
|
754
970
|
{
|
|
755
971
|
let mode = (plan)["mode"];
|
|
@@ -758,10 +974,67 @@ async function checkProject(options) {
|
|
|
758
974
|
return relative(root, ((host_typeof(dependency) === "string") ? dependency : (dependency)["id"]));
|
|
759
975
|
})), "portableEntries": (((record)["entries"] === undefined) ? [] : Array.from((record)["entries"]))});
|
|
760
976
|
}));
|
|
761
|
-
let
|
|
977
|
+
let diagnostics = (__eliscript_truthy(lintEnabled) ? ((collected, m_idx) => {
|
|
978
|
+
while (__eliscript_numeric_relation("<", m_idx, (((plan)["modules"]) ?? []).length)) {
|
|
979
|
+
{
|
|
980
|
+
let record = ((plan)["modules"])[m_idx];
|
|
981
|
+
let mod_id = (record)["id"];
|
|
982
|
+
let mod_src = (__eliscript_truthy((sourceCache)["has"](mod_id)) ? (sourceCache)["get"](mod_id) : readFileSync(mod_id, "utf8"));
|
|
983
|
+
let found = (compiler)["lint_string"](mod_src, mod_id, (options)["lintOptions"]);
|
|
984
|
+
if (__eliscript_truthy(Array.isArray(found))) {
|
|
985
|
+
(found)["forEach"](((d) => {
|
|
986
|
+
return (collected)["push"](d);
|
|
987
|
+
}));
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
((m_idx = (m_idx + 1)));
|
|
991
|
+
}
|
|
992
|
+
(collected)["sort"](((left, right) => {
|
|
993
|
+
{
|
|
994
|
+
let ll = (left)["location"];
|
|
995
|
+
let lr = (right)["location"];
|
|
996
|
+
let fl = (__eliscript_truthy(ll) ? (ll)["file"] : "");
|
|
997
|
+
let fr = (__eliscript_truthy(lr) ? (lr)["file"] : "");
|
|
998
|
+
let sl = ((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? (ll)["start"] : __eliscript_value_13))(ll);
|
|
999
|
+
let sr = ((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? (lr)["start"] : __eliscript_value_14))(lr);
|
|
1000
|
+
let ol = (__eliscript_truthy(sl) ? (sl)["offset"] : 0);
|
|
1001
|
+
let or_ = (__eliscript_truthy(sr) ? (sr)["offset"] : 0);
|
|
1002
|
+
if ((fl !== fr)) {
|
|
1003
|
+
if (__eliscript_numeric_relation("<", fl, fr)) {
|
|
1004
|
+
return -1;
|
|
1005
|
+
} else {
|
|
1006
|
+
return 1;
|
|
1007
|
+
}
|
|
1008
|
+
} else {
|
|
1009
|
+
if ((ol !== or_)) {
|
|
1010
|
+
return __eliscript_numeric_sub(ol, or_);
|
|
1011
|
+
} else {
|
|
1012
|
+
if (((left)["code"] !== (right)["code"])) {
|
|
1013
|
+
if (__eliscript_numeric_relation("<", (left)["code"], (right)["code"])) {
|
|
1014
|
+
return -1;
|
|
1015
|
+
} else {
|
|
1016
|
+
return 1;
|
|
1017
|
+
}
|
|
1018
|
+
} else {
|
|
1019
|
+
return 0;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}));
|
|
1025
|
+
return Object.freeze(collected);
|
|
1026
|
+
})([], 0) : undefined);
|
|
1027
|
+
let baseReport = (compiler)["project_check_report"](({"mode": mode, "root": root, "entries": (entries)["map"](((entry) => {
|
|
762
1028
|
return relative(root, entry);
|
|
763
1029
|
})), "portableEntries": portableEntries, "modules": modules}));
|
|
764
|
-
|
|
1030
|
+
let report = (__eliscript_truthy(lintEnabled) ? Object.freeze(Object.assign(({}), baseReport, ({"diagnostics": diagnostics}))) : baseReport);
|
|
1031
|
+
{
|
|
1032
|
+
let out = ({"format": "eliscript-project-check", "root": root, "entries": Object.freeze(entries), "mode": mode, "portableEntries": Object.freeze(portableEntries), "macroCapabilities": (request)["macroCapabilities"], "macroFileDependencies": Object.freeze((macro)["dependencies"]), "report": report, "plan": plan});
|
|
1033
|
+
if (__eliscript_truthy(lintEnabled)) {
|
|
1034
|
+
((out)["diagnostics"] = diagnostics);
|
|
1035
|
+
}
|
|
1036
|
+
return Object.freeze(out);
|
|
1037
|
+
}
|
|
765
1038
|
}
|
|
766
1039
|
}
|
|
767
1040
|
}
|
|
@@ -814,27 +1087,24 @@ async function buildProject(options) {
|
|
|
814
1087
|
let macro = macroInputs(request, root, (entries)[0]);
|
|
815
1088
|
let sourceOverrides = sourceOverridesOption((options)["sourceOverrides"], root);
|
|
816
1089
|
let requestedOutDir = resolve(pathOption((request)["outDir"], "output"));
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
return projectError("output path is not a directory", requestedOutDir);
|
|
823
|
-
} else {
|
|
824
|
-
return null;
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
} catch (error) {
|
|
828
|
-
if ((__eliscript_truthy(error) && __eliscript_truthy((error)["eliscriptDiagnostic"]))) {
|
|
829
|
-
((__eliscript_value_9) => { throw __eliscript_value_9; })(error);
|
|
1090
|
+
try {
|
|
1091
|
+
{
|
|
1092
|
+
let attributes = statSync(requestedOutDir);
|
|
1093
|
+
if ((!__eliscript_truthy((attributes)["isDirectory"]()))) {
|
|
1094
|
+
projectError("output path is not a directory", requestedOutDir);
|
|
830
1095
|
}
|
|
831
|
-
return mkdirSync(requestedOutDir, ({"recursive": true}));
|
|
832
1096
|
}
|
|
833
|
-
}
|
|
1097
|
+
} catch (error) {
|
|
1098
|
+
if ((__eliscript_truthy(error) && __eliscript_truthy((error)["eliscriptDiagnostic"]))) {
|
|
1099
|
+
((__eliscript_value_15) => { throw __eliscript_value_15; })(error);
|
|
1100
|
+
}
|
|
1101
|
+
mkdirSync(requestedOutDir, ({"recursive": true}));
|
|
1102
|
+
}
|
|
834
1103
|
{
|
|
835
1104
|
let outDir = realpathSync(requestedOutDir);
|
|
836
1105
|
let sourceMapReference = (!((options)["sourceMapReference"] === false));
|
|
837
|
-
let
|
|
1106
|
+
let treeShake = (!((options)["treeShake"] === false));
|
|
1107
|
+
let useCache = globalThis.Boolean(((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? ((__eliscript_value_17) => (__eliscript_truthy(__eliscript_value_17) ? ((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? treeShake : __eliscript_value_18))(sourceMapReference) : __eliscript_value_17))(((sourceOverrides)["size"] === 0)) : __eliscript_value_16))((request)["useCache"]));
|
|
838
1108
|
let compilerDigest = (((options)["compiler"] === undefined) ? compilerDirectoryDigest(moduleDirectory) : compilerDigestOption((options)["compilerDigest"]));
|
|
839
1109
|
let requestedPortableEntries = Array.from((request)["portableEntries"]);
|
|
840
1110
|
let mode = (__eliscript_numeric_relation(">", ((requestedPortableEntries) ?? []).length, 0) ? "portable" : "standard");
|
|
@@ -848,7 +1118,7 @@ async function buildProject(options) {
|
|
|
848
1118
|
let sourceCache = new (globalThis.Map)();
|
|
849
1119
|
let programCache = new (globalThis.Map)();
|
|
850
1120
|
let decisions = new (globalThis.Map)();
|
|
851
|
-
let plan = ((mode === "portable") ? portablePlan(compiler, (entries)[0], requestedPortableEntries, root, sourceCache, programCache, sourceOverrides, (macro)["context"]) : standardPlan(compiler, entries, root, outDir, sourceCache, programCache, records, decisions, sourceOverrides, (macro)["context"], (macro)["dependencies"]));
|
|
1121
|
+
let plan = ((mode === "portable") ? portablePlan(compiler, (entries)[0], requestedPortableEntries, root, sourceCache, programCache, sourceOverrides, (macro)["context"]) : standardPlan(compiler, entries, root, outDir, sourceCache, programCache, records, decisions, sourceOverrides, (macro)["context"], (macro)["dependencies"], treeShake));
|
|
852
1122
|
validateSourceOverrides(sourceOverrides, plan);
|
|
853
1123
|
validateOutputIsolation(({"sources": ((plan)["modules"])["map"](((rec) => {
|
|
854
1124
|
return (rec)["id"];
|