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.
Files changed (185) hide show
  1. package/README.md +9 -8
  2. package/bootstrap/compiler/emitter.eli +161 -63
  3. package/bootstrap/host/check-cli.mjs +0 -1
  4. package/bootstrap/host/check-cli.mjs.map +1 -1
  5. package/bootstrap/host/compiler-session.eli +2 -1
  6. package/bootstrap/host/eliscript-cli.mjs +2 -9
  7. package/bootstrap/host/eliscript-cli.mjs.map +1 -1
  8. package/bootstrap/host/project-cli.mjs +1 -11
  9. package/bootstrap/host/project-cli.mjs.map +1 -1
  10. package/bootstrap/host/project.mjs +2 -8
  11. package/bootstrap/host/project.mjs.map +1 -1
  12. package/browser/README.md +1 -1
  13. package/compiler/README.md +2 -2
  14. package/compiler/eliscript-emitter.el +229 -85
  15. package/compiler/eliscript-ir-emitter.el +64 -34
  16. package/compiler/eliscript-project.el +20 -5
  17. package/dist/backends/async.mjs +1 -90
  18. package/dist/backends/async.mjs.map +1 -1
  19. package/dist/backends/binary.mjs +1 -91
  20. package/dist/backends/binary.mjs.map +1 -1
  21. package/dist/backends/capabilities.mjs +1 -90
  22. package/dist/backends/capabilities.mjs.map +1 -1
  23. package/dist/backends/elf.mjs +1 -90
  24. package/dist/backends/elf.mjs.map +1 -1
  25. package/dist/backends/managed.mjs +1 -94
  26. package/dist/backends/managed.mjs.map +1 -1
  27. package/dist/backends/memory.mjs +1 -90
  28. package/dist/backends/memory.mjs.map +1 -1
  29. package/dist/backends/native.mjs +1 -91
  30. package/dist/backends/native.mjs.map +1 -1
  31. package/dist/backends/numeric.mjs +1 -90
  32. package/dist/backends/numeric.mjs.map +1 -1
  33. package/dist/backends/optimize.mjs +1 -90
  34. package/dist/backends/optimize.mjs.map +1 -1
  35. package/dist/backends/regexp.mjs +1 -91
  36. package/dist/backends/regexp.mjs.map +1 -1
  37. package/dist/backends/sha256.mjs +2 -96
  38. package/dist/backends/sha256.mjs.map +1 -1
  39. package/dist/backends/wasm.mjs +1 -90
  40. package/dist/backends/wasm.mjs.map +1 -1
  41. package/dist/bootstrap/analyzer.mjs +1 -95
  42. package/dist/bootstrap/analyzer.mjs.map +1 -1
  43. package/dist/bootstrap/compiler.mjs +1 -105
  44. package/dist/bootstrap/compiler.mjs.map +1 -1
  45. package/dist/bootstrap/emitter.mjs +848 -807
  46. package/dist/bootstrap/emitter.mjs.map +1 -1
  47. package/dist/bootstrap/expander.mjs +1 -96
  48. package/dist/bootstrap/expander.mjs.map +1 -1
  49. package/dist/bootstrap/formatter.mjs +1 -104
  50. package/dist/bootstrap/formatter.mjs.map +1 -1
  51. package/dist/bootstrap/ir.mjs +18 -172
  52. package/dist/bootstrap/ir.mjs.map +1 -1
  53. package/dist/bootstrap/lower.mjs +1 -92
  54. package/dist/bootstrap/lower.mjs.map +1 -1
  55. package/dist/bootstrap/project.mjs +23 -209
  56. package/dist/bootstrap/project.mjs.map +1 -1
  57. package/dist/bootstrap/reader.mjs +1 -96
  58. package/dist/bootstrap/reader.mjs.map +1 -1
  59. package/dist/bootstrap/source-map.mjs +7 -112
  60. package/dist/bootstrap/source-map.mjs.map +1 -1
  61. package/dist/bootstrap/symbol.mjs +7 -114
  62. package/dist/bootstrap/symbol.mjs.map +1 -1
  63. package/dist/bootstrap/syntax.mjs +10 -176
  64. package/dist/bootstrap/syntax.mjs.map +1 -1
  65. package/dist/bootstrap/transient-analysis.mjs +1 -93
  66. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  67. package/dist/browser/compiler.js +105 -104
  68. package/dist/browser/loader.js +1 -1
  69. package/dist/browser/loader.mjs +5 -124
  70. package/dist/compiler-artifact.json +1 -1
  71. package/dist/host/compiler-session.mjs +205 -297
  72. package/dist/host/compiler-session.mjs.map +1 -1
  73. package/dist/host/compiler-tools.mjs +1 -91
  74. package/dist/host/compiler-tools.mjs.map +1 -1
  75. package/dist/literal-sources/runtime/core/order.eli +32 -10
  76. package/dist/literal-sources/runtime/core/sequence.eli +69 -28
  77. package/dist/literal-sources/runtime/core/vector.eli +2 -4
  78. package/dist/literal-sources/stdlib/managed-literal-protocols.eli +5 -5
  79. package/dist/literal-sources/stdlib/managed-literals.eli +1 -1
  80. package/dist/package.json +1 -0
  81. package/dist/runtime/math.mjs +62 -252
  82. package/dist/runtime/math.mjs.map +1 -1
  83. package/dist/runtime/prelude.mjs +95 -0
  84. package/dist/runtime/prelude.mjs.macro-origins.json +1 -0
  85. package/dist/runtime/prelude.mjs.map +1 -0
  86. package/dist/runtime/unicode-case-data.mjs +1 -95
  87. package/dist/runtime/unicode-case-data.mjs.map +1 -1
  88. package/dist/runtime/unicode-case.mjs +3 -97
  89. package/dist/runtime/unicode-case.mjs.map +1 -1
  90. package/dist/stage3-release.json +1 -1
  91. package/editor/README.md +9 -4
  92. package/editor/eliscript-compat.el +164 -2
  93. package/editor/eliscript-mode.el +1 -1
  94. package/editor/eliscript-repl.el +1 -1
  95. package/package.json +2 -1
  96. package/runtime/README.md +21 -1
  97. package/runtime/core/protocol-impl.mjs +1 -115
  98. package/runtime/core/protocol-impl.mjs.map +1 -1
  99. package/runtime/core/text-impl.mjs +1 -90
  100. package/runtime/core/text-impl.mjs.map +1 -1
  101. package/runtime/core/vector.eli +1 -1
  102. package/runtime/core/vector.mjs +0 -9
  103. package/runtime/emacs-compat.eli +5957 -2
  104. package/runtime/emacs-compat.mjs +13522 -2295
  105. package/runtime/emacs-compat.mjs.map +1 -0
  106. package/runtime/math.mjs +62 -252
  107. package/runtime/math.mjs.map +1 -1
  108. package/runtime/prelude.eli +4 -0
  109. package/runtime/prelude.mjs +95 -0
  110. package/runtime/prelude.mjs.map +1 -0
  111. package/runtime/unicode-case-data.mjs +1 -95
  112. package/runtime/unicode-case-data.mjs.map +1 -1
  113. package/runtime/unicode-case.mjs +3 -97
  114. package/runtime/unicode-case.mjs.map +1 -1
  115. package/stdlib/managed-literals.eli +1 -1
  116. package/stdlib/managed-runtime-vector.eli +2 -4
  117. package/tools/backends/compiler-build.mjs +3 -93
  118. package/tools/backends/compiler-cli.mjs +2 -15
  119. package/tools/backends/compiler-corpus-bit.mjs +2 -95
  120. package/tools/backends/compiler-corpus-cli-adapters.mjs +1 -97
  121. package/tools/backends/compiler-corpus-debugging.mjs +2 -95
  122. package/tools/backends/compiler-corpus-emitter.mjs +1 -97
  123. package/tools/backends/compiler-corpus-execution.mjs +2 -108
  124. package/tools/backends/compiler-corpus-fuzz.mjs +2 -95
  125. package/tools/backends/compiler-corpus-host-context.mjs +2 -99
  126. package/tools/backends/compiler-corpus-identity-host.mjs +18 -123
  127. package/tools/backends/compiler-corpus-identity-value-adapters.mjs +0 -9
  128. package/tools/backends/compiler-corpus-literal-provider.mjs +1 -91
  129. package/tools/backends/compiler-corpus-managed-adapters.mjs +1 -99
  130. package/tools/backends/compiler-corpus-managed-fixtures.mjs +2 -113
  131. package/tools/backends/compiler-corpus-matchers.mjs +3 -106
  132. package/tools/backends/compiler-corpus-original-program.mjs +1 -91
  133. package/tools/backends/compiler-corpus-process.mjs +1 -92
  134. package/tools/backends/compiler-corpus-program-driver.mjs +1 -3
  135. package/tools/backends/compiler-corpus-project-adapters.mjs +1 -95
  136. package/tools/backends/compiler-corpus-project-entry-host.mjs +2 -92
  137. package/tools/backends/compiler-corpus-project-transport.mjs +1 -90
  138. package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1 -91
  139. package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1 -92
  140. package/tools/backends/compiler-corpus-raw-math-fixture.mjs +1 -91
  141. package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +1 -91
  142. package/tools/backends/compiler-corpus-reference.mjs +1 -90
  143. package/tools/backends/compiler-corpus-runtime-adapters.mjs +2 -110
  144. package/tools/backends/compiler-corpus-tools-cli.mjs +1 -95
  145. package/tools/backends/compiler-corpus-tools-reference.mjs +22 -163
  146. package/tools/backends/compiler-corpus.mjs +3 -125
  147. package/tools/backends/compiler-matrix.mjs +1 -92
  148. package/tools/backends/compiler-package-browser.mjs +1 -90
  149. package/tools/backends/compiler-package.mjs +3 -95
  150. package/tools/backends/compiler-unicode-profile-host.mjs +1 -91
  151. package/tools/backends/dist/bootstrap-js-stages.mjs +1 -91
  152. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
  153. package/tools/backends/dist/managed-ir-inventory.mjs +1 -91
  154. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
  155. package/tools/backends/dist/record-grid.mjs +1 -91
  156. package/tools/backends/dist/record-grid.mjs.map +1 -1
  157. package/tools/backends/dist/release-cli.mjs +4 -94
  158. package/tools/backends/dist/release-cli.mjs.map +1 -1
  159. package/tools/backends/dist/run-artifact.mjs +1 -91
  160. package/tools/backends/dist/run-artifact.mjs.map +1 -1
  161. package/tools/backends/eliscript/compiler-corpus-bit.eli +1 -0
  162. package/tools/backends/managed-foreign-binding.mjs +1 -95
  163. package/tools/backends/managed-host-lifecycle.mjs +1 -91
  164. package/tools/backends/managed-host-object-provider.mjs +18 -59
  165. package/tools/backends/managed-host-object-realm.mjs +1 -91
  166. package/tools/backends/managed-host-proxy.mjs +9 -18
  167. package/tools/backends/managed-host-runtime.mjs +3 -105
  168. package/tools/backends/managed-host.mjs +1 -104
  169. package/tools/backends/managed-module-graph.mjs +1 -97
  170. package/tools/backends/managed-runtime.mjs +1 -96
  171. package/tools/backends/managed-source-view.mjs +13 -108
  172. package/tools/backends/native-managed-runtime.mjs +1 -91
  173. package/tools/backends/native-memory.mjs +1 -91
  174. package/tools/backends/stage3-targets.mjs +1 -91
  175. package/tools/bootstrap-runtime.el +3 -2
  176. package/tools/project/project.eli +1 -1
  177. package/tools/testing/stdlib-bit-corpus-host.mjs +1 -90
  178. package/tools/testing/stdlib-bit.mjs +1 -90
  179. package/dist/bootstrap/package.json +0 -1
  180. package/dist/bootstrap/runtime/math.mjs +0 -1117
  181. package/dist/bootstrap/runtime/math.mjs.map +0 -1
  182. package/dist/bootstrap/runtime/unicode-case-data.mjs +0 -10125
  183. package/dist/bootstrap/runtime/unicode-case-data.mjs.map +0 -1
  184. package/dist/bootstrap/runtime/unicode-case.mjs +0 -281
  185. package/dist/bootstrap/runtime/unicode-case.mjs.map +0 -1
