eliscript 0.1.0 → 0.1.1
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 +9 -8
- package/bootstrap/compiler/emitter.eli +161 -63
- package/bootstrap/host/check-cli.mjs +0 -1
- package/bootstrap/host/check-cli.mjs.map +1 -1
- package/bootstrap/host/compiler-session.eli +2 -1
- package/bootstrap/host/eliscript-cli.mjs +2 -9
- package/bootstrap/host/eliscript-cli.mjs.map +1 -1
- package/bootstrap/host/project-cli.mjs +1 -11
- package/bootstrap/host/project-cli.mjs.map +1 -1
- package/bootstrap/host/project.mjs +2 -8
- package/bootstrap/host/project.mjs.map +1 -1
- package/browser/README.md +1 -1
- package/compiler/README.md +2 -2
- package/compiler/eliscript-emitter.el +229 -85
- package/compiler/eliscript-ir-emitter.el +64 -34
- package/compiler/eliscript-project.el +20 -5
- package/dist/backends/async.mjs +1 -90
- package/dist/backends/async.mjs.map +1 -1
- package/dist/backends/binary.mjs +1 -91
- package/dist/backends/binary.mjs.map +1 -1
- package/dist/backends/capabilities.mjs +1 -90
- package/dist/backends/capabilities.mjs.map +1 -1
- package/dist/backends/elf.mjs +1 -90
- package/dist/backends/elf.mjs.map +1 -1
- package/dist/backends/managed.mjs +1 -94
- package/dist/backends/managed.mjs.map +1 -1
- package/dist/backends/memory.mjs +1 -90
- package/dist/backends/memory.mjs.map +1 -1
- package/dist/backends/native.mjs +1 -91
- package/dist/backends/native.mjs.map +1 -1
- package/dist/backends/numeric.mjs +1 -90
- package/dist/backends/numeric.mjs.map +1 -1
- package/dist/backends/optimize.mjs +1 -90
- package/dist/backends/optimize.mjs.map +1 -1
- package/dist/backends/regexp.mjs +1 -91
- package/dist/backends/regexp.mjs.map +1 -1
- package/dist/backends/sha256.mjs +2 -96
- package/dist/backends/sha256.mjs.map +1 -1
- package/dist/backends/wasm.mjs +1 -90
- package/dist/backends/wasm.mjs.map +1 -1
- package/dist/bootstrap/analyzer.mjs +1 -95
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +1 -105
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +848 -807
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +1 -96
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +1 -104
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +18 -172
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +1 -92
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/project.mjs +23 -209
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +1 -96
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/source-map.mjs +7 -112
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +7 -114
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +10 -176
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1 -93
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +105 -104
- package/dist/browser/loader.js +1 -1
- package/dist/browser/loader.mjs +5 -124
- package/dist/compiler-artifact.json +1 -1
- package/dist/host/compiler-session.mjs +205 -297
- package/dist/host/compiler-session.mjs.map +1 -1
- package/dist/host/compiler-tools.mjs +1 -91
- package/dist/host/compiler-tools.mjs.map +1 -1
- package/dist/literal-sources/runtime/core/order.eli +32 -10
- package/dist/literal-sources/runtime/core/sequence.eli +69 -28
- package/dist/literal-sources/runtime/core/vector.eli +2 -4
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +5 -5
- package/dist/literal-sources/stdlib/managed-literals.eli +1 -1
- package/dist/package.json +1 -0
- package/dist/runtime/math.mjs +62 -252
- package/dist/runtime/math.mjs.map +1 -1
- package/dist/runtime/prelude.mjs +95 -0
- package/dist/runtime/prelude.mjs.macro-origins.json +1 -0
- package/dist/runtime/prelude.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +1 -95
- package/dist/runtime/unicode-case-data.mjs.map +1 -1
- package/dist/runtime/unicode-case.mjs +3 -97
- package/dist/runtime/unicode-case.mjs.map +1 -1
- package/dist/stage3-release.json +1 -1
- package/editor/README.md +9 -4
- package/editor/eliscript-compat.el +164 -2
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +2 -1
- package/runtime/README.md +21 -1
- package/runtime/core/protocol-impl.mjs +1 -115
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/text-impl.mjs +1 -90
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/vector.eli +1 -1
- package/runtime/core/vector.mjs +0 -9
- package/runtime/emacs-compat.eli +5957 -2
- package/runtime/emacs-compat.mjs +13522 -2295
- package/runtime/emacs-compat.mjs.map +1 -0
- package/runtime/math.mjs +62 -252
- package/runtime/math.mjs.map +1 -1
- package/runtime/prelude.eli +4 -0
- package/runtime/prelude.mjs +95 -0
- package/runtime/prelude.mjs.map +1 -0
- package/runtime/unicode-case-data.mjs +1 -95
- package/runtime/unicode-case-data.mjs.map +1 -1
- package/runtime/unicode-case.mjs +3 -97
- package/runtime/unicode-case.mjs.map +1 -1
- package/stdlib/managed-literals.eli +1 -1
- package/stdlib/managed-runtime-vector.eli +2 -4
- package/tools/backends/compiler-build.mjs +3 -93
- package/tools/backends/compiler-cli.mjs +2 -15
- package/tools/backends/compiler-corpus-bit.mjs +2 -95
- package/tools/backends/compiler-corpus-cli-adapters.mjs +1 -97
- package/tools/backends/compiler-corpus-debugging.mjs +2 -95
- package/tools/backends/compiler-corpus-emitter.mjs +1 -97
- package/tools/backends/compiler-corpus-execution.mjs +2 -108
- package/tools/backends/compiler-corpus-fuzz.mjs +2 -95
- package/tools/backends/compiler-corpus-host-context.mjs +2 -99
- package/tools/backends/compiler-corpus-identity-host.mjs +18 -123
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +0 -9
- package/tools/backends/compiler-corpus-literal-provider.mjs +1 -91
- package/tools/backends/compiler-corpus-managed-adapters.mjs +1 -99
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +2 -113
- package/tools/backends/compiler-corpus-matchers.mjs +3 -106
- package/tools/backends/compiler-corpus-original-program.mjs +1 -91
- package/tools/backends/compiler-corpus-process.mjs +1 -92
- package/tools/backends/compiler-corpus-program-driver.mjs +1 -3
- package/tools/backends/compiler-corpus-project-adapters.mjs +1 -95
- package/tools/backends/compiler-corpus-project-entry-host.mjs +2 -92
- package/tools/backends/compiler-corpus-project-transport.mjs +1 -90
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1 -91
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1 -92
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +1 -91
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +1 -91
- package/tools/backends/compiler-corpus-reference.mjs +1 -90
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +2 -110
- package/tools/backends/compiler-corpus-tools-cli.mjs +1 -95
- package/tools/backends/compiler-corpus-tools-reference.mjs +22 -163
- package/tools/backends/compiler-corpus.mjs +3 -125
- package/tools/backends/compiler-matrix.mjs +1 -92
- package/tools/backends/compiler-package-browser.mjs +1 -90
- package/tools/backends/compiler-package.mjs +3 -95
- package/tools/backends/compiler-unicode-profile-host.mjs +1 -91
- package/tools/backends/dist/bootstrap-js-stages.mjs +1 -91
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs +1 -91
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
- package/tools/backends/dist/record-grid.mjs +1 -91
- package/tools/backends/dist/record-grid.mjs.map +1 -1
- package/tools/backends/dist/release-cli.mjs +4 -94
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/dist/run-artifact.mjs +1 -91
- package/tools/backends/dist/run-artifact.mjs.map +1 -1
- package/tools/backends/eliscript/compiler-corpus-bit.eli +1 -0
- package/tools/backends/managed-foreign-binding.mjs +1 -95
- package/tools/backends/managed-host-lifecycle.mjs +1 -91
- package/tools/backends/managed-host-object-provider.mjs +18 -59
- package/tools/backends/managed-host-object-realm.mjs +1 -91
- package/tools/backends/managed-host-proxy.mjs +9 -18
- package/tools/backends/managed-host-runtime.mjs +3 -105
- package/tools/backends/managed-host.mjs +1 -104
- package/tools/backends/managed-module-graph.mjs +1 -97
- package/tools/backends/managed-runtime.mjs +1 -96
- package/tools/backends/managed-source-view.mjs +13 -108
- package/tools/backends/native-managed-runtime.mjs +1 -91
- package/tools/backends/native-memory.mjs +1 -91
- package/tools/backends/stage3-targets.mjs +1 -91
- package/tools/bootstrap-runtime.el +3 -2
- package/tools/project/project.eli +1 -1
- package/tools/testing/stdlib-bit-corpus-host.mjs +1 -90
- package/tools/testing/stdlib-bit.mjs +1 -90
- package/dist/bootstrap/package.json +0 -1
- package/dist/bootstrap/runtime/math.mjs +0 -1117
- package/dist/bootstrap/runtime/math.mjs.map +0 -1
- package/dist/bootstrap/runtime/unicode-case-data.mjs +0 -10125
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +0 -1
- package/dist/bootstrap/runtime/unicode-case.mjs +0 -281
- package/dist/bootstrap/runtime/unicode-case.mjs.map +0 -1
|
@@ -2,139 +2,23 @@
|
|
|
2
2
|
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
3
|
var __eliscript_tdz_ready_0;
|
|
4
4
|
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("createOriginalCorpusSourceReader"); return createOriginalCorpusSourceReader; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("createOriginalCorpusSourceReader"); return __eliscript_const_error(); }
|
|
6
5
|
var __eliscript_tdz_ready_1;
|
|
7
6
|
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("cloneCompilerCorpusData"); return cloneCompilerCorpusData; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("cloneCompilerCorpusData"); 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("cloneCompilerCorpusModules"); return cloneCompilerCorpusModules; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("cloneCompilerCorpusModules"); return __eliscript_const_error(); }
|
|
12
7
|
var __eliscript_tdz_ready_3;
|
|
13
8
|
function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("literal_suite"); return literal_suite; }
|
|
14
|
-
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("literal_suite"); return __eliscript_const_error(); }
|
|
15
9
|
var __eliscript_tdz_ready_4;
|
|
16
10
|
function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("literal_source"); return literal_source; }
|
|
17
|
-
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("literal_source"); return __eliscript_const_error(); }
|
|
18
11
|
var __eliscript_tdz_ready_5;
|
|
19
12
|
function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("literal_title"); return literal_title; }
|
|
20
|
-
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("literal_title"); return __eliscript_const_error(); }
|
|
21
13
|
var __eliscript_tdz_ready_6;
|
|
22
14
|
function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("request_layouts"); return request_layouts; }
|
|
23
|
-
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("request_layouts"); return __eliscript_const_error(); }
|
|
24
15
|
var __eliscript_tdz_ready_7;
|
|
25
16
|
function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("matcher_records"); return matcher_records; }
|
|
26
|
-
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("matcher_records"); return __eliscript_const_error(); }
|
|
27
17
|
var __eliscript_tdz_ready_8;
|
|
28
18
|
function __eliscript_tdz_read_8() { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("matcher_files"); return matcher_files; }
|
|
29
|
-
function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("matcher_files"); return __eliscript_const_error(); }
|
|
30
|
-
var __eliscript_tdz_ready_9;
|
|
31
|
-
function __eliscript_tdz_read_9() { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("transportOriginalExecutionAssets"); return transportOriginalExecutionAssets; }
|
|
32
|
-
function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("transportOriginalExecutionAssets"); return __eliscript_const_error(); }
|
|
33
|
-
var __eliscript_tdz_ready_10;
|
|
34
|
-
function __eliscript_tdz_read_10() { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("transportOriginalToolsDataReferenceAssets"); return transportOriginalToolsDataReferenceAssets; }
|
|
35
|
-
function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("transportOriginalToolsDataReferenceAssets"); return __eliscript_const_error(); }
|
|
36
|
-
var __eliscript_tdz_ready_11;
|
|
37
|
-
function __eliscript_tdz_read_11() { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("bindOriginalFunctionalResourceInputs"); return bindOriginalFunctionalResourceInputs; }
|
|
38
|
-
function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("bindOriginalFunctionalResourceInputs"); return __eliscript_const_error(); }
|
|
39
|
-
var __eliscript_tdz_ready_12;
|
|
40
|
-
function __eliscript_tdz_read_12() { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("transportOriginalProjectRuntimeAssets"); return transportOriginalProjectRuntimeAssets; }
|
|
41
|
-
function __eliscript_tdz_write_12(__eliscript_tdz_value_12) { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("transportOriginalProjectRuntimeAssets"); return __eliscript_const_error(); }
|
|
42
|
-
var __eliscript_tdz_ready_13;
|
|
43
|
-
function __eliscript_tdz_read_13() { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("transportOriginalToolsCLIAssets"); return transportOriginalToolsCLIAssets; }
|
|
44
|
-
function __eliscript_tdz_write_13(__eliscript_tdz_value_13) { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("transportOriginalToolsCLIAssets"); return __eliscript_const_error(); }
|
|
45
19
|
import "eliscript/runtime/unicode-case.mjs";
|
|
46
|
-
import {
|
|
20
|
+
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";
|
|
47
21
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
48
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
49
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
50
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
51
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
52
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
53
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
54
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
55
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
56
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
57
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
58
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
59
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
60
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
61
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
62
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
63
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
64
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
65
|
-
}
|
|
66
|
-
for (let index = 0; index < 2; index++) {
|
|
67
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
68
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
69
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
70
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
74
|
-
};
|
|
75
|
-
const __eliscript_to_number = (value) => {
|
|
76
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
77
|
-
if (typeof primitive === "string") {
|
|
78
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
79
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
80
|
-
let first = 2;
|
|
81
|
-
while (first < text.length && text[first] === "0") first++;
|
|
82
|
-
if (first === text.length) return 0;
|
|
83
|
-
const prefix = text[1];
|
|
84
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
85
|
-
if (text.length - first > limit) return 1 / 0;
|
|
86
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
87
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return __eliscript_number_intrinsic(primitive);
|
|
91
|
-
};
|
|
92
|
-
const __eliscript_numeric = (value) => {
|
|
93
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
94
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
95
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
96
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
97
|
-
};
|
|
98
|
-
const __eliscript_implicit_number = (value) => {
|
|
99
|
-
if (typeof value === "number") return value;
|
|
100
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
101
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
102
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
103
|
-
};
|
|
104
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
105
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
106
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
107
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
108
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
109
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
110
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
111
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
112
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
113
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
114
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
115
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
116
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
117
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
118
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
119
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
120
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
121
|
-
if (operator === "<") return left < right;
|
|
122
|
-
if (operator === "<=") return left <= right;
|
|
123
|
-
if (operator === ">") return left > right;
|
|
124
|
-
return left >= right;
|
|
125
|
-
}
|
|
126
|
-
let a = __eliscript_numeric_primitive(left);
|
|
127
|
-
let b = __eliscript_numeric_primitive(right);
|
|
128
|
-
const x = typeof a, y = typeof b;
|
|
129
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
130
|
-
a = __eliscript_numeric(a);
|
|
131
|
-
b = __eliscript_numeric(b);
|
|
132
|
-
}
|
|
133
|
-
if (operator === "<") return a < b;
|
|
134
|
-
if (operator === "<=") return a <= b;
|
|
135
|
-
if (operator === ">") return a > b;
|
|
136
|
-
return a >= b;
|
|
137
|
-
};
|
|
138
22
|
|
|
139
23
|
import {createHash} from "node:crypto";
|
|
140
24
|
import {Buffer} from "node:buffer";
|
|
@@ -155,7 +39,6 @@ __eliscript_tdz_ready_0 = true;
|
|
|
155
39
|
const cloneCompilerCorpusData = (legacy)["cloneCompilerCorpusData"];
|
|
156
40
|
__eliscript_tdz_ready_1 = true;
|
|
157
41
|
const cloneCompilerCorpusModules = (legacy)["cloneCompilerCorpusModules"];
|
|
158
|
-
__eliscript_tdz_ready_2 = true;
|
|
159
42
|
const literal_suite = "tests/literal-runtime.test.mjs";
|
|
160
43
|
__eliscript_tdz_ready_3 = true;
|
|
161
44
|
const literal_source = "tests/eliscript/literal-runtime.eli";
|
|
@@ -1642,7 +1525,7 @@ async function tools_data_reference_assets(document, options) {
|
|
|
1642
1525
|
return document;
|
|
1643
1526
|
})());
|
|
1644
1527
|
})(0));
|
|
1645
|
-
})(["tools/backends/eliscript/compiler-corpus-tools-reference.eli", "tools/backends/compiler-corpus-tools-reference.mjs", "runtime/unicode-case.eli", "runtime/unicode-case.mjs", "runtime/unicode-case-data.eli", "runtime/unicode-case-data.mjs"]));
|
|
1528
|
+
})(["tools/backends/eliscript/compiler-corpus-tools-reference.eli", "tools/backends/compiler-corpus-tools-reference.mjs", "runtime/prelude.eli", "runtime/prelude.mjs", "runtime/unicode-case.eli", "runtime/unicode-case.mjs", "runtime/unicode-case-data.eli", "runtime/unicode-case-data.mjs"]));
|
|
1646
1529
|
})([]));
|
|
1647
1530
|
})((__eliscript_tdz_read_0())(options)));
|
|
1648
1531
|
})(((document)["records"])["filter"](((record) => {
|
|
@@ -1654,7 +1537,7 @@ async function project_runtime_assets(document, options) {
|
|
|
1654
1537
|
(await (async (records) => {
|
|
1655
1538
|
return (await (async (files) => {
|
|
1656
1539
|
return (__eliscript_numeric_relation(">", ((records) ?? []).length, 0) ? (await (async () => {
|
|
1657
|
-
(["math", "unicode-case", "unicode-case-data"])["forEach"](((name) => {
|
|
1540
|
+
(["math", "prelude", "unicode-case", "unicode-case-data"])["forEach"](((name) => {
|
|
1658
1541
|
return (files)["push"]((String("runtime/") + String(name) + String(".eli")), (String("runtime/") + String(name) + String(".mjs")), (String("runtime/") + String(name) + String(".mjs.map")));
|
|
1659
1542
|
}));
|
|
1660
1543
|
return (await (async (reader) => {
|
|
@@ -2041,14 +1924,9 @@ async function loadOriginalCompilerCorpus(options) {
|
|
|
2041
1924
|
})((options)["sourceRoot"]));
|
|
2042
1925
|
}
|
|
2043
1926
|
const transportOriginalExecutionAssets = maintained_execution_assets;
|
|
2044
|
-
__eliscript_tdz_ready_9 = true;
|
|
2045
1927
|
const transportOriginalToolsDataReferenceAssets = tools_data_reference_assets;
|
|
2046
|
-
__eliscript_tdz_ready_10 = true;
|
|
2047
1928
|
const bindOriginalFunctionalResourceInputs = bind_complete_library_resource_inputs;
|
|
2048
|
-
__eliscript_tdz_ready_11 = true;
|
|
2049
1929
|
const transportOriginalProjectRuntimeAssets = project_runtime_assets;
|
|
2050
|
-
__eliscript_tdz_ready_12 = true;
|
|
2051
1930
|
const transportOriginalToolsCLIAssets = tools_cli_assets;
|
|
2052
|
-
__eliscript_tdz_ready_13 = true;
|
|
2053
1931
|
export {createOriginalCorpusSourceReader, cloneCompilerCorpusData, cloneCompilerCorpusModules, compilerCorpusRequest, prepareOriginalSeedSources, loadOriginalCompilerCorpus, readOriginalLiteralRuntimeAudit, transportOriginalMatcherRecord, bindOriginalMaintainedSuiteEvidence, bindOriginalRuntimeScanReportEvidence, transportOriginalProjectRuntimeAssets, transportOriginalToolsCLIAssets, transportOriginalExecutionAssets, transportOriginalToolsDataReferenceAssets, bindOriginalFunctionalResourceInputs, originalSequenceNativeInteropP, transportOriginalSequenceRuntime, compilerCorpusFunctionalResources, compilerCorpusResourceDeferred};
|
|
2054
1932
|
//# sourceMappingURL=compiler-corpus.mjs.map
|
|
@@ -2,100 +2,9 @@
|
|
|
2
2
|
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
3
|
var __eliscript_tdz_ready_0;
|
|
4
4
|
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("original_manifests"); return original_manifests; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("original_manifests"); return __eliscript_const_error(); }
|
|
6
5
|
import "eliscript/runtime/unicode-case.mjs";
|
|
7
|
-
import {
|
|
6
|
+
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";
|
|
8
7
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
9
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
10
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
11
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
12
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
13
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
14
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
15
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
16
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
17
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
18
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
19
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
20
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
21
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
22
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
23
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
24
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
25
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
26
|
-
}
|
|
27
|
-
for (let index = 0; index < 2; index++) {
|
|
28
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
29
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
30
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
31
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
35
|
-
};
|
|
36
|
-
const __eliscript_to_number = (value) => {
|
|
37
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
38
|
-
if (typeof primitive === "string") {
|
|
39
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
40
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
41
|
-
let first = 2;
|
|
42
|
-
while (first < text.length && text[first] === "0") first++;
|
|
43
|
-
if (first === text.length) return 0;
|
|
44
|
-
const prefix = text[1];
|
|
45
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
46
|
-
if (text.length - first > limit) return 1 / 0;
|
|
47
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
48
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return __eliscript_number_intrinsic(primitive);
|
|
52
|
-
};
|
|
53
|
-
const __eliscript_numeric = (value) => {
|
|
54
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
55
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
56
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
57
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
58
|
-
};
|
|
59
|
-
const __eliscript_implicit_number = (value) => {
|
|
60
|
-
if (typeof value === "number") return value;
|
|
61
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
62
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
63
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
64
|
-
};
|
|
65
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
66
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
67
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
68
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
69
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
70
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
71
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
72
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
73
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
74
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
75
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
76
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
77
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
78
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
79
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
80
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
81
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
82
|
-
if (operator === "<") return left < right;
|
|
83
|
-
if (operator === "<=") return left <= right;
|
|
84
|
-
if (operator === ">") return left > right;
|
|
85
|
-
return left >= right;
|
|
86
|
-
}
|
|
87
|
-
let a = __eliscript_numeric_primitive(left);
|
|
88
|
-
let b = __eliscript_numeric_primitive(right);
|
|
89
|
-
const x = typeof a, y = typeof b;
|
|
90
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
91
|
-
a = __eliscript_numeric(a);
|
|
92
|
-
b = __eliscript_numeric(b);
|
|
93
|
-
}
|
|
94
|
-
if (operator === "<") return a < b;
|
|
95
|
-
if (operator === "<=") return a <= b;
|
|
96
|
-
if (operator === ">") return a > b;
|
|
97
|
-
return a >= b;
|
|
98
|
-
};
|
|
99
8
|
|
|
100
9
|
import {mkdir, readFile, writeFile, mkdtemp} from "node:fs/promises";
|
|
101
10
|
import {resolve, join, relative} from "node:path";
|
|
@@ -1,96 +1,7 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
2
|
import "eliscript/runtime/unicode-case.mjs";
|
|
3
|
+
import { __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
3
4
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
4
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
5
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
6
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
7
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
8
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
9
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
10
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
11
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
12
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
13
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
14
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
15
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
16
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
17
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
18
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
19
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
20
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
21
|
-
}
|
|
22
|
-
for (let index = 0; index < 2; index++) {
|
|
23
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
24
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
25
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
26
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
30
|
-
};
|
|
31
|
-
const __eliscript_to_number = (value) => {
|
|
32
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
33
|
-
if (typeof primitive === "string") {
|
|
34
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
35
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
36
|
-
let first = 2;
|
|
37
|
-
while (first < text.length && text[first] === "0") first++;
|
|
38
|
-
if (first === text.length) return 0;
|
|
39
|
-
const prefix = text[1];
|
|
40
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
41
|
-
if (text.length - first > limit) return 1 / 0;
|
|
42
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
43
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return __eliscript_number_intrinsic(primitive);
|
|
47
|
-
};
|
|
48
|
-
const __eliscript_numeric = (value) => {
|
|
49
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
50
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
51
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
52
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
53
|
-
};
|
|
54
|
-
const __eliscript_implicit_number = (value) => {
|
|
55
|
-
if (typeof value === "number") return value;
|
|
56
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
57
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
58
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
59
|
-
};
|
|
60
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
61
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
62
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
63
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
64
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
65
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
66
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
67
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
68
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
69
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
70
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
71
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
72
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
73
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
74
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
75
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
76
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
77
|
-
if (operator === "<") return left < right;
|
|
78
|
-
if (operator === "<=") return left <= right;
|
|
79
|
-
if (operator === ">") return left > right;
|
|
80
|
-
return left >= right;
|
|
81
|
-
}
|
|
82
|
-
let a = __eliscript_numeric_primitive(left);
|
|
83
|
-
let b = __eliscript_numeric_primitive(right);
|
|
84
|
-
const x = typeof a, y = typeof b;
|
|
85
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
86
|
-
a = __eliscript_numeric(a);
|
|
87
|
-
b = __eliscript_numeric(b);
|
|
88
|
-
}
|
|
89
|
-
if (operator === "<") return a < b;
|
|
90
|
-
if (operator === "<=") return a <= b;
|
|
91
|
-
if (operator === ">") return a > b;
|
|
92
|
-
return a >= b;
|
|
93
|
-
};
|
|
94
5
|
|
|
95
6
|
import * as original from "./compiler-browser.mjs";
|
|
96
7
|
function browser_options(input, fields) {
|
|
@@ -2,103 +2,11 @@
|
|
|
2
2
|
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
3
|
var __eliscript_tdz_ready_0;
|
|
4
4
|
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("retained_transports"); return retained_transports; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("retained_transports"); return __eliscript_const_error(); }
|
|
6
5
|
var __eliscript_tdz_ready_1;
|
|
7
6
|
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("frontend_support"); return frontend_support; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("frontend_support"); return __eliscript_const_error(); }
|
|
9
7
|
import "eliscript/runtime/unicode-case.mjs";
|
|
10
|
-
import {
|
|
8
|
+
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";
|
|
11
9
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
12
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
13
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
14
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
15
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
16
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
17
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
18
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
19
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
20
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
21
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
22
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
23
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
24
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
25
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
26
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
27
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
28
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
29
|
-
}
|
|
30
|
-
for (let index = 0; index < 2; index++) {
|
|
31
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
32
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
33
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
34
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
38
|
-
};
|
|
39
|
-
const __eliscript_to_number = (value) => {
|
|
40
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
41
|
-
if (typeof primitive === "string") {
|
|
42
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
43
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
44
|
-
let first = 2;
|
|
45
|
-
while (first < text.length && text[first] === "0") first++;
|
|
46
|
-
if (first === text.length) return 0;
|
|
47
|
-
const prefix = text[1];
|
|
48
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
49
|
-
if (text.length - first > limit) return 1 / 0;
|
|
50
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
51
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return __eliscript_number_intrinsic(primitive);
|
|
55
|
-
};
|
|
56
|
-
const __eliscript_numeric = (value) => {
|
|
57
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
58
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
59
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
60
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
61
|
-
};
|
|
62
|
-
const __eliscript_implicit_number = (value) => {
|
|
63
|
-
if (typeof value === "number") return value;
|
|
64
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
65
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
66
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
67
|
-
};
|
|
68
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
69
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
70
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
71
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
72
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
73
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
74
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
75
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
76
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
77
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
78
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
79
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
80
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
81
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
82
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
83
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
84
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
85
|
-
if (operator === "<") return left < right;
|
|
86
|
-
if (operator === "<=") return left <= right;
|
|
87
|
-
if (operator === ">") return left > right;
|
|
88
|
-
return left >= right;
|
|
89
|
-
}
|
|
90
|
-
let a = __eliscript_numeric_primitive(left);
|
|
91
|
-
let b = __eliscript_numeric_primitive(right);
|
|
92
|
-
const x = typeof a, y = typeof b;
|
|
93
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
94
|
-
a = __eliscript_numeric(a);
|
|
95
|
-
b = __eliscript_numeric(b);
|
|
96
|
-
}
|
|
97
|
-
if (operator === "<") return a < b;
|
|
98
|
-
if (operator === "<=") return a <= b;
|
|
99
|
-
if (operator === ">") return a > b;
|
|
100
|
-
return a >= b;
|
|
101
|
-
};
|
|
102
10
|
|
|
103
11
|
import {copyFile, open, mkdir, readFile, writeFile} from "node:fs/promises";
|
|
104
12
|
import {resolve, basename, dirname} from "node:path";
|
|
@@ -223,7 +131,7 @@ async function complete_frontend_support(result, source_root) {
|
|
|
223
131
|
}
|
|
224
132
|
return null;
|
|
225
133
|
})());
|
|
226
|
-
})(["math", "unicode-case", "unicode-case-data"], 0));
|
|
134
|
+
})(["math", "prelude", "unicode-case", "unicode-case-data"], 0));
|
|
227
135
|
((index = (index + 1)));
|
|
228
136
|
}
|
|
229
137
|
return null;
|
|
@@ -233,7 +141,7 @@ async function complete_frontend_support(result, source_root) {
|
|
|
233
141
|
return (await (async () => {
|
|
234
142
|
while (__eliscript_numeric_relation("<", index, ((scopes) ?? []).length)) {
|
|
235
143
|
(await (async (path) => {
|
|
236
|
-
return await (publish_runtime_scope(result, path, ((path === "runtime/package.json") ? ({"./runtime/math.mjs": "./math.mjs", "./runtime/unicode-case.mjs": "./unicode-case.mjs", "./runtime/unicode-case-data.mjs": "./unicode-case-data.mjs"}) : ({"./runtime/math.mjs": "./runtime/math.mjs", "./runtime/unicode-case.mjs": "./runtime/unicode-case.mjs", "./runtime/unicode-case-data.mjs": "./runtime/unicode-case-data.mjs"}))));
|
|
144
|
+
return await (publish_runtime_scope(result, path, ((path === "runtime/package.json") ? ({"./runtime/math.mjs": "./math.mjs", "./runtime/prelude.mjs": "./prelude.mjs", "./runtime/unicode-case.mjs": "./unicode-case.mjs", "./runtime/unicode-case-data.mjs": "./unicode-case-data.mjs"}) : ({"./runtime/math.mjs": "./runtime/math.mjs", "./runtime/prelude.mjs": "./runtime/prelude.mjs", "./runtime/unicode-case.mjs": "./runtime/unicode-case.mjs", "./runtime/unicode-case-data.mjs": "./runtime/unicode-case-data.mjs"}))));
|
|
237
145
|
})((scopes)[index]));
|
|
238
146
|
((index = (index + 1)));
|
|
239
147
|
}
|