eliscript 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/bootstrap/README.md +26 -0
- package/bootstrap/backends/README.md +515 -0
- package/bootstrap/backends/async.eli +230 -0
- package/bootstrap/backends/binary.eli +173 -0
- package/bootstrap/backends/capabilities.eli +74 -0
- package/bootstrap/backends/elf.eli +246 -0
- package/bootstrap/backends/managed.eli +5976 -0
- package/bootstrap/backends/memory.eli +100 -0
- package/bootstrap/backends/native.eli +2000 -0
- package/bootstrap/backends/numeric.eli +1362 -0
- package/bootstrap/backends/optimize.eli +79 -0
- package/bootstrap/backends/regexp.eli +2263 -0
- package/bootstrap/backends/sha256.eli +138 -0
- package/bootstrap/backends/wasm.eli +1161 -0
- package/bootstrap/compiler/analyzer.eli +165 -77
- package/bootstrap/compiler/compiler.eli +43 -19
- package/bootstrap/compiler/emitter.eli +780 -170
- package/bootstrap/compiler/expander.eli +136 -45
- package/bootstrap/compiler/formatter.eli +8 -1
- package/bootstrap/compiler/ir.eli +148 -45
- package/bootstrap/compiler/lower.eli +29 -2
- package/bootstrap/compiler/project.eli +51 -21
- package/bootstrap/compiler/reader.eli +128 -36
- package/bootstrap/compiler/source-map.eli +46 -4
- package/bootstrap/compiler/symbol.eli +2 -1
- package/bootstrap/compiler/syntax.eli +47 -12
- package/bootstrap/compiler/transient-analysis.eli +40 -4
- package/bootstrap/host/check-cli-legacy.mjs +163 -0
- package/bootstrap/host/check-cli.mjs +59 -158
- package/bootstrap/host/check-cli.mjs.map +1 -0
- package/bootstrap/host/compiler-session.eli +1579 -0
- package/bootstrap/host/compiler-tools.eli +513 -0
- package/bootstrap/host/eliscript-cli.mjs +53 -33
- package/bootstrap/host/eliscript-cli.mjs.map +1 -0
- package/bootstrap/host/project-cli-legacy.mjs +295 -0
- package/bootstrap/host/project-cli.mjs +74 -289
- package/bootstrap/host/project-cli.mjs.map +1 -0
- package/bootstrap/host/project-legacy.mjs +1080 -0
- package/bootstrap/host/project.mjs +210 -1060
- package/bootstrap/host/project.mjs.map +1 -0
- package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
- package/bootstrap/runtime/memory.eli +30379 -0
- package/browser/host.mjs +732 -11
- package/browser/worker.mjs +6 -3
- package/compiler/eliscript-analyzer.el +371 -4
- package/compiler/eliscript-cli.el +84 -1
- package/compiler/eliscript-emitter.el +1189 -256
- package/compiler/eliscript-expander.el +147 -10
- package/compiler/eliscript-ir-emitter.el +725 -208
- package/compiler/eliscript-lower.el +127 -1
- package/compiler/eliscript-portable.el +177 -51
- package/compiler/eliscript-project.el +20 -2
- package/compiler/eliscript-reader.el +141 -57
- package/compiler/eliscript-source-map.el +26 -12
- package/compiler/eliscript-transient-analysis.el +382 -19
- package/dist/backends/async.mjs +561 -0
- package/dist/backends/async.mjs.macro-origins.json +1 -0
- package/dist/backends/async.mjs.map +1 -0
- package/dist/backends/binary.mjs +381 -0
- package/dist/backends/binary.mjs.macro-origins.json +1 -0
- package/dist/backends/binary.mjs.map +1 -0
- package/dist/backends/capabilities.mjs +237 -0
- package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
- package/dist/backends/capabilities.mjs.map +1 -0
- package/dist/backends/elf.mjs +540 -0
- package/dist/backends/elf.mjs.macro-origins.json +1 -0
- package/dist/backends/elf.mjs.map +1 -0
- package/dist/backends/managed.mjs +10616 -0
- package/dist/backends/managed.mjs.macro-origins.json +1 -0
- package/dist/backends/managed.mjs.map +1 -0
- package/dist/backends/memory.mjs +278 -0
- package/dist/backends/memory.mjs.macro-origins.json +1 -0
- package/dist/backends/memory.mjs.map +1 -0
- package/dist/backends/native.mjs +4099 -0
- package/dist/backends/native.mjs.macro-origins.json +1 -0
- package/dist/backends/native.mjs.map +1 -0
- package/dist/backends/numeric.mjs +2458 -0
- package/dist/backends/numeric.mjs.macro-origins.json +1 -0
- package/dist/backends/numeric.mjs.map +1 -0
- package/dist/backends/optimize.mjs +204 -0
- package/dist/backends/optimize.mjs.macro-origins.json +1 -0
- package/dist/backends/optimize.mjs.map +1 -0
- package/dist/backends/regexp.mjs +2033 -0
- package/dist/backends/regexp.mjs.macro-origins.json +1 -0
- package/dist/backends/regexp.mjs.map +1 -0
- package/dist/backends/sha256.mjs +310 -0
- package/dist/backends/sha256.mjs.macro-origins.json +1 -0
- package/dist/backends/sha256.mjs.map +1 -0
- package/dist/backends/wasm.mjs +2258 -0
- package/dist/backends/wasm.mjs.macro-origins.json +1 -0
- package/dist/backends/wasm.mjs.map +1 -0
- package/dist/bootstrap/analyzer.mjs +1908 -776
- package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +450 -142
- package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +3083 -909
- package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +2887 -1233
- package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +582 -218
- package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +670 -116
- package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +866 -257
- package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/package.json +1 -0
- package/dist/bootstrap/project.mjs +1168 -498
- package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +674 -175
- package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/runtime/math.mjs +1117 -0
- package/dist/bootstrap/runtime/math.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
- package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
- package/dist/bootstrap/source-map.mjs +430 -119
- package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +229 -53
- package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +205 -7
- package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1185 -489
- package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +199 -6478
- package/dist/browser/host.mjs +1078 -0
- package/dist/browser/loader.js +1 -0
- package/dist/browser/loader.mjs +231 -0
- package/dist/browser/worker.mjs +63 -0
- package/dist/compiler-artifact.json +1 -0
- package/dist/host/compiler-session.mjs +2980 -0
- package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-session.mjs.map +1 -0
- package/dist/host/compiler-tools.mjs +1084 -0
- package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-tools.mjs.map +1 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
- package/dist/literal-sources/runtime/core/collection.eli +639 -0
- package/dist/literal-sources/runtime/core/data-text.eli +290 -0
- package/dist/literal-sources/runtime/core/data.eli +22 -0
- package/dist/literal-sources/runtime/core/identifier.eli +44 -0
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
- package/dist/literal-sources/runtime/core/list.eli +19 -0
- package/dist/literal-sources/runtime/core/map.eli +9 -0
- package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
- package/dist/literal-sources/runtime/core/metadata.eli +40 -0
- package/dist/literal-sources/runtime/core/object.eli +8 -0
- package/dist/literal-sources/runtime/core/order.eli +123 -0
- package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
- package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
- package/dist/literal-sources/runtime/core/protocol.eli +28 -0
- package/dist/literal-sources/runtime/core/queue.eli +9 -0
- package/dist/literal-sources/runtime/core/record.eli +191 -0
- package/dist/literal-sources/runtime/core/regex.eli +158 -0
- package/dist/literal-sources/runtime/core/sequence.eli +305 -0
- package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
- package/dist/literal-sources/runtime/core/set.eli +9 -0
- package/dist/literal-sources/runtime/core/sorted.eli +408 -0
- package/dist/literal-sources/runtime/core/text.eli +14 -0
- package/dist/literal-sources/runtime/core/transducer.eli +268 -0
- package/dist/literal-sources/runtime/core/transient.eli +17 -0
- package/dist/literal-sources/runtime/core/truth.eli +4 -0
- package/dist/literal-sources/runtime/core/type.eli +232 -0
- package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
- package/dist/literal-sources/runtime/core/value.eli +19 -0
- package/dist/literal-sources/runtime/core/vector.eli +25 -0
- package/dist/literal-sources/runtime/literals.eli +23 -0
- package/dist/literal-sources/runtime/testing/value.eli +6 -0
- package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
- package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
- package/dist/literal-sources/runtime/wire/schema.eli +193 -0
- package/dist/literal-sources/stdlib/bit.eli +36 -0
- package/dist/literal-sources/stdlib/core/data.eli +306 -0
- package/dist/literal-sources/stdlib/core/object.eli +89 -0
- package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
- package/dist/literal-sources/stdlib/core/set.eli +312 -0
- package/dist/literal-sources/stdlib/core/text.eli +103 -0
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +494 -0
- package/dist/literal-sources/stdlib/managed-literals.eli +1469 -0
- package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
- package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
- package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
- package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
- package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
- package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
- package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
- package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
- package/dist/literal-sources/stdlib/value.eli +325 -0
- package/dist/package.json +10 -0
- package/dist/runtime/math.mjs +1116 -0
- package/dist/runtime/math.mjs.macro-origins.json +1 -0
- package/dist/runtime/math.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +10124 -0
- package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/runtime/unicode-case.mjs +280 -0
- package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case.mjs.map +1 -0
- package/dist/runtime.eli +30379 -0
- package/dist/stage3-release.json +1 -0
- package/editor/README.md +1 -1
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +106 -11
- package/platform/http.mjs +20 -0
- package/runtime/array-text.mjs +159 -0
- package/runtime/core/map-internals.mjs +27 -9
- package/runtime/core/object-impl.mjs +26 -17
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/protocol-impl.mjs +682 -255
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/protocol.mjs +4 -0
- package/runtime/core/record.mjs +23 -2
- package/runtime/core/regex.mjs +4 -0
- package/runtime/core/sorted.mjs +53 -0
- package/runtime/core/text-impl.mjs +167 -48
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/type.mjs +75 -3
- package/runtime/core/vector.mjs +6 -0
- package/runtime/math.eli +429 -0
- package/runtime/math.mjs +1116 -0
- package/runtime/math.mjs.map +1 -0
- package/runtime/number-radix.mjs +105 -0
- package/runtime/unicode-case-data.eli +29 -0
- package/runtime/unicode-case-data.mjs +10124 -0
- package/runtime/unicode-case-data.mjs.map +1 -0
- package/runtime/unicode-case.eli +100 -0
- package/runtime/unicode-case.mjs +280 -0
- package/runtime/unicode-case.mjs.map +1 -0
- package/runtime/wire/http-rpc.mjs +168 -0
- package/runtime/wire/markdown.mjs +196 -0
- package/runtime/wire/schema.mjs +109 -0
- package/stdlib/README.md +54 -0
- package/stdlib/core/protocol.eli +81 -17
- package/stdlib/core/seq.eli +1 -1
- package/stdlib/core/zipper.eli +172 -72
- package/stdlib/gepo.eli +12 -0
- package/stdlib/interop/js.eli +56 -15
- package/stdlib/managed-literal-protocols.eli +494 -0
- package/stdlib/managed-literals.eli +1469 -0
- package/stdlib/managed-protocol-error.eli +32 -0
- package/stdlib/managed-queue-state.eli +65 -0
- package/stdlib/managed-runtime-collection-internals.eli +60 -0
- package/stdlib/managed-runtime-collection.eli +639 -0
- package/stdlib/managed-runtime-data-text.eli +290 -0
- package/stdlib/managed-runtime-data.eli +22 -0
- package/stdlib/managed-runtime-identifier.eli +44 -0
- package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
- package/stdlib/managed-runtime-list.eli +19 -0
- package/stdlib/managed-runtime-literals.eli +23 -0
- package/stdlib/managed-runtime-map.eli +9 -0
- package/stdlib/managed-runtime-metadata-internals.eli +6 -0
- package/stdlib/managed-runtime-metadata.eli +40 -0
- package/stdlib/managed-runtime-object.eli +8 -0
- package/stdlib/managed-runtime-order.eli +123 -0
- package/stdlib/managed-runtime-persistent-kind.eli +28 -0
- package/stdlib/managed-runtime-protocol.eli +28 -0
- package/stdlib/managed-runtime-queue.eli +9 -0
- package/stdlib/managed-runtime-record.eli +191 -0
- package/stdlib/managed-runtime-regex.eli +158 -0
- package/stdlib/managed-runtime-sequence.eli +305 -0
- package/stdlib/managed-runtime-set-algebra.eli +28 -0
- package/stdlib/managed-runtime-set.eli +9 -0
- package/stdlib/managed-runtime-sorted.eli +408 -0
- package/stdlib/managed-runtime-text.eli +14 -0
- package/stdlib/managed-runtime-transducer.eli +268 -0
- package/stdlib/managed-runtime-transient.eli +17 -0
- package/stdlib/managed-runtime-truth.eli +4 -0
- package/stdlib/managed-runtime-type.eli +232 -0
- package/stdlib/managed-runtime-value-internals.eli +13 -0
- package/stdlib/managed-runtime-value.eli +19 -0
- package/stdlib/managed-runtime-vector.eli +25 -0
- package/stdlib/managed-sorted-state.eli +233 -0
- package/stdlib/managed-testing-value.eli +6 -0
- package/stdlib/managed-transient-state.eli +348 -0
- package/stdlib/managed-value-state.eli +153 -0
- package/stdlib/managed-vector-view-state.eli +102 -0
- package/stdlib/managed-wire-http-rpc.eli +362 -0
- package/stdlib/managed-wire-markdown.eli +275 -0
- package/stdlib/managed-wire-schema.eli +193 -0
- package/stdlib/mdp.eli +7 -0
- package/stdlib/mds.eli +4 -0
- package/stdlib/persistent-vector.eli +23 -6
- package/tools/acceptance/check-legacy.mjs +687 -0
- package/tools/acceptance/check.eli +431 -0
- package/tools/acceptance/compile-evidence.el +49 -0
- package/tools/acceptance/finalize-legacy.mjs +498 -0
- package/tools/acceptance/finalize.eli +270 -0
- package/tools/backends/benchmark.mjs +175 -0
- package/tools/backends/build.mjs +135 -0
- package/tools/backends/compile.mjs +94 -0
- package/tools/backends/compiler-bootstrap.mjs +1001 -0
- package/tools/backends/compiler-browser.mjs +361 -0
- package/tools/backends/compiler-build.mjs +1628 -0
- package/tools/backends/compiler-cli-legacy.mjs +334 -0
- package/tools/backends/compiler-cli.mjs +29 -0
- package/tools/backends/compiler-corpus-bit.mjs +234 -0
- package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
- package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
- package/tools/backends/compiler-corpus-debugging.mjs +221 -0
- package/tools/backends/compiler-corpus-emitter.mjs +324 -0
- package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
- package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
- package/tools/backends/compiler-corpus-execution.mjs +3324 -0
- package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
- package/tools/backends/compiler-corpus-generations.mjs +208 -0
- package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
- package/tools/backends/compiler-corpus-host-context.mjs +550 -0
- package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
- package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
- package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
- package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
- package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
- package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
- package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
- package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
- package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
- package/tools/backends/compiler-corpus-matchers.mjs +173 -0
- package/tools/backends/compiler-corpus-original-program.mjs +612 -0
- package/tools/backends/compiler-corpus-process.mjs +765 -0
- package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
- package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
- package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
- package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
- package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
- package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
- package/tools/backends/compiler-corpus-reference.mjs +241 -0
- package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
- package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
- package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
- package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
- package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
- package/tools/backends/compiler-corpus.mjs +2054 -0
- package/tools/backends/compiler-debug.mjs +142 -0
- package/tools/backends/compiler-matrix.mjs +1955 -0
- package/tools/backends/compiler-metadata.mjs +203 -0
- package/tools/backends/compiler-package-browser.mjs +120 -0
- package/tools/backends/compiler-package-legacy.mjs +654 -0
- package/tools/backends/compiler-package.mjs +464 -0
- package/tools/backends/compiler-project.mjs +126 -0
- package/tools/backends/compiler-session.mjs +843 -0
- package/tools/backends/compiler-sha256.mjs +152 -0
- package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
- package/tools/backends/compiler-worker.mjs +573 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
- package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
- package/tools/backends/dist/record-grid.mjs +1256 -0
- package/tools/backends/dist/record-grid.mjs.map +1 -0
- package/tools/backends/dist/release-cli.mjs +462 -0
- package/tools/backends/dist/release-cli.mjs.map +1 -0
- package/tools/backends/dist/run-artifact.mjs +517 -0
- package/tools/backends/dist/run-artifact.mjs.map +1 -0
- package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
- package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
- package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
- package/tools/backends/managed-foreign-binding.mjs +497 -0
- package/tools/backends/managed-host-legacy.mjs +1181 -0
- package/tools/backends/managed-host-lifecycle.mjs +310 -0
- package/tools/backends/managed-host-object-provider.mjs +155 -0
- package/tools/backends/managed-host-object-realm.mjs +797 -0
- package/tools/backends/managed-host-proxy.mjs +71 -0
- package/tools/backends/managed-host-runtime.mjs +5868 -0
- package/tools/backends/managed-host.mjs +716 -0
- package/tools/backends/managed-module-graph-legacy.mjs +308 -0
- package/tools/backends/managed-module-graph.mjs +694 -0
- package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
- package/tools/backends/managed-runtime.mjs +939 -0
- package/tools/backends/managed-source-view-legacy.mjs +332 -0
- package/tools/backends/managed-source-view.mjs +959 -0
- package/tools/backends/memory-runtime.mjs +100 -0
- package/tools/backends/native-benchmark.mjs +88 -0
- package/tools/backends/native-managed-runtime.mjs +677 -0
- package/tools/backends/native-memory.mjs +768 -0
- package/tools/backends/native-node-memory.mjs +142 -0
- package/tools/backends/native-node-runner.mjs +99 -0
- package/tools/backends/native-node-watchdog.mjs +19 -0
- package/tools/backends/native-node-worker.mjs +75 -0
- package/tools/backends/stage3-targets.mjs +493 -0
- package/tools/bootstrap-command.el +13 -0
- package/tools/bootstrap-runtime.el +101 -0
- package/tools/bootstrap-seed.el +55 -0
- package/tools/project/check-cli.eli +31 -0
- package/tools/project/project-cli.eli +42 -0
- package/tools/project/project.eli +122 -0
- package/tools/runtime/unicode-case-profiles.mjs +13 -0
- package/tools/runtime/unicode-case-runtime.el +57 -0
- package/tools/testing/source-debugging-corpus-host.eli +16 -0
- package/tools/testing/source-debugging.eli +139 -0
- package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
- package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
- package/tools/testing/stdlib-bit.eli +104 -0
- package/tools/testing/stdlib-bit.mjs +255 -0
- package/bin/eliscript-bootstrap +0 -15
|
@@ -1,13 +1,186 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
|
+
var __eliscript_tdz_ready_0;
|
|
4
|
+
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("fail"); return fail; }
|
|
5
|
+
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("fail"); return __eliscript_const_error(); }
|
|
6
|
+
var __eliscript_tdz_ready_1;
|
|
7
|
+
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("number_pattern"); return number_pattern; }
|
|
8
|
+
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("number_pattern"); return __eliscript_const_error(); }
|
|
9
|
+
var __eliscript_tdz_ready_2;
|
|
10
|
+
function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("native_whitespace_code_p"); return native_whitespace_code_p; }
|
|
11
|
+
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("native_whitespace_code_p"); return __eliscript_const_error(); }
|
|
12
|
+
var __eliscript_tdz_ready_3;
|
|
13
|
+
function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("native_delimiter_code_p"); return native_delimiter_code_p; }
|
|
14
|
+
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("native_delimiter_code_p"); return __eliscript_const_error(); }
|
|
15
|
+
var __eliscript_tdz_ready_4;
|
|
16
|
+
function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("native_skip_space_and_comments"); return native_skip_space_and_comments; }
|
|
17
|
+
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("native_skip_space_and_comments"); return __eliscript_const_error(); }
|
|
18
|
+
var __eliscript_tdz_ready_5;
|
|
19
|
+
function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("native_read_token"); return native_read_token; }
|
|
20
|
+
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("native_read_token"); return __eliscript_const_error(); }
|
|
21
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
2
22
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
23
|
+
const __eliscript_number_intrinsic = globalThis.Number;
|
|
24
|
+
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
25
|
+
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
26
|
+
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
27
|
+
const __eliscript_numeric_error = globalThis.TypeError;
|
|
28
|
+
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
29
|
+
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
30
|
+
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
31
|
+
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
32
|
+
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
33
|
+
const __eliscript_numeric_primitive = (value) => {
|
|
34
|
+
if (!__eliscript_numeric_object(value)) return value;
|
|
35
|
+
const exotic = value[__eliscript_numeric_symbol];
|
|
36
|
+
if (exotic !== void 0 && exotic !== null) {
|
|
37
|
+
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
38
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
39
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
40
|
+
}
|
|
41
|
+
for (let index = 0; index < 2; index++) {
|
|
42
|
+
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
43
|
+
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
44
|
+
const result = __eliscript_numeric_apply(method, value, []);
|
|
45
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
49
|
+
};
|
|
50
|
+
const __eliscript_to_number = (value) => {
|
|
51
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
52
|
+
if (typeof primitive === "string") {
|
|
53
|
+
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
54
|
+
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
55
|
+
let first = 2;
|
|
56
|
+
while (first < text.length && text[first] === "0") first++;
|
|
57
|
+
if (first === text.length) return 0;
|
|
58
|
+
const prefix = text[1];
|
|
59
|
+
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
60
|
+
if (text.length - first > limit) return 1 / 0;
|
|
61
|
+
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
62
|
+
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return __eliscript_number_intrinsic(primitive);
|
|
66
|
+
};
|
|
67
|
+
const __eliscript_numeric = (value) => {
|
|
68
|
+
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
69
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
70
|
+
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
71
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
72
|
+
};
|
|
73
|
+
const __eliscript_implicit_number = (value) => {
|
|
74
|
+
if (typeof value === "number") return value;
|
|
75
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
76
|
+
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
77
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
78
|
+
};
|
|
79
|
+
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
80
|
+
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
81
|
+
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
82
|
+
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
83
|
+
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
84
|
+
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
85
|
+
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
86
|
+
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
87
|
+
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
88
|
+
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
89
|
+
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
90
|
+
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
91
|
+
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
92
|
+
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
93
|
+
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
94
|
+
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
95
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
96
|
+
if (operator === "<") return left < right;
|
|
97
|
+
if (operator === "<=") return left <= right;
|
|
98
|
+
if (operator === ">") return left > right;
|
|
99
|
+
return left >= right;
|
|
100
|
+
}
|
|
101
|
+
let a = __eliscript_numeric_primitive(left);
|
|
102
|
+
let b = __eliscript_numeric_primitive(right);
|
|
103
|
+
const x = typeof a, y = typeof b;
|
|
104
|
+
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
105
|
+
a = __eliscript_numeric(a);
|
|
106
|
+
b = __eliscript_numeric(b);
|
|
107
|
+
}
|
|
108
|
+
if (operator === "<") return a < b;
|
|
109
|
+
if (operator === "<=") return a <= b;
|
|
110
|
+
if (operator === ">") return a > b;
|
|
111
|
+
return a >= b;
|
|
112
|
+
};
|
|
3
113
|
|
|
4
114
|
import {make_span, literal_node, undefined_node, symbol_node, keyword_node, collection_node} from "./syntax.mjs";
|
|
5
|
-
const fail = (diagnostic) => {
|
|
115
|
+
const fail = ((diagnostic) => {
|
|
116
|
+
{
|
|
117
|
+
const __eliscript_value_1 = ((diagnostic)["location"])["start"];
|
|
118
|
+
{
|
|
119
|
+
let p = __eliscript_value_1;
|
|
120
|
+
{
|
|
121
|
+
const __eliscript_value_2 = new (Error)(((file_value) => {
|
|
122
|
+
return ((file) => {
|
|
123
|
+
return ((line_value) => {
|
|
124
|
+
return ((line) => {
|
|
125
|
+
return ((column_value) => {
|
|
126
|
+
return ((column) => {
|
|
127
|
+
return ((message_value) => {
|
|
128
|
+
return ((message) => {
|
|
129
|
+
return (file + ":" + line + ":" + column + ": " + message);
|
|
130
|
+
})(`${message_value}`);
|
|
131
|
+
})((diagnostic)["message"]);
|
|
132
|
+
})(`${column_value}`);
|
|
133
|
+
})((p)["column"]);
|
|
134
|
+
})(`${line_value}`);
|
|
135
|
+
})((p)["line"]);
|
|
136
|
+
})(`${file_value}`);
|
|
137
|
+
})(((diagnostic)["location"])["file"]));
|
|
138
|
+
{
|
|
139
|
+
let error = __eliscript_value_2;
|
|
140
|
+
((error)["eliscriptDiagnostic"] = diagnostic);
|
|
141
|
+
return ((__eliscript_value_3) => { throw __eliscript_value_3; })(error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
__eliscript_tdz_ready_0 = true;
|
|
6
148
|
const number_pattern = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
7
|
-
|
|
8
|
-
const
|
|
149
|
+
__eliscript_tdz_ready_1 = true;
|
|
150
|
+
const native_whitespace_code_p = ((code) => {
|
|
151
|
+
return ((code === 32) || (code === 9) || (code === 10) || (code === 13) || (code === 12));
|
|
152
|
+
});
|
|
153
|
+
__eliscript_tdz_ready_2 = true;
|
|
154
|
+
const native_delimiter_code_p = ((code) => {
|
|
155
|
+
return ((code === undefined) || (code === 32) || (code === 9) || (code === 10) || (code === 13) || (code === 12) || (code === 40) || (code === 41) || (code === 91) || (code === 93) || (code === 123) || (code === 125) || (code === 34) || (code === 39) || (code === 44) || (code === 59) || (code === 96));
|
|
156
|
+
});
|
|
157
|
+
__eliscript_tdz_ready_3 = true;
|
|
9
158
|
function make_state(source, filename) {
|
|
10
|
-
return ({"source": source, "filename": filename, "index": 0, "offset": 0, "line": 1, "column": 1});
|
|
159
|
+
return ({"source": source, "filename": filename, "index": 0, "offset": 0, "line": 1, "column": 1, "atomNames": new (globalThis.Map)()});
|
|
160
|
+
}
|
|
161
|
+
function reader_atom_name(state, name) {
|
|
162
|
+
{
|
|
163
|
+
const __eliscript_value_4 = ((state)["atomNames"] ?? null);
|
|
164
|
+
{
|
|
165
|
+
let names = __eliscript_value_4;
|
|
166
|
+
if ((names === null)) {
|
|
167
|
+
return name;
|
|
168
|
+
} else {
|
|
169
|
+
{
|
|
170
|
+
const __eliscript_value_5 = (names)["get"](name);
|
|
171
|
+
{
|
|
172
|
+
let existing = __eliscript_value_5;
|
|
173
|
+
if ((existing === undefined)) {
|
|
174
|
+
(names)["set"](name, name);
|
|
175
|
+
return name;
|
|
176
|
+
} else {
|
|
177
|
+
return existing;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
11
184
|
}
|
|
12
185
|
function mark(state) {
|
|
13
186
|
return ({"index": (state)["index"], "offset": (state)["offset"], "line": (state)["line"], "column": (state)["column"]});
|
|
@@ -16,9 +189,13 @@ function span_from(state, start) {
|
|
|
16
189
|
return make_span((state)["filename"], (start)["offset"], (state)["offset"], (start)["line"], (start)["column"], (state)["line"], (state)["column"]);
|
|
17
190
|
}
|
|
18
191
|
function fail_at(state, position, message, width = null) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
192
|
+
{
|
|
193
|
+
const __eliscript_value_6 = ((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? __eliscript_value_7 : 1))(width);
|
|
194
|
+
{
|
|
195
|
+
let span_width = __eliscript_value_6;
|
|
196
|
+
return (__eliscript_tdz_read_0())(({"format": "eliscript-diagnostic", "version": 1, "code": "ELI-R0001", "severity": "error", "phase": "reader", "message": message, "location": ({"file": ((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? __eliscript_value_8 : "<input>"))((state)["filename"]), "start": ({"offset": (position)["offset"], "line": (position)["line"], "column": (position)["column"]}), "end": ({"offset": ((position)["offset"] + span_width), "line": (position)["line"], "column": ((position)["column"] + span_width)})})}));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
22
199
|
}
|
|
23
200
|
function peek_code(state) {
|
|
24
201
|
return ((state)["source"])["codePointAt"]((state)["index"]);
|
|
@@ -27,32 +204,38 @@ function peek_code_ahead(state, code_units) {
|
|
|
27
204
|
return ((state)["source"])["codePointAt"](((state)["index"] + code_units));
|
|
28
205
|
}
|
|
29
206
|
function advance(state) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
((state)["
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
207
|
+
{
|
|
208
|
+
const __eliscript_value_9 = peek_code(state);
|
|
209
|
+
{
|
|
210
|
+
let code = __eliscript_value_9;
|
|
211
|
+
if ((!(code === undefined))) {
|
|
212
|
+
((state)["index"] = ((state)["index"] + (__eliscript_numeric_relation(">", code, 65535) ? 2 : 1)));
|
|
213
|
+
((state)["offset"] = ((state)["offset"] + 1));
|
|
214
|
+
if ((code === 10)) {
|
|
215
|
+
((state)["line"] = ((state)["line"] + 1));
|
|
216
|
+
((state)["column"] = 1);
|
|
217
|
+
} else {
|
|
218
|
+
((state)["column"] = ((state)["column"] + 1));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return code;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
41
224
|
}
|
|
42
225
|
function reference_whitespace_code_p(code) {
|
|
43
|
-
return ((
|
|
226
|
+
return ((code === 32) || (code === 9) || (code === 10) || (code === 13) || (code === 12));
|
|
44
227
|
}
|
|
45
228
|
function whitespace_code_p(code) {
|
|
46
|
-
return
|
|
229
|
+
return (__eliscript_tdz_read_2())(code);
|
|
47
230
|
}
|
|
48
231
|
function reference_delimiter_code_p(code) {
|
|
49
|
-
return ((
|
|
232
|
+
return ((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? __eliscript_value_10 : ((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? __eliscript_value_11 : ((code === 40) || (code === 41) || (code === 91) || (code === 93) || (code === 123) || (code === 125) || (code === 34) || (code === 39) || (code === 44) || (code === 59) || (code === 96))))(reference_whitespace_code_p(code))))((code === undefined));
|
|
50
233
|
}
|
|
51
234
|
function delimiter_code_p(code) {
|
|
52
|
-
return
|
|
235
|
+
return (__eliscript_tdz_read_3())(code);
|
|
53
236
|
}
|
|
54
237
|
function closing_code_p(code) {
|
|
55
|
-
return ((
|
|
238
|
+
return ((code === 41) || (code === 93) || (code === 125));
|
|
56
239
|
}
|
|
57
240
|
function code_character(code) {
|
|
58
241
|
return (String)["fromCodePoint"](code);
|
|
@@ -60,200 +243,516 @@ function code_character(code) {
|
|
|
60
243
|
function invalid_closing(state, position, code) {
|
|
61
244
|
return fail_at(state, position, (String("Invalid read syntax: \"") + String(code_character(code)) + String("\"")), 1);
|
|
62
245
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
246
|
+
function reference_skip_space_and_comments(state) {
|
|
247
|
+
{
|
|
248
|
+
const __eliscript_value_12 = false;
|
|
249
|
+
{
|
|
250
|
+
let done = __eliscript_value_12;
|
|
251
|
+
while ((!__eliscript_truthy(done))) {
|
|
252
|
+
{
|
|
253
|
+
const __eliscript_value_13 = peek_code(state);
|
|
254
|
+
{
|
|
255
|
+
let code = __eliscript_value_13;
|
|
256
|
+
if ((code === undefined)) {
|
|
257
|
+
((done = true));
|
|
258
|
+
} else {
|
|
259
|
+
if (__eliscript_truthy(whitespace_code_p(code))) {
|
|
260
|
+
advance(state);
|
|
261
|
+
} else {
|
|
262
|
+
if ((code === 59)) {
|
|
263
|
+
while (((!(peek_code(state) === undefined)) && (!(peek_code(state) === 10)))) {
|
|
264
|
+
advance(state);
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
((done = true));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
71
270
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
})(peek_code(state));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
75
273
|
}
|
|
76
274
|
return null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
79
277
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
278
|
+
const native_skip_space_and_comments = ((state, whitespace) => {
|
|
279
|
+
{
|
|
280
|
+
let source = (state)["source"];
|
|
281
|
+
let index = (state)["index"];
|
|
282
|
+
let offset = (state)["offset"];
|
|
283
|
+
let line = (state)["line"];
|
|
284
|
+
let column = (state)["column"];
|
|
285
|
+
let done = false;
|
|
286
|
+
while (((done === false) && __eliscript_numeric_relation("<", index, (source)["length"]))) {
|
|
287
|
+
{
|
|
288
|
+
let code = (source)["codePointAt"](index);
|
|
289
|
+
let answer = whitespace(code);
|
|
290
|
+
if (!!answer) {
|
|
291
|
+
((index = (index + 1)));
|
|
292
|
+
((offset = (offset + 1)));
|
|
293
|
+
if ((code === 10)) {
|
|
294
|
+
((line = (line + 1)));
|
|
295
|
+
((column = 1));
|
|
296
|
+
} else {
|
|
297
|
+
((column = (column + 1)));
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
if ((code === 59)) {
|
|
301
|
+
while ((__eliscript_numeric_relation("<", index, (source)["length"]) && (!((source)["charCodeAt"](index) === 10)))) {
|
|
302
|
+
((index = (index + (__eliscript_numeric_relation(">", (source)["codePointAt"](index), 65535) ? 2 : 1))));
|
|
303
|
+
((offset = (offset + 1)));
|
|
304
|
+
((column = (column + 1)));
|
|
305
|
+
}
|
|
306
|
+
} else {
|
|
307
|
+
((done = true));
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
84
311
|
}
|
|
312
|
+
((state)["index"] = index);
|
|
313
|
+
((state)["offset"] = offset);
|
|
314
|
+
((state)["line"] = line);
|
|
315
|
+
((state)["column"] = column);
|
|
85
316
|
return null;
|
|
86
|
-
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
__eliscript_tdz_ready_4 = true;
|
|
320
|
+
function skip_space_and_comments(state) {
|
|
321
|
+
return (__eliscript_tdz_read_4())(state, (__eliscript_tdz_read_2()));
|
|
322
|
+
}
|
|
323
|
+
function reference_read_token(state, start) {
|
|
324
|
+
while ((!__eliscript_truthy(delimiter_code_p(peek_code(state))))) {
|
|
325
|
+
advance(state);
|
|
326
|
+
}
|
|
87
327
|
return ((state)["source"])["slice"]((start)["index"], (state)["index"]);
|
|
88
328
|
}
|
|
329
|
+
const native_read_token = ((state, start, delimiter) => {
|
|
330
|
+
{
|
|
331
|
+
let source = (state)["source"];
|
|
332
|
+
let index = (state)["index"];
|
|
333
|
+
let consumed = 0;
|
|
334
|
+
let done = false;
|
|
335
|
+
while ((done === false)) {
|
|
336
|
+
{
|
|
337
|
+
let code = (source)["codePointAt"](index);
|
|
338
|
+
let answer = delimiter(code);
|
|
339
|
+
if (!!answer) {
|
|
340
|
+
((done = true));
|
|
341
|
+
} else {
|
|
342
|
+
((index = (index + (__eliscript_numeric_relation(">", code, 65535) ? 2 : 1))));
|
|
343
|
+
((consumed = (consumed + 1)));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
((state)["index"] = index);
|
|
348
|
+
((state)["offset"] = ((state)["offset"] + consumed));
|
|
349
|
+
((state)["column"] = ((state)["column"] + consumed));
|
|
350
|
+
return (source)["slice"]((start)["index"], index);
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
__eliscript_tdz_ready_5 = true;
|
|
354
|
+
function read_token(state, start) {
|
|
355
|
+
return (__eliscript_tdz_read_5())(state, start, (__eliscript_tdz_read_3()));
|
|
356
|
+
}
|
|
89
357
|
function queue_opening_index(state) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
358
|
+
{
|
|
359
|
+
let source = (state)["source"];
|
|
360
|
+
let start = (state)["index"];
|
|
361
|
+
let tag_end = (start + 6);
|
|
362
|
+
if ((!((source)["slice"](start, tag_end) === "#queue"))) {
|
|
363
|
+
return -1;
|
|
364
|
+
} else {
|
|
365
|
+
{
|
|
366
|
+
const __eliscript_value_14 = tag_end;
|
|
367
|
+
const __eliscript_value_15 = false;
|
|
368
|
+
{
|
|
369
|
+
let cursor = __eliscript_value_14;
|
|
370
|
+
let done = __eliscript_value_15;
|
|
371
|
+
while ((__eliscript_numeric_relation("<", cursor, (source)["length"]) && (!__eliscript_truthy(done)))) {
|
|
372
|
+
{
|
|
373
|
+
const __eliscript_value_16 = (source)["codePointAt"](cursor);
|
|
374
|
+
{
|
|
375
|
+
let code = __eliscript_value_16;
|
|
376
|
+
if (__eliscript_truthy(reference_whitespace_code_p(code))) {
|
|
377
|
+
((cursor = (cursor + (__eliscript_numeric_relation(">", code, 65535) ? 2 : 1))));
|
|
378
|
+
} else {
|
|
379
|
+
if ((code === 59)) {
|
|
380
|
+
while ((__eliscript_numeric_relation("<", cursor, (source)["length"]) && (!((source)["codePointAt"](cursor) === 10)))) {
|
|
381
|
+
((cursor = (cursor + 1)));
|
|
382
|
+
}
|
|
383
|
+
} else {
|
|
384
|
+
((done = true));
|
|
100
385
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
})((source)["codePointAt"](cursor));
|
|
386
|
+
}
|
|
387
|
+
}
|
|
104
388
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
389
|
+
}
|
|
390
|
+
if ((__eliscript_numeric_relation("<", cursor, (source)["length"]) && ((source)["codePointAt"](cursor) === 91))) {
|
|
391
|
+
return cursor;
|
|
392
|
+
} else {
|
|
393
|
+
return -1;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
112
399
|
}
|
|
113
400
|
function number_token_p(token) {
|
|
114
|
-
return (
|
|
401
|
+
return ((__eliscript_tdz_read_1()))["test"](token);
|
|
115
402
|
}
|
|
116
403
|
function valid_keyword_name_p(name) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
404
|
+
{
|
|
405
|
+
const __eliscript_value_17 = (name)["indexOf"]("/");
|
|
406
|
+
{
|
|
407
|
+
let separator = __eliscript_value_17;
|
|
408
|
+
return (__eliscript_numeric_relation(">", (name)["length"], 0) && ((separator === -1) || (__eliscript_numeric_relation(">", separator, 0) && __eliscript_numeric_relation("<", separator, __eliscript_numeric_decrement((name)["length"])) && ((name)["indexOf"]("/", (separator + 1)) === -1))));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
120
411
|
}
|
|
121
412
|
function read_atom(state, start) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
413
|
+
{
|
|
414
|
+
let token = read_token(state, start);
|
|
415
|
+
let span = span_from(state, start);
|
|
416
|
+
if ((token === "nil")) {
|
|
417
|
+
return literal_node(null, span);
|
|
418
|
+
} else {
|
|
419
|
+
if ((token === "t")) {
|
|
420
|
+
return literal_node(true, span);
|
|
421
|
+
} else {
|
|
422
|
+
if ((token === "false")) {
|
|
423
|
+
return literal_node(false, span);
|
|
424
|
+
} else {
|
|
425
|
+
if ((token === "undefined")) {
|
|
426
|
+
return undefined_node(span);
|
|
427
|
+
} else {
|
|
428
|
+
if (__eliscript_truthy((token)["startsWith"](":"))) {
|
|
429
|
+
{
|
|
430
|
+
const __eliscript_value_18 = (token)["slice"](1);
|
|
431
|
+
{
|
|
432
|
+
let name = __eliscript_value_18;
|
|
433
|
+
if ((!__eliscript_truthy(valid_keyword_name_p(name)))) {
|
|
434
|
+
fail_at(state, start, (String("invalid keyword literal: ") + String(token)), __eliscript_numeric_sub((state)["offset"], (start)["offset"]));
|
|
435
|
+
}
|
|
436
|
+
return keyword_node(reader_atom_name(state, name), span);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
} else {
|
|
440
|
+
if (__eliscript_truthy(number_token_p(token))) {
|
|
441
|
+
return literal_node((Number)(token), span);
|
|
442
|
+
} else {
|
|
443
|
+
return symbol_node(reader_atom_name(state, token), span);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
130
451
|
}
|
|
131
452
|
function read_string_literal(state, start) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
453
|
+
{
|
|
454
|
+
let source = (state)["source"];
|
|
455
|
+
let index = (state)["index"];
|
|
456
|
+
let offset = (state)["offset"];
|
|
457
|
+
let line = (state)["line"];
|
|
458
|
+
let column = (state)["column"];
|
|
459
|
+
let opening = true;
|
|
460
|
+
let escaped = false;
|
|
461
|
+
let done = false;
|
|
462
|
+
let ended = false;
|
|
463
|
+
while ((!__eliscript_truthy(done))) {
|
|
464
|
+
{
|
|
465
|
+
const __eliscript_value_19 = (source)["codePointAt"](index);
|
|
466
|
+
{
|
|
467
|
+
let code = __eliscript_value_19;
|
|
468
|
+
if ((code === undefined)) {
|
|
469
|
+
((ended = true));
|
|
470
|
+
((done = true));
|
|
471
|
+
} else {
|
|
472
|
+
((index = (index + (__eliscript_numeric_relation(">", code, 65535) ? 2 : 1))));
|
|
473
|
+
((offset = (offset + 1)));
|
|
474
|
+
if ((code === 10)) {
|
|
475
|
+
((line = (line + 1)));
|
|
476
|
+
((column = 1));
|
|
477
|
+
} else {
|
|
478
|
+
((column = (column + 1)));
|
|
479
|
+
}
|
|
480
|
+
if (__eliscript_truthy(opening)) {
|
|
481
|
+
((opening = false));
|
|
482
|
+
} else {
|
|
483
|
+
if (__eliscript_truthy(escaped)) {
|
|
484
|
+
((escaped = false));
|
|
485
|
+
} else {
|
|
486
|
+
if ((code === 92)) {
|
|
487
|
+
((escaped = true));
|
|
488
|
+
} else {
|
|
489
|
+
if ((code === 34)) {
|
|
490
|
+
((done = true));
|
|
491
|
+
} else {
|
|
492
|
+
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
146
499
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
500
|
+
}
|
|
501
|
+
((state)["index"] = index);
|
|
502
|
+
((state)["offset"] = offset);
|
|
503
|
+
((state)["line"] = line);
|
|
504
|
+
((state)["column"] = column);
|
|
505
|
+
if (__eliscript_truthy(ended)) {
|
|
506
|
+
fail_at(state, start, "unexpected end of input");
|
|
507
|
+
}
|
|
508
|
+
{
|
|
509
|
+
const __eliscript_value_20 = (source)["slice"]((start)["index"], index);
|
|
510
|
+
{
|
|
511
|
+
let raw = __eliscript_value_20;
|
|
512
|
+
{
|
|
513
|
+
const __eliscript_value_21 = (JSON)["parse"](raw);
|
|
514
|
+
{
|
|
515
|
+
let value = __eliscript_value_21;
|
|
516
|
+
return literal_node(value, span_from(state, start));
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
155
522
|
}
|
|
156
523
|
function read_prefix(state, start, name, width) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
524
|
+
{
|
|
525
|
+
const __eliscript_value_22 = width;
|
|
526
|
+
{
|
|
527
|
+
let remaining = __eliscript_value_22;
|
|
528
|
+
while (__eliscript_numeric_relation(">", remaining, 0)) {
|
|
160
529
|
advance(state);
|
|
161
|
-
((remaining = (remaining
|
|
530
|
+
((remaining = __eliscript_numeric_decrement(remaining)));
|
|
162
531
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
{
|
|
535
|
+
const __eliscript_value_23 = span_from(state, start);
|
|
536
|
+
{
|
|
537
|
+
let prefix_span = __eliscript_value_23;
|
|
538
|
+
skip_space_and_comments(state);
|
|
539
|
+
if ((peek_code(state) === undefined)) {
|
|
540
|
+
fail_at(state, start, "unexpected end of input");
|
|
541
|
+
}
|
|
542
|
+
{
|
|
543
|
+
const __eliscript_value_24 = read_node(state);
|
|
544
|
+
{
|
|
545
|
+
let child = __eliscript_value_24;
|
|
546
|
+
return collection_node("list", [symbol_node(reader_atom_name(state, name), prefix_span), child], span_from(state, start));
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
173
551
|
}
|
|
174
552
|
function read_collection(state, start, closing, kind, tagged_opening_span = null) {
|
|
175
553
|
advance(state);
|
|
176
|
-
|
|
177
|
-
(
|
|
178
|
-
|
|
554
|
+
{
|
|
555
|
+
const __eliscript_value_25 = span_from(state, start);
|
|
556
|
+
const __eliscript_value_26 = [];
|
|
557
|
+
const __eliscript_value_27 = false;
|
|
558
|
+
{
|
|
559
|
+
let opening_span = __eliscript_value_25;
|
|
560
|
+
let items = __eliscript_value_26;
|
|
561
|
+
let done = __eliscript_value_27;
|
|
562
|
+
while ((!__eliscript_truthy(done))) {
|
|
179
563
|
skip_space_and_comments(state);
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
564
|
+
{
|
|
565
|
+
const __eliscript_value_28 = peek_code(state);
|
|
566
|
+
{
|
|
567
|
+
let code = __eliscript_value_28;
|
|
568
|
+
if ((code === undefined)) {
|
|
569
|
+
fail_at(state, start, "unexpected end of input");
|
|
570
|
+
} else {
|
|
571
|
+
if ((code === closing)) {
|
|
572
|
+
advance(state);
|
|
573
|
+
((done = true));
|
|
574
|
+
} else {
|
|
575
|
+
if (__eliscript_truthy(closing_code_p(code))) {
|
|
576
|
+
invalid_closing(state, start, code);
|
|
577
|
+
} else {
|
|
578
|
+
(items)["push"](read_node(state));
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
186
584
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
585
|
+
{
|
|
586
|
+
const __eliscript_value_29 = span_from(state, start);
|
|
587
|
+
{
|
|
588
|
+
let span = __eliscript_value_29;
|
|
589
|
+
if ((kind === "map")) {
|
|
590
|
+
if ((__eliscript_numeric_rem((items)["length"], 2) === 1)) {
|
|
591
|
+
fail_at(state, start, "map literal must contain an even number of forms", __eliscript_numeric_sub((state)["offset"], (start)["offset"]));
|
|
592
|
+
}
|
|
593
|
+
{
|
|
594
|
+
const __eliscript_value_30 = [symbol_node(reader_atom_name(state, "hash-map"), opening_span)];
|
|
595
|
+
{
|
|
596
|
+
let form_items = __eliscript_value_30;
|
|
597
|
+
(items)["forEach"](((item) => {
|
|
598
|
+
return (form_items)["push"](item);
|
|
599
|
+
}));
|
|
600
|
+
return collection_node("list", form_items, span);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
} else {
|
|
604
|
+
if ((kind === "set")) {
|
|
605
|
+
{
|
|
606
|
+
const __eliscript_value_31 = [symbol_node(reader_atom_name(state, "hash-set"), opening_span)];
|
|
607
|
+
{
|
|
608
|
+
let form_items = __eliscript_value_31;
|
|
609
|
+
(items)["forEach"](((item) => {
|
|
610
|
+
return (form_items)["push"](item);
|
|
611
|
+
}));
|
|
612
|
+
return collection_node("list", form_items, span);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
} else {
|
|
616
|
+
if ((kind === "queue")) {
|
|
617
|
+
{
|
|
618
|
+
const __eliscript_value_32 = [symbol_node(reader_atom_name(state, "queue"), ((__eliscript_value_33) => (__eliscript_truthy(__eliscript_value_33) ? __eliscript_value_33 : opening_span))(tagged_opening_span))];
|
|
619
|
+
{
|
|
620
|
+
let form_items = __eliscript_value_32;
|
|
621
|
+
(items)["forEach"](((item) => {
|
|
622
|
+
return (form_items)["push"](item);
|
|
623
|
+
}));
|
|
624
|
+
return collection_node("list", form_items, span);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
} else {
|
|
628
|
+
if (((kind === "list") && ((items)["length"] === 0))) {
|
|
629
|
+
return literal_node(null, span);
|
|
630
|
+
} else {
|
|
631
|
+
return collection_node(kind, items, span);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
211
640
|
}
|
|
212
641
|
function read_queue(state, start, opening) {
|
|
213
|
-
|
|
214
|
-
(()
|
|
215
|
-
|
|
642
|
+
{
|
|
643
|
+
const __eliscript_value_34 = ((start)["index"] + 6);
|
|
644
|
+
{
|
|
645
|
+
let tag_end = __eliscript_value_34;
|
|
646
|
+
while (__eliscript_numeric_relation("<", (state)["index"], tag_end)) {
|
|
216
647
|
advance(state);
|
|
217
648
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
649
|
+
{
|
|
650
|
+
const __eliscript_value_35 = span_from(state, start);
|
|
651
|
+
{
|
|
652
|
+
let tag_span = __eliscript_value_35;
|
|
653
|
+
while (__eliscript_numeric_relation("<", (state)["index"], opening)) {
|
|
654
|
+
advance(state);
|
|
655
|
+
}
|
|
656
|
+
return read_collection(state, start, 93, "queue", tag_span);
|
|
224
657
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
})(span_from(state, start));
|
|
229
|
-
})(((start)["index"] + 6));
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
230
661
|
}
|
|
231
662
|
function read_dispatch(state, start) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
663
|
+
{
|
|
664
|
+
const __eliscript_value_36 = peek_code_ahead(state, 1);
|
|
665
|
+
const __eliscript_value_37 = queue_opening_index(state);
|
|
666
|
+
{
|
|
667
|
+
let next = __eliscript_value_36;
|
|
668
|
+
let queue_opening = __eliscript_value_37;
|
|
669
|
+
if ((next === 39)) {
|
|
670
|
+
return read_prefix(state, start, "function", 2);
|
|
671
|
+
} else {
|
|
672
|
+
if ((next === 123)) {
|
|
673
|
+
advance(state);
|
|
674
|
+
return read_collection(state, start, 125, "set");
|
|
675
|
+
} else {
|
|
676
|
+
if (__eliscript_numeric_relation(">=", queue_opening, 0)) {
|
|
677
|
+
return read_queue(state, start, queue_opening);
|
|
678
|
+
} else {
|
|
679
|
+
return fail_at(state, start, (String("Invalid read syntax: \"#") + String(((next === undefined) ? "" : code_character(next))) + String("\"")));
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
238
685
|
}
|
|
239
686
|
function read_node(state) {
|
|
240
687
|
skip_space_and_comments(state);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
688
|
+
{
|
|
689
|
+
const __eliscript_value_38 = mark(state);
|
|
690
|
+
const __eliscript_value_39 = peek_code(state);
|
|
691
|
+
{
|
|
692
|
+
let start = __eliscript_value_38;
|
|
693
|
+
let code = __eliscript_value_39;
|
|
694
|
+
if ((code === undefined)) {
|
|
695
|
+
return fail_at(state, start, "unexpected end of input");
|
|
696
|
+
} else {
|
|
697
|
+
if ((code === 40)) {
|
|
698
|
+
return read_collection(state, start, 41, "list");
|
|
699
|
+
} else {
|
|
700
|
+
if ((code === 91)) {
|
|
701
|
+
return read_collection(state, start, 93, "vector");
|
|
702
|
+
} else {
|
|
703
|
+
if ((code === 123)) {
|
|
704
|
+
return read_collection(state, start, 125, "map");
|
|
705
|
+
} else {
|
|
706
|
+
if (__eliscript_truthy(closing_code_p(code))) {
|
|
707
|
+
return invalid_closing(state, start, code);
|
|
708
|
+
} else {
|
|
709
|
+
if ((code === 34)) {
|
|
710
|
+
return read_string_literal(state, start);
|
|
711
|
+
} else {
|
|
712
|
+
if ((code === 39)) {
|
|
713
|
+
return read_prefix(state, start, "quote", 1);
|
|
714
|
+
} else {
|
|
715
|
+
if ((code === 96)) {
|
|
716
|
+
return read_prefix(state, start, "`", 1);
|
|
717
|
+
} else {
|
|
718
|
+
if ((code === 44)) {
|
|
719
|
+
if ((peek_code_ahead(state, 1) === 64)) {
|
|
720
|
+
return read_prefix(state, start, ",@", 2);
|
|
721
|
+
} else {
|
|
722
|
+
return read_prefix(state, start, ",", 1);
|
|
723
|
+
}
|
|
724
|
+
} else {
|
|
725
|
+
if ((code === 35)) {
|
|
726
|
+
return read_dispatch(state, start);
|
|
727
|
+
} else {
|
|
728
|
+
return read_atom(state, start);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
244
741
|
}
|
|
245
742
|
function read_string(source, filename) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
743
|
+
{
|
|
744
|
+
const __eliscript_value_40 = make_state(source, filename);
|
|
745
|
+
const __eliscript_value_41 = [];
|
|
746
|
+
{
|
|
747
|
+
let state = __eliscript_value_40;
|
|
748
|
+
let forms = __eliscript_value_41;
|
|
749
|
+
skip_space_and_comments(state);
|
|
750
|
+
while ((!(peek_code(state) === undefined))) {
|
|
250
751
|
(forms)["push"](read_node(state));
|
|
251
752
|
skip_space_and_comments(state);
|
|
252
753
|
}
|
|
253
|
-
return
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
})(make_state(source, filename), []);
|
|
754
|
+
return forms;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
257
757
|
}
|
|
258
|
-
export {read_string, whitespace_code_p, reference_whitespace_code_p, delimiter_code_p, reference_delimiter_code_p};
|
|
259
|
-
//# sourceMappingURL=reader.mjs.map
|
|
758
|
+
export {read_string, read_token, reference_read_token, skip_space_and_comments, reference_skip_space_and_comments, whitespace_code_p, reference_whitespace_code_p, delimiter_code_p, reference_delimiter_code_p};
|