@@ -1,199 +1,33 @@
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("syntax_filename_key"); return syntax_filename_key; }
5
- function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("syntax_filename_key"); 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("syntax_start_key"); return syntax_start_key; }
8
- function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("syntax_start_key"); 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("syntax_end_key"); return syntax_end_key; }
11
- function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("syntax_end_key"); 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("syntax_line_key"); return syntax_line_key; }
14
- function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("syntax_line_key"); 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("syntax_column_key"); return syntax_column_key; }
17
- function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("syntax_column_key"); 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("syntax_end_line_key"); return syntax_end_line_key; }
20
- function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("syntax_end_line_key"); return __eliscript_const_error(); }
21
- var __eliscript_tdz_ready_6;
22
- function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("syntax_end_column_key"); return syntax_end_column_key; }
23
- function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("syntax_end_column_key"); return __eliscript_const_error(); }
24
- var __eliscript_tdz_ready_7;
25
- function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("syntax_kind_key"); return syntax_kind_key; }
26
- function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("syntax_kind_key"); return __eliscript_const_error(); }
27
- var __eliscript_tdz_ready_8;
28
- function __eliscript_tdz_read_8() { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("syntax_value_key"); return syntax_value_key; }
29
- function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("syntax_value_key"); 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("syntax_span_key"); return syntax_span_key; }
32
- function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("syntax_span_key"); 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("syntax_name_key"); return syntax_name_key; }
35
- function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("syntax_name_key"); 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("syntax_items_key"); return syntax_items_key; }
38
- function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("syntax_items_key"); 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("syntax_literal_kind"); return syntax_literal_kind; }
41
- function __eliscript_tdz_write_12(__eliscript_tdz_value_12) { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("syntax_literal_kind"); 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("syntax_undefined_kind"); return syntax_undefined_kind; }
44
- function __eliscript_tdz_write_13(__eliscript_tdz_value_13) { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("syntax_undefined_kind"); return __eliscript_const_error(); }
45
- var __eliscript_tdz_ready_14;
46
- function __eliscript_tdz_read_14() { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("syntax_symbol_kind"); return syntax_symbol_kind; }
47
- function __eliscript_tdz_write_14(__eliscript_tdz_value_14) { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("syntax_symbol_kind"); return __eliscript_const_error(); }
48
- var __eliscript_tdz_ready_15;
49
- function __eliscript_tdz_read_15() { if (__eliscript_tdz_ready_15 !== true) __eliscript_tdz_error("syntax_keyword_kind"); return syntax_keyword_kind; }
50
- function __eliscript_tdz_write_15(__eliscript_tdz_value_15) { if (__eliscript_tdz_ready_15 !== true) __eliscript_tdz_error("syntax_keyword_kind"); return __eliscript_const_error(); }
51
- var __eliscript_tdz_ready_16;
52
- function __eliscript_tdz_read_16() { if (__eliscript_tdz_ready_16 !== true) __eliscript_tdz_error("syntax_list_kind"); return syntax_list_kind; }
53
- function __eliscript_tdz_write_16(__eliscript_tdz_value_16) { if (__eliscript_tdz_ready_16 !== true) __eliscript_tdz_error("syntax_list_kind"); return __eliscript_const_error(); }
54
- var __eliscript_tdz_ready_17;
55
- function __eliscript_tdz_read_17() { if (__eliscript_tdz_ready_17 !== true) __eliscript_tdz_error("syntax_vector_kind"); return syntax_vector_kind; }
56
- function __eliscript_tdz_write_17(__eliscript_tdz_value_17) { if (__eliscript_tdz_ready_17 !== true) __eliscript_tdz_error("syntax_vector_kind"); return __eliscript_const_error(); }
57
- var __eliscript_tdz_ready_18;
58
- function __eliscript_tdz_read_18() { if (__eliscript_tdz_ready_18 !== true) __eliscript_tdz_error("syntax_small_positions"); return syntax_small_positions; }
59
- function __eliscript_tdz_write_18(__eliscript_tdz_value_18) { if (__eliscript_tdz_ready_18 !== true) __eliscript_tdz_error("syntax_small_positions"); return __eliscript_const_error(); }
60
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";
61
4
  const __eliscript_truthy = (value) => value !== false && value != null;
62
- const __eliscript_number_intrinsic = globalThis.Number;
63
- const __eliscript_bigint_intrinsic = globalThis.BigInt;
64
- const __eliscript_numeric_apply = globalThis.Reflect.apply;
65
- const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
66
- const __eliscript_numeric_error = globalThis.TypeError;
67
- const __eliscript_numeric_trim = globalThis.String.prototype.trim;
68
- const __eliscript_numeric_slice = globalThis.String.prototype.slice;
69
- const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
70
- const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
71
- const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
72
- const __eliscript_numeric_primitive = (value) => {
73
- if (!__eliscript_numeric_object(value)) return value;
74
- const exotic = value[__eliscript_numeric_symbol];
75
- if (exotic !== void 0 && exotic !== null) {
76
- const result = __eliscript_numeric_apply(exotic, value, ["number"]);
77
- if (!__eliscript_numeric_object(result)) return result;
78
- throw new __eliscript_numeric_error("Cannot convert object to primitive value");
79
- }
80
- for (let index = 0; index < 2; index++) {
81
- const method = value[index === 0 ? "valueOf" : "toString"];
82
- if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
83
- const result = __eliscript_numeric_apply(method, value, []);
84
- if (!__eliscript_numeric_object(result)) return result;
85
- }
86
- }
87
- throw new __eliscript_numeric_error("Cannot convert object to primitive value");
88
- };
89
- const __eliscript_to_number = (value) => {
90
- const primitive = __eliscript_numeric_primitive(value);
91
- if (typeof primitive === "string") {
92
- const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
93
- if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
94
- let first = 2;
95
- while (first < text.length && text[first] === "0") first++;
96
- if (first === text.length) return 0;
97
- const prefix = text[1];
98
- const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
99
- if (text.length - first > limit) return 1 / 0;
100
- const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
101
- return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
102
- }
103
- }
104
- return __eliscript_number_intrinsic(primitive);
105
- };
106
- const __eliscript_numeric = (value) => {
107
- if (typeof value === "number" || typeof value === "bigint") return value;
108
- const primitive = __eliscript_numeric_primitive(value);
109
- if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
110
- return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
111
- };
112
- const __eliscript_implicit_number = (value) => {
113
- if (typeof value === "number") return value;
114
- const primitive = __eliscript_numeric_primitive(value);
115
- if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
116
- return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
117
- };
118
- const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
119
- const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
120
- const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
121
- const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
122
- const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
123
- const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
124
- const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
125
- const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
126
- const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
127
- const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
128
- const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
129
- const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
130
- const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
131
- const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
132
- const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
133
- const __eliscript_numeric_relation = (operator, left, right) => {
134
- if (typeof left === "number" && typeof right === "number") {
135
- if (operator === "<") return left < right;
136
- if (operator === "<=") return left <= right;
137
- if (operator === ">") return left > right;
138
- return left >= right;
139
- }
140
- let a = __eliscript_numeric_primitive(left);
141
- let b = __eliscript_numeric_primitive(right);
142
- const x = typeof a, y = typeof b;
143
- if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
144
- a = __eliscript_numeric(a);
145
- b = __eliscript_numeric(b);
146
- }
147
- if (operator === "<") return a < b;
148
- if (operator === "<=") return a <= b;
149
- if (operator === ">") return a > b;
150
- return a >= b;
151
- };
152
5
 
153
6
  const syntax_filename_key = "filename";
154
- __eliscript_tdz_ready_0 = true;
155
7
  const syntax_start_key = "start";
156
- __eliscript_tdz_ready_1 = true;
157
8
  const syntax_end_key = "end";
158
- __eliscript_tdz_ready_2 = true;
159
9
  const syntax_line_key = "line";
160
- __eliscript_tdz_ready_3 = true;
161
10
  const syntax_column_key = "column";
162
- __eliscript_tdz_ready_4 = true;
163
11
  const syntax_end_line_key = "endLine";
164
- __eliscript_tdz_ready_5 = true;
165
12
  const syntax_end_column_key = "endColumn";
166
- __eliscript_tdz_ready_6 = true;
167
13
  const syntax_kind_key = "kind";
168
- __eliscript_tdz_ready_7 = true;
169
14
  const syntax_value_key = "value";
170
- __eliscript_tdz_ready_8 = true;
171
15
  const syntax_span_key = "span";
172
- __eliscript_tdz_ready_9 = true;
173
16
  const syntax_name_key = "name";
174
- __eliscript_tdz_ready_10 = true;
175
17
  const syntax_items_key = "items";
176
- __eliscript_tdz_ready_11 = true;
177
18
  const syntax_literal_kind = "literal";
178
- __eliscript_tdz_ready_12 = true;
179
19
  const syntax_undefined_kind = "undefined";
180
- __eliscript_tdz_ready_13 = true;
181
20
  const syntax_symbol_kind = "symbol";
182
- __eliscript_tdz_ready_14 = true;
183
21
  const syntax_keyword_kind = "keyword";
184
- __eliscript_tdz_ready_15 = true;
185
22
  const syntax_list_kind = "list";
186
- __eliscript_tdz_ready_16 = true;
187
23
  const syntax_vector_kind = "vector";
188
- __eliscript_tdz_ready_17 = true;
189
24
  const syntax_small_positions = new (globalThis.Map)();
190
- __eliscript_tdz_ready_18 = true;
191
25
  function syntax_position(value) {
192
26
  if (__eliscript_truthy(((__eliscript_value_1) => (__eliscript_truthy(__eliscript_value_1) ? (__eliscript_numeric_relation(">=", value, 0) && __eliscript_numeric_relation("<=", value, 1024) && (!__eliscript_truthy(Object.is(value, -0.0)))) : __eliscript_value_1))(Number.isSafeInteger(value)))) {
193
- if (__eliscript_truthy(((__eliscript_tdz_read_18()))["has"](value))) {
194
- return ((__eliscript_tdz_read_18()))["get"](value);
27
+ if (__eliscript_truthy((syntax_small_positions)["has"](value))) {
28
+ return (syntax_small_positions)["get"](value);
195
29
  } else {
196
- ((__eliscript_tdz_read_18()))["set"](value, value);
30
+ (syntax_small_positions)["set"](value, value);
197
31
  return value;
198
32
  }
199
33
  } else {
@@ -201,22 +35,22 @@ function syntax_position(value) {
201
35
  }
202
36
  }
203
37
  function make_span(filename, start, end, line, column, end_line, end_column) {
204
- return ({[(__eliscript_tdz_read_0())]: filename, [(__eliscript_tdz_read_1())]: syntax_position(start), [(__eliscript_tdz_read_2())]: syntax_position(end), [(__eliscript_tdz_read_3())]: syntax_position(line), [(__eliscript_tdz_read_4())]: syntax_position(column), [(__eliscript_tdz_read_5())]: syntax_position(end_line), [(__eliscript_tdz_read_6())]: syntax_position(end_column)});
38
+ return ({[syntax_filename_key]: filename, [syntax_start_key]: syntax_position(start), [syntax_end_key]: syntax_position(end), [syntax_line_key]: syntax_position(line), [syntax_column_key]: syntax_position(column), [syntax_end_line_key]: syntax_position(end_line), [syntax_end_column_key]: syntax_position(end_column)});
205
39
  }
206
40
  function literal_node(value, span) {
207
- return ({[(__eliscript_tdz_read_7())]: (__eliscript_tdz_read_12()), [(__eliscript_tdz_read_8())]: value, [(__eliscript_tdz_read_9())]: span});
41
+ return ({[syntax_kind_key]: syntax_literal_kind, [syntax_value_key]: value, [syntax_span_key]: span});
208
42
  }
209
43
  function undefined_node(span) {
210
- return ({[(__eliscript_tdz_read_7())]: (__eliscript_tdz_read_13()), [(__eliscript_tdz_read_9())]: span});
44
+ return ({[syntax_kind_key]: syntax_undefined_kind, [syntax_span_key]: span});
211
45
  }
212
46
  function symbol_node(name, span) {
213
- return ({[(__eliscript_tdz_read_7())]: (__eliscript_tdz_read_14()), [(__eliscript_tdz_read_10())]: name, [(__eliscript_tdz_read_9())]: span});
47
+ return ({[syntax_kind_key]: syntax_symbol_kind, [syntax_name_key]: name, [syntax_span_key]: span});
214
48
  }
215
49
  function keyword_node(name, span) {
216
- return ({[(__eliscript_tdz_read_7())]: (__eliscript_tdz_read_15()), [(__eliscript_tdz_read_10())]: name, [(__eliscript_tdz_read_9())]: span});
50
+ return ({[syntax_kind_key]: syntax_keyword_kind, [syntax_name_key]: name, [syntax_span_key]: span});
217
51
  }
218
52
  function collection_node(kind, items, span) {
219
- return ({[(__eliscript_tdz_read_7())]: ((kind === (__eliscript_tdz_read_16())) ? (__eliscript_tdz_read_16()) : ((kind === (__eliscript_tdz_read_17())) ? (__eliscript_tdz_read_17()) : kind)), [(__eliscript_tdz_read_11())]: items, [(__eliscript_tdz_read_9())]: span});
53
+ return ({[syntax_kind_key]: ((kind === syntax_list_kind) ? syntax_list_kind : ((kind === syntax_vector_kind) ? syntax_vector_kind : kind)), [syntax_items_key]: items, [syntax_span_key]: span});
220
54
  }
221
55
  function node_kind(node) {
222
56
  return (node)["kind"];
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap/syntax.mjs","sources":["bootstrap/compiler/syntax.eli"],"sourcesContent":["(module bootstrap.compiler.syntax\n ;; Computed object keys reuse immutable primitive handles. The objects and\n ;; their data-property descriptors are still newly constructed on every call.\n (defconst syntax-filename-key \"filename\")\n (defconst syntax-start-key \"start\")\n (defconst syntax-end-key \"end\")\n (defconst syntax-line-key \"line\")\n (defconst syntax-column-key \"column\")\n (defconst syntax-end-line-key \"endLine\")\n (defconst syntax-end-column-key \"endColumn\")\n (defconst syntax-kind-key \"kind\")\n (defconst syntax-value-key \"value\")\n (defconst syntax-span-key \"span\")\n (defconst syntax-name-key \"name\")\n (defconst syntax-items-key \"items\")\n (defconst syntax-literal-kind \"literal\")\n (defconst syntax-undefined-kind \"undefined\")\n (defconst syntax-symbol-kind \"symbol\")\n (defconst syntax-keyword-kind \"keyword\")\n (defconst syntax-list-kind \"list\")\n (defconst syntax-vector-kind \"vector\")\n ;; Positions are primitive values. A bounded pool reuses common line and\n ;; column numbers without retaining source objects or growing across edits.\n (defconst syntax-small-positions (new globalThis.Map))\n (defun syntax-position (value)\n (if (and (Number/isSafeInteger value) (>= value 0) (<= value 1024)\n (not (Object/is value -0)))\n (if (js-call syntax-small-positions :has value)\n (js-call syntax-small-positions :get value)\n (progn (js-call syntax-small-positions :set value value) value))\n value))\n\n (defun make-span\n (filename start end line column end-line end-column)\n (js-object\n (progn syntax-filename-key) filename\n (progn syntax-start-key) (syntax-position start)\n (progn syntax-end-key) (syntax-position end)\n (progn syntax-line-key) (syntax-position line)\n (progn syntax-column-key) (syntax-position column)\n (progn syntax-end-line-key) (syntax-position end-line)\n (progn syntax-end-column-key) (syntax-position end-column)))\n\n (defun literal-node (value span)\n (js-object (progn syntax-kind-key) syntax-literal-kind (progn syntax-value-key) value (progn syntax-span-key) span))\n\n (defun undefined-node (span)\n (js-object (progn syntax-kind-key) syntax-undefined-kind (progn syntax-span-key) span))\n\n (defun symbol-node (name span)\n (js-object (progn syntax-kind-key) syntax-symbol-kind (progn syntax-name-key) name (progn syntax-span-key) span))\n\n (defun keyword-node (name span)\n (js-object (progn syntax-kind-key) syntax-keyword-kind (progn syntax-name-key) name (progn syntax-span-key) span))\n\n (defun collection-node (kind items span)\n (js-object (progn syntax-kind-key)\n (cond ((= kind syntax-list-kind) syntax-list-kind)\n ((= kind syntax-vector-kind) syntax-vector-kind)\n (t kind))\n (progn syntax-items-key) items (progn syntax-span-key) span))\n\n (defun node-kind (node)\n (get node :kind))\n\n (defun node-span (node)\n (get node :span))\n\n (defun node-value (node)\n (get node :value))\n\n (defun node-name (node)\n (get node :name undefined))\n\n (defun node-items (node)\n (get node :items (js-array)))\n\n (export\n make-span\n literal-node\n undefined-node\n symbol-node\n keyword-node\n collection-node\n node-kind\n node-span\n node-value\n node-name\n node-items))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGE,4BAA8B;;AAC9B,yBAA2B;;AAC3B,uBAAyB;;AACzB,wBAA0B;;AAC1B,0BAA4B;;AAC5B,4BAA8B;;AAC9B,8BAAgC;;AAChC,wBAA0B;;AAC1B,yBAA2B;;AAC3B,wBAA0B;;AAC1B,wBAA0B;;AAC1B,yBAA2B;;AAC3B,4BAA8B;;AAC9B,8BAAgC;;AAChC,2BAA6B;;AAC7B,4BAA8B;;AAC9B,yBAA2B;;AAC3B,2BAA6B;;AAG7B,+BAAiC,KAAK;;AACtC,yBAAwB;EACtB,uBAAI,sEAAkC,mCAAI,OAAM,MAAG,mCAAI,OAAM,SACpD,qBAAM,UAAU,OAAM,iCADrB,qBAAqB;IAE3B,uBAAI,CAAS,6BAAuB,OAAK;MACrC,OAAA,CAAS,6BAAuB,OAAK;;MAChC,CAAS,6BAAuB,OAAK,OAAM;MAAO,OAAA;;;IAC7D,OAAA;;;AAEJ,mBACK,UAAS,OAAM,KAAI,MAAK,QAAO,UAAS;EAC3C,OAAA,EACE,CAAO,6BAAqB,UAC5B,CAAO,6BAAmB,gBAAgB,QAC1C,CAAO,6BAAiB,gBAAgB,MACxC,CAAO,6BAAkB,gBAAgB,OACzC,CAAO,6BAAoB,gBAAgB,SAC3C,CAAO,6BAAsB,gBAAgB,WAC7C,CAAO,6BAAwB,gBAAgB;;AAEnD,sBAAqB,OAAM;EACzB,OAAA,EAAW,CAAO,6BAAiB,6BAAoB,CAAO,6BAAkB,OAAM,CAAO,6BAAiB;;AAEhH,wBAAuB;EACrB,OAAA,EAAW,CAAO,6BAAiB,6BAAsB,CAAO,6BAAiB;;AAEnF,qBAAoB,MAAK;EACvB,OAAA,EAAW,CAAO,6BAAiB,6BAAmB,CAAO,8BAAiB,MAAK,CAAO,6BAAiB;;AAE7G,sBAAqB,MAAK;EACxB,OAAA,EAAW,CAAO,6BAAiB,6BAAoB,CAAO,8BAAiB,MAAK,CAAO,6BAAiB;;AAE9G,yBAAwB,MAAK,OAAM;EACjC,OAAA,EAAW,CAAO,6BACV,CAAC,CAAG,SAAK,+BAAkB,8BAC3B,CAAC,CAAG,SAAK,+BAAoB,8BAC1B,QACT,CAAO,8BAAkB,OAAM,CAAO,6BAAiB;;AAE3D,mBAAkB;EAChB,OAAA,CAAK,MAAK;;AAEZ,mBAAkB;EAChB,OAAA,CAAK,MAAK;;AAEZ,oBAAmB;EACjB,OAAA,CAAK,MAAK;;AAEZ,mBAAkB;EAChB,OAAA,EAAK,MAAK,WAAM;;AAElB,oBAAmB;EACjB,OAAA,EAAK,MAAK,YAAO;;AAEnB,QACE,WACA,cACA,gBACA,aACA,cACA,iBACA,WACA,WACA,YACA,WACA"}
1
+ {"version":3,"file":"bootstrap/syntax.mjs","sources":["bootstrap/compiler/syntax.eli"],"sourcesContent":["(module bootstrap.compiler.syntax\n ;; Computed object keys reuse immutable primitive handles. The objects and\n ;; their data-property descriptors are still newly constructed on every call.\n (defconst syntax-filename-key \"filename\")\n (defconst syntax-start-key \"start\")\n (defconst syntax-end-key \"end\")\n (defconst syntax-line-key \"line\")\n (defconst syntax-column-key \"column\")\n (defconst syntax-end-line-key \"endLine\")\n (defconst syntax-end-column-key \"endColumn\")\n (defconst syntax-kind-key \"kind\")\n (defconst syntax-value-key \"value\")\n (defconst syntax-span-key \"span\")\n (defconst syntax-name-key \"name\")\n (defconst syntax-items-key \"items\")\n (defconst syntax-literal-kind \"literal\")\n (defconst syntax-undefined-kind \"undefined\")\n (defconst syntax-symbol-kind \"symbol\")\n (defconst syntax-keyword-kind \"keyword\")\n (defconst syntax-list-kind \"list\")\n (defconst syntax-vector-kind \"vector\")\n ;; Positions are primitive values. A bounded pool reuses common line and\n ;; column numbers without retaining source objects or growing across edits.\n (defconst syntax-small-positions (new globalThis.Map))\n (defun syntax-position (value)\n (if (and (Number/isSafeInteger value) (>= value 0) (<= value 1024)\n (not (Object/is value -0)))\n (if (js-call syntax-small-positions :has value)\n (js-call syntax-small-positions :get value)\n (progn (js-call syntax-small-positions :set value value) value))\n value))\n\n (defun make-span\n (filename start end line column end-line end-column)\n (js-object\n (progn syntax-filename-key) filename\n (progn syntax-start-key) (syntax-position start)\n (progn syntax-end-key) (syntax-position end)\n (progn syntax-line-key) (syntax-position line)\n (progn syntax-column-key) (syntax-position column)\n (progn syntax-end-line-key) (syntax-position end-line)\n (progn syntax-end-column-key) (syntax-position end-column)))\n\n (defun literal-node (value span)\n (js-object (progn syntax-kind-key) syntax-literal-kind (progn syntax-value-key) value (progn syntax-span-key) span))\n\n (defun undefined-node (span)\n (js-object (progn syntax-kind-key) syntax-undefined-kind (progn syntax-span-key) span))\n\n (defun symbol-node (name span)\n (js-object (progn syntax-kind-key) syntax-symbol-kind (progn syntax-name-key) name (progn syntax-span-key) span))\n\n (defun keyword-node (name span)\n (js-object (progn syntax-kind-key) syntax-keyword-kind (progn syntax-name-key) name (progn syntax-span-key) span))\n\n (defun collection-node (kind items span)\n (js-object (progn syntax-kind-key)\n (cond ((= kind syntax-list-kind) syntax-list-kind)\n ((= kind syntax-vector-kind) syntax-vector-kind)\n (t kind))\n (progn syntax-items-key) items (progn syntax-span-key) span))\n\n (defun node-kind (node)\n (get node :kind))\n\n (defun node-span (node)\n (get node :span))\n\n (defun node-value (node)\n (get node :value))\n\n (defun node-name (node)\n (get node :name undefined))\n\n (defun node-items (node)\n (get node :items (js-array)))\n\n (export\n make-span\n literal-node\n undefined-node\n symbol-node\n keyword-node\n collection-node\n node-kind\n node-span\n node-value\n node-name\n node-items))\n"],"names":[],"mappings":";;;;;AAGE,4BAA8B;AAC9B,yBAA2B;AAC3B,uBAAyB;AACzB,wBAA0B;AAC1B,0BAA4B;AAC5B,4BAA8B;AAC9B,8BAAgC;AAChC,wBAA0B;AAC1B,yBAA2B;AAC3B,wBAA0B;AAC1B,wBAA0B;AAC1B,yBAA2B;AAC3B,4BAA8B;AAC9B,8BAAgC;AAChC,2BAA6B;AAC7B,4BAA8B;AAC9B,yBAA2B;AAC3B,2BAA6B;AAG7B,+BAAiC,KAAK;AACtC,yBAAwB;EACtB,uBAAI,sEAAkC,mCAAI,OAAM,MAAG,mCAAI,OAAM,SACpD,qBAAM,UAAU,OAAM,iCADrB,qBAAqB;IAE3B,uBAAI,CAAS,wBAAuB,OAAK;MACrC,OAAA,CAAS,wBAAuB,OAAK;;MAChC,CAAS,wBAAuB,OAAK,OAAM;MAAO,OAAA;;;IAC7D,OAAA;;;AAEJ,mBACK,UAAS,OAAM,KAAI,MAAK,QAAO,UAAS;EAC3C,OAAA,EACE,CAAO,sBAAqB,UAC5B,CAAO,mBAAmB,gBAAgB,QAC1C,CAAO,iBAAiB,gBAAgB,MACxC,CAAO,kBAAkB,gBAAgB,OACzC,CAAO,oBAAoB,gBAAgB,SAC3C,CAAO,sBAAsB,gBAAgB,WAC7C,CAAO,wBAAwB,gBAAgB;;AAEnD,sBAAqB,OAAM;EACzB,OAAA,EAAW,CAAO,kBAAiB,qBAAoB,CAAO,mBAAkB,OAAM,CAAO,kBAAiB;;AAEhH,wBAAuB;EACrB,OAAA,EAAW,CAAO,kBAAiB,uBAAsB,CAAO,kBAAiB;;AAEnF,qBAAoB,MAAK;EACvB,OAAA,EAAW,CAAO,kBAAiB,oBAAmB,CAAO,kBAAiB,MAAK,CAAO,kBAAiB;;AAE7G,sBAAqB,MAAK;EACxB,OAAA,EAAW,CAAO,kBAAiB,qBAAoB,CAAO,kBAAiB,MAAK,CAAO,kBAAiB;;AAE9G,yBAAwB,MAAK,OAAM;EACjC,OAAA,EAAW,CAAO,kBACV,CAAC,CAAG,SAAK,oBAAkB,mBAC3B,CAAC,CAAG,SAAK,sBAAoB,qBAC1B,QACT,CAAO,mBAAkB,OAAM,CAAO,kBAAiB;;AAE3D,mBAAkB;EAChB,OAAA,CAAK,MAAK;;AAEZ,mBAAkB;EAChB,OAAA,CAAK,MAAK;;AAEZ,oBAAmB;EACjB,OAAA,CAAK,MAAK;;AAEZ,mBAAkB;EAChB,OAAA,EAAK,MAAK,WAAM;;AAElB,oBAAmB;EACjB,OAAA,EAAK,MAAK,YAAO;;AAEnB,QACE,WACA,cACA,gBACA,aACA,cACA,iBACA,WACA,WACA,YACA,WACA"}
@@ -2,105 +2,13 @@
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("transient_fail"); return transient_fail; }
5
- function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("transient_fail"); 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("canonical_transient_family"); return canonical_transient_family; }
8
- function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("canonical_transient_family"); return __eliscript_const_error(); }
9
7
  var __eliscript_tdz_ready_2;
10
8
  function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("trusted_core_source_p"); return trusted_core_source_p; }
11
- function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("trusted_core_source_p"); return __eliscript_const_error(); }
12
9
  import "eliscript/runtime/unicode-case.mjs";
10
+ 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";
13
11
  const __eliscript_truthy = (value) => value !== false && value != null;
14
- const __eliscript_number_intrinsic = globalThis.Number;
15
- const __eliscript_bigint_intrinsic = globalThis.BigInt;
16
- const __eliscript_numeric_apply = globalThis.Reflect.apply;
17
- const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
18
- const __eliscript_numeric_error = globalThis.TypeError;
19
- const __eliscript_numeric_trim = globalThis.String.prototype.trim;
20
- const __eliscript_numeric_slice = globalThis.String.prototype.slice;
21
- const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
22
- const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
23
- const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
24
- const __eliscript_numeric_primitive = (value) => {
25
- if (!__eliscript_numeric_object(value)) return value;
26
- const exotic = value[__eliscript_numeric_symbol];
27
- if (exotic !== void 0 && exotic !== null) {
28
- const result = __eliscript_numeric_apply(exotic, value, ["number"]);
29
- if (!__eliscript_numeric_object(result)) return result;
30
- throw new __eliscript_numeric_error("Cannot convert object to primitive value");
31
- }
32
- for (let index = 0; index < 2; index++) {
33
- const method = value[index === 0 ? "valueOf" : "toString"];
34
- if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
35
- const result = __eliscript_numeric_apply(method, value, []);
36
- if (!__eliscript_numeric_object(result)) return result;
37
- }
38
- }
39
- throw new __eliscript_numeric_error("Cannot convert object to primitive value");
40
- };
41
- const __eliscript_to_number = (value) => {
42
- const primitive = __eliscript_numeric_primitive(value);
43
- if (typeof primitive === "string") {
44
- const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
45
- if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
46
- let first = 2;
47
- while (first < text.length && text[first] === "0") first++;
48
- if (first === text.length) return 0;
49
- const prefix = text[1];
50
- const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
51
- if (text.length - first > limit) return 1 / 0;
52
- const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
53
- return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
54
- }
55
- }
56
- return __eliscript_number_intrinsic(primitive);
57
- };
58
- const __eliscript_numeric = (value) => {
59
- if (typeof value === "number" || typeof value === "bigint") return value;
60
- const primitive = __eliscript_numeric_primitive(value);
61
- if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
62
- return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
63
- };
64
- const __eliscript_implicit_number = (value) => {
65
- if (typeof value === "number") return value;
66
- const primitive = __eliscript_numeric_primitive(value);
67
- if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
68
- return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
69
- };
70
- const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
71
- const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
72
- const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
73
- const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
74
- const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
75
- const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
76
- const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
77
- const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
78
- const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
79
- const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
80
- const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
81
- const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
82
- const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
83
- const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
84
- const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
85
- const __eliscript_numeric_relation = (operator, left, right) => {
86
- if (typeof left === "number" && typeof right === "number") {
87
- if (operator === "<") return left < right;
88
- if (operator === "<=") return left <= right;
89
- if (operator === ">") return left > right;
90
- return left >= right;
91
- }
92
- let a = __eliscript_numeric_primitive(left);
93
- let b = __eliscript_numeric_primitive(right);
94
- const x = typeof a, y = typeof b;
95
- if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
96
- a = __eliscript_numeric(a);
97
- b = __eliscript_numeric(b);
98
- }
99
- if (operator === "<") return a < b;
100
- if (operator === "<=") return a <= b;
101
- if (operator === ">") return a > b;
102
- return a >= b;
103
- };
104
12
 
105
13
  import {node_kind, node_span, node_value, node_name, node_items} from "./syntax.mjs";
106
14
  function utf16_string_order(left, right) {