@opencode/codemode 0.0.0-dev-884 → 0.0.0-dev-900

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 (117) hide show
  1. package/README.md +3 -0
  2. package/dist/codemode.d.ts +2 -0
  3. package/dist/codemode.js +10 -4
  4. package/dist/vm/async.d.ts +78 -0
  5. package/dist/vm/async.js +335 -0
  6. package/dist/vm/code.d.ts +122 -0
  7. package/dist/vm/code.js +407 -0
  8. package/dist/vm/compiler/compile.d.ts +13 -0
  9. package/dist/vm/compiler/compile.js +1477 -0
  10. package/dist/vm/compiler/scope.d.ts +74 -0
  11. package/dist/vm/compiler/scope.js +515 -0
  12. package/dist/vm/data.d.ts +7 -0
  13. package/dist/vm/data.js +13 -0
  14. package/dist/vm/generators.d.ts +42 -0
  15. package/dist/vm/generators.js +413 -0
  16. package/dist/vm/host.d.ts +103 -0
  17. package/dist/vm/host.js +226 -0
  18. package/dist/vm/index.d.ts +3 -0
  19. package/dist/vm/index.js +3 -0
  20. package/dist/vm/internal-prelude.d.ts +45 -0
  21. package/dist/vm/internal-prelude.js +534 -0
  22. package/dist/vm/opcodes.d.ts +222 -0
  23. package/dist/vm/opcodes.js +235 -0
  24. package/dist/vm/prelude/bytecode.d.ts +18 -0
  25. package/dist/vm/prelude/bytecode.js +31 -0
  26. package/dist/vm/prelude/bytecode.json +1 -0
  27. package/dist/vm/prelude/helpers.d.ts +8 -0
  28. package/dist/vm/prelude/helpers.js +258 -0
  29. package/dist/vm/prelude/prelude.d.ts +21 -0
  30. package/dist/vm/prelude/prelude.js +53 -0
  31. package/dist/vm/prelude/source.d.ts +1 -0
  32. package/dist/vm/prelude/source.js +652 -0
  33. package/dist/vm/runtime/callback.d.ts +25 -0
  34. package/dist/vm/runtime/callback.js +51 -0
  35. package/dist/vm/runtime/driver.d.ts +41 -0
  36. package/dist/vm/runtime/driver.js +142 -0
  37. package/dist/vm/runtime/errors.d.ts +23 -0
  38. package/dist/vm/runtime/errors.js +169 -0
  39. package/dist/vm/runtime/execute.d.ts +22 -0
  40. package/dist/vm/runtime/execute.js +278 -0
  41. package/dist/vm/runtime/extensions.d.ts +16 -0
  42. package/dist/vm/runtime/extensions.js +270 -0
  43. package/dist/vm/runtime/generators.d.ts +6 -0
  44. package/dist/vm/runtime/generators.js +44 -0
  45. package/dist/vm/runtime/globals.d.ts +6 -0
  46. package/dist/vm/runtime/globals.js +137 -0
  47. package/dist/vm/runtime/interpreter.d.ts +50 -0
  48. package/dist/vm/runtime/interpreter.js +94 -0
  49. package/dist/vm/runtime/intrinsic-names.d.ts +56 -0
  50. package/dist/vm/runtime/intrinsic-names.js +166 -0
  51. package/dist/vm/runtime/intrinsics.d.ts +15 -0
  52. package/dist/vm/runtime/intrinsics.js +111 -0
  53. package/dist/vm/runtime/limits.d.ts +10 -0
  54. package/dist/vm/runtime/limits.js +19 -0
  55. package/dist/vm/runtime/model.d.ts +58 -0
  56. package/dist/vm/runtime/model.js +57 -0
  57. package/dist/vm/runtime/modules.d.ts +4 -0
  58. package/dist/vm/runtime/modules.js +33 -0
  59. package/dist/vm/runtime/native.d.ts +19 -0
  60. package/dist/vm/runtime/native.js +41 -0
  61. package/dist/vm/runtime/objects.d.ts +403 -0
  62. package/dist/vm/runtime/objects.js +784 -0
  63. package/dist/vm/runtime/operations.d.ts +49 -0
  64. package/dist/vm/runtime/operations.js +288 -0
  65. package/dist/vm/runtime/promises.d.ts +55 -0
  66. package/dist/vm/runtime/promises.js +232 -0
  67. package/dist/vm/runtime/references.d.ts +8 -0
  68. package/dist/vm/runtime/references.js +51 -0
  69. package/dist/vm/runtime/signals.d.ts +69 -0
  70. package/dist/vm/runtime/signals.js +68 -0
  71. package/dist/vm/runtime/source.d.ts +29 -0
  72. package/dist/vm/runtime/source.js +63 -0
  73. package/dist/vm/runtime/table.d.ts +43 -0
  74. package/dist/vm/runtime/table.js +132 -0
  75. package/dist/vm/scheduler.d.ts +178 -0
  76. package/dist/vm/scheduler.js +63 -0
  77. package/dist/vm/snapshot/codec.d.ts +88 -0
  78. package/dist/vm/snapshot/codec.js +752 -0
  79. package/dist/vm/snapshot/snapshot.d.ts +39 -0
  80. package/dist/vm/snapshot/snapshot.js +69 -0
  81. package/dist/vm/snapshot.d.ts +29 -0
  82. package/dist/vm/snapshot.js +304 -0
  83. package/dist/vm/stdlib/array.d.ts +16 -0
  84. package/dist/vm/stdlib/array.js +311 -0
  85. package/dist/vm/stdlib/bytes.d.ts +11 -0
  86. package/dist/vm/stdlib/bytes.js +222 -0
  87. package/dist/vm/stdlib/collections.d.ts +7 -0
  88. package/dist/vm/stdlib/collections.js +188 -0
  89. package/dist/vm/stdlib/console.d.ts +6 -0
  90. package/dist/vm/stdlib/console.js +93 -0
  91. package/dist/vm/stdlib/date.d.ts +2 -0
  92. package/dist/vm/stdlib/date.js +123 -0
  93. package/dist/vm/stdlib/headers.d.ts +2 -0
  94. package/dist/vm/stdlib/headers.js +92 -0
  95. package/dist/vm/stdlib/iterator.d.ts +2 -0
  96. package/dist/vm/stdlib/iterator.js +30 -0
  97. package/dist/vm/stdlib/json.d.ts +3 -0
  98. package/dist/vm/stdlib/json.js +42 -0
  99. package/dist/vm/stdlib/math.d.ts +3 -0
  100. package/dist/vm/stdlib/math.js +73 -0
  101. package/dist/vm/stdlib/number.d.ts +3 -0
  102. package/dist/vm/stdlib/number.js +72 -0
  103. package/dist/vm/stdlib/object.d.ts +6 -0
  104. package/dist/vm/stdlib/object.js +201 -0
  105. package/dist/vm/stdlib/regexp.d.ts +8 -0
  106. package/dist/vm/stdlib/regexp.js +119 -0
  107. package/dist/vm/stdlib/string.d.ts +2 -0
  108. package/dist/vm/stdlib/string.js +272 -0
  109. package/dist/vm/stdlib/url.d.ts +25 -0
  110. package/dist/vm/stdlib/url.js +255 -0
  111. package/dist/vm/stdlib/value.d.ts +6 -0
  112. package/dist/vm/stdlib/value.js +32 -0
  113. package/dist/vm/stdlib/web.d.ts +5 -0
  114. package/dist/vm/stdlib/web.js +97 -0
  115. package/dist/vm/vm.d.ts +224 -0
  116. package/dist/vm/vm.js +2921 -0
  117. package/package.json +5 -2
@@ -0,0 +1,407 @@
1
+ import { Op, packWord } from "./opcodes.js";
2
+ /**
3
+ * Immutable compiled function or program body. Holds no per-run mutable state.
4
+ */
5
+ export class Code {
6
+ source;
7
+ index;
8
+ name;
9
+ flags;
10
+ length;
11
+ params;
12
+ locals;
13
+ maxStack;
14
+ code;
15
+ consts;
16
+ /** Per upvalue: `[from (0 = parent cell slot, 1 = parent upvalue), index]`. */
17
+ captures;
18
+ /** Exception handlers `[start, end, target, depth]*`, innermost first (`end` exclusive). */
19
+ handlers;
20
+ /** Per finally level: `[tagSlot, valSlot, entryDepth, n, target_0 … target_{n-1}]`. */
21
+ finallies;
22
+ /** Offsets into `finallies` indexed by finally level. */
23
+ finallyOffsets;
24
+ /** Run-length encoded `[pc, nodeIndex]*` sorted by `pc`. */
25
+ sites;
26
+ localNames;
27
+ upvalNames;
28
+ sourceObj;
29
+ constructor(init) {
30
+ this.source = init.source;
31
+ this.index = init.index;
32
+ this.name = init.name;
33
+ this.flags = init.flags;
34
+ this.length = init.length;
35
+ this.params = init.params;
36
+ this.locals = init.locals;
37
+ this.maxStack = init.maxStack;
38
+ this.code = init.code;
39
+ const consts = [""];
40
+ consts.pop();
41
+ for (let i = 0; i < init.consts.length; i++)
42
+ consts.push(init.consts[i]);
43
+ this.consts = consts;
44
+ this.captures = init.captures;
45
+ this.handlers = init.handlers;
46
+ this.finallies = init.finallies;
47
+ this.finallyOffsets = init.finallyOffsets;
48
+ this.sites = init.sites;
49
+ this.localNames = init.localNames;
50
+ this.upvalNames = init.upvalNames ?? [];
51
+ this.sourceObj = init.sourceObj;
52
+ }
53
+ /** Resolves the AST node index recorded for `pc`, or `-1` when none was recorded. */
54
+ nodeIndexAt(pc) {
55
+ const sites = this.sites;
56
+ const count = sites.length >>> 1;
57
+ if (count === 0)
58
+ return -1;
59
+ let low = 0;
60
+ let high = count - 1;
61
+ let best = -1;
62
+ while (low <= high) {
63
+ const mid = (low + high) >>> 1;
64
+ const entryPc = sites[mid << 1];
65
+ if (entryPc <= pc) {
66
+ best = sites[(mid << 1) + 1];
67
+ low = mid + 1;
68
+ }
69
+ else {
70
+ high = mid - 1;
71
+ }
72
+ }
73
+ return best;
74
+ }
75
+ /** Resolves the AST node recorded for `pc`. */
76
+ siteAt(pc) {
77
+ const index = this.nodeIndexAt(pc);
78
+ return index >= 0 ? this.sourceObj?.nodes[index] : undefined;
79
+ }
80
+ /** The same code over another parse of its source, so its sites resolve to that tree's nodes. */
81
+ withSource(sourceObj) {
82
+ return new Code({ ...this, sourceObj });
83
+ }
84
+ }
85
+ // The fields of a `Code` that are packed words.
86
+ const words = ["code", "captures", "handlers", "finallies", "finallyOffsets", "sites"];
87
+ /** Code as JSON, for bytecode compiled ahead of time: every field but the source tree, which `codeFromJson` is given. */
88
+ export const codeToJson = (code) => {
89
+ const { sourceObj: _, ...fields } = code;
90
+ return { ...fields, ...Object.fromEntries(words.map((field) => [field, [...code[field]]])) };
91
+ };
92
+ export const codeFromJson = (data, sourceObj) => new Code({
93
+ ...data,
94
+ ...Object.fromEntries(words.map((field) => [field, Int32Array.from(data[field])])),
95
+ sourceObj,
96
+ });
97
+ /** Raised when a narrow-jump function exceeds 16-bit jump range (`65,535` words) and must recompile in wide mode. */
98
+ export class CodeSizeOverflow extends RangeError {
99
+ constructor(message = "Function bytecode exceeds 16-bit jump range") {
100
+ super(message);
101
+ this.name = "CodeSizeOverflow";
102
+ }
103
+ }
104
+ const checkUint31 = (value, name) => {
105
+ if (!Number.isInteger(value) || value < 0 || value > 0x7fffffff) {
106
+ throw new RangeError(`${name} out of range: ${value}`);
107
+ }
108
+ };
109
+ export class CodeBuilder {
110
+ source;
111
+ sourceObj;
112
+ index;
113
+ name;
114
+ flags;
115
+ length;
116
+ params;
117
+ locals;
118
+ localNames;
119
+ captures;
120
+ upvalNames;
121
+ words = [];
122
+ sitePairs = [];
123
+ lastNodeIndex = -2;
124
+ constList = [];
125
+ // Strings and numbers (but -0) are pooled; other constants are each their own.
126
+ pooled = new Map();
127
+ handlerWords = [];
128
+ finallyWords = [];
129
+ finallyLevelOffsets = [];
130
+ depth = 0;
131
+ maxStack = 0;
132
+ wideJumps = false;
133
+ forceExtra = false;
134
+ constructor(source, sourceObj, index, name, flags, length, params, locals, localNames, captures, upvalNames = []) {
135
+ this.source = source;
136
+ this.sourceObj = sourceObj;
137
+ this.index = index;
138
+ this.name = name;
139
+ this.flags = flags;
140
+ this.length = length;
141
+ this.params = params;
142
+ this.locals = locals;
143
+ this.localNames = localNames;
144
+ this.captures = captures;
145
+ this.upvalNames = upvalNames;
146
+ }
147
+ get pc() {
148
+ return this.words.length;
149
+ }
150
+ adjustDepth(delta) {
151
+ if (this.depth < 0)
152
+ return;
153
+ this.depth += delta;
154
+ if (this.depth > this.maxStack)
155
+ this.maxStack = this.depth;
156
+ }
157
+ setDepth(depth) {
158
+ this.depth = depth;
159
+ if (this.depth > this.maxStack)
160
+ this.maxStack = this.depth;
161
+ }
162
+ unreachable() {
163
+ this.depth = -1;
164
+ }
165
+ constant(value) {
166
+ const poolable = typeof value === "string" || (typeof value === "number" && !Object.is(value, -0));
167
+ const existing = poolable ? this.pooled.get(value) : undefined;
168
+ if (existing !== undefined)
169
+ return existing;
170
+ const k = this.constList.length;
171
+ checkUint31(k, "Constant index");
172
+ if (poolable)
173
+ this.pooled.set(value, k);
174
+ this.constList.push(value);
175
+ return k;
176
+ }
177
+ recordSite(pc, nodeIndex) {
178
+ if (nodeIndex < 0 || nodeIndex === this.lastNodeIndex)
179
+ return;
180
+ this.sitePairs.push(pc, nodeIndex);
181
+ this.lastNodeIndex = nodeIndex;
182
+ }
183
+ pushOp(op, a, bx, nodeIndex, forceWide) {
184
+ if ((op & 0xff) !== op || op === Op.EXTRA) {
185
+ throw new RangeError(`Invalid opcode: ${op}`);
186
+ }
187
+ checkUint31(a, "Operand a");
188
+ if (op === Op.NEW && a > 0xff) {
189
+ throw new RangeError(`Op.NEW operand a out of range: ${a}`);
190
+ }
191
+ if (op === Op.PUSH_INT) {
192
+ if (a !== 0 || (bx & 0xffff) !== bx) {
193
+ throw new RangeError(`Op.PUSH_INT operand out of range: a=${a} bx=${bx}`);
194
+ }
195
+ }
196
+ else {
197
+ checkUint31(bx, "Operand bx");
198
+ }
199
+ if (a > 0xffff) {
200
+ this.recordSite(this.words.length, nodeIndex);
201
+ this.words.push(packWord(Op.EXTRA, 0, a >>> 16));
202
+ this.words.push(packWord(Op.EXTRA, (a >>> 8) & 0xff, bx >>> 16));
203
+ }
204
+ else if (forceWide || a > 0xff || (op !== Op.PUSH_INT && bx > 0xffff)) {
205
+ this.recordSite(this.words.length, nodeIndex);
206
+ this.words.push(packWord(Op.EXTRA, a >>> 8, bx >>> 16));
207
+ }
208
+ const pc = this.words.length;
209
+ this.recordSite(pc, nodeIndex);
210
+ this.words.push(packWord(op, a & 0xff, bx & 0xffff));
211
+ if (this.words.length > 0x7fffffff) {
212
+ throw new RangeError(`Bytecode length ${this.words.length} exceeds 31-bit limit`);
213
+ }
214
+ if (!this.wideJumps && !this.forceExtra && this.words.length > 0xffff) {
215
+ throw new CodeSizeOverflow();
216
+ }
217
+ return pc;
218
+ }
219
+ emit(op, a = 0, bx = 0, nodeIndex = -1, stackDelta = 0) {
220
+ if (this.depth < 0)
221
+ return this.words.length;
222
+ const pc = this.pushOp(op, a, bx, nodeIndex, this.forceExtra);
223
+ this.adjustDepth(stackDelta);
224
+ return pc;
225
+ }
226
+ emitNumber(value, nodeIndex = -1) {
227
+ if (this.depth < 0)
228
+ return;
229
+ if (Number.isInteger(value) && !Object.is(value, -0) && value >= -32768 && value <= 32767 && !this.forceExtra) {
230
+ this.emit(Op.PUSH_INT, 0, value & 0xffff, nodeIndex, 1);
231
+ return;
232
+ }
233
+ const k = this.constant(value);
234
+ this.emit(Op.PUSH_CONST, 0, k, nodeIndex, 1);
235
+ }
236
+ emitString(value, nodeIndex = -1) {
237
+ if (this.depth < 0)
238
+ return;
239
+ const k = this.constant(value);
240
+ this.emit(Op.PUSH_CONST, 0, k, nodeIndex, 1);
241
+ }
242
+ newLabel(depth) {
243
+ return { pc: -1, patches: [], depth };
244
+ }
245
+ mark(label) {
246
+ const target = this.words.length;
247
+ checkUint31(target, "Jump target");
248
+ label.pc = target;
249
+ if (label.depth !== undefined)
250
+ this.setDepth(label.depth);
251
+ else if (this.depth >= 0)
252
+ label.depth = this.depth;
253
+ for (const patchPc of label.patches) {
254
+ const hasExtra = patchPc > 0 && (this.words[patchPc - 1] & 0xff) === Op.EXTRA;
255
+ if (!hasExtra) {
256
+ if (target > 0xffff)
257
+ throw new CodeSizeOverflow();
258
+ this.words[patchPc] = (this.words[patchPc] & 0xffff) | (target << 16);
259
+ }
260
+ else {
261
+ this.words[patchPc - 1] = (this.words[patchPc - 1] & 0xffff) | ((target >>> 16) << 16);
262
+ this.words[patchPc] = (this.words[patchPc] & 0xffff) | ((target & 0xffff) << 16);
263
+ }
264
+ }
265
+ label.patches.length = 0;
266
+ }
267
+ emitJump(op, a, label, nodeIndex = -1, jumpDelta = 0, fallDelta = 0) {
268
+ if (this.depth < 0)
269
+ return;
270
+ const targetDepth = this.depth + jumpDelta;
271
+ if (label.depth === undefined)
272
+ label.depth = targetDepth;
273
+ const known = label.pc >= 0;
274
+ if (known && !this.wideJumps && !this.forceExtra && label.pc > 0xffff) {
275
+ throw new CodeSizeOverflow();
276
+ }
277
+ const pc = this.pushOp(op, a, known ? label.pc : 0, nodeIndex, this.wideJumps || this.forceExtra);
278
+ if (!known)
279
+ label.patches.push(pc);
280
+ if (fallDelta === null)
281
+ this.depth = -1;
282
+ else
283
+ this.adjustDepth(fallDelta);
284
+ }
285
+ addHandler(start, end, target, depth) {
286
+ if (start >= end || target < 0)
287
+ return;
288
+ checkUint31(start, "Handler start");
289
+ checkUint31(end, "Handler end");
290
+ checkUint31(target, "Handler target");
291
+ checkUint31(depth, "Handler depth");
292
+ this.handlerWords.push(start, end, target, depth);
293
+ }
294
+ reserveFinally() {
295
+ const level = this.finallyLevelOffsets.length;
296
+ checkUint31(level, "Finally level");
297
+ this.finallyLevelOffsets.push(-1);
298
+ return level;
299
+ }
300
+ setFinally(level, tagSlot, valSlot, entryDepth, targets) {
301
+ checkUint31(level, "Finally level");
302
+ checkUint31(tagSlot, "Finally tagSlot");
303
+ checkUint31(valSlot, "Finally valSlot");
304
+ checkUint31(entryDepth, "Finally entryDepth");
305
+ checkUint31(targets.length, "Finally target count");
306
+ this.finallyLevelOffsets[level] = this.finallyWords.length;
307
+ this.finallyWords.push(tagSlot, valSlot, entryDepth, targets.length);
308
+ for (const t of targets) {
309
+ if (!Number.isInteger(t) || t < -1 || t > 0x7fffffff) {
310
+ throw new RangeError(`Finally target out of range: ${t}`);
311
+ }
312
+ this.finallyWords.push(t);
313
+ }
314
+ }
315
+ finish() {
316
+ return new Code({
317
+ source: this.source,
318
+ index: this.index,
319
+ name: this.name,
320
+ flags: this.flags,
321
+ length: this.length,
322
+ params: this.params,
323
+ locals: this.locals,
324
+ maxStack: this.maxStack,
325
+ code: new Int32Array(this.words),
326
+ consts: this.constList,
327
+ captures: this.captures,
328
+ handlers: new Int32Array(this.handlerWords),
329
+ finallies: new Int32Array(this.finallyWords),
330
+ finallyOffsets: new Int32Array(this.finallyLevelOffsets),
331
+ sites: new Int32Array(this.sitePairs),
332
+ localNames: this.localNames,
333
+ upvalNames: this.upvalNames,
334
+ sourceObj: this.sourceObj,
335
+ });
336
+ }
337
+ }
338
+ /** Deterministic FNV-1a 64-bit hash over a compiled `Code[]` array. */
339
+ export const hashOf = (codes) => {
340
+ let h1 = 0x811c9dc5;
341
+ let h2 = 0xcbf29ce4;
342
+ const mix = (v) => {
343
+ h1 = Math.imul(h1 ^ (v & 0xff), 0x01000193);
344
+ h1 = Math.imul(h1 ^ ((v >>> 8) & 0xff), 0x01000193);
345
+ h2 = Math.imul(h2 ^ ((v >>> 16) & 0xff), 0x01000193);
346
+ h2 = Math.imul(h2 ^ ((v >>> 24) & 0xff), 0xff000193);
347
+ };
348
+ const mixStr = (s) => {
349
+ mix(s.length);
350
+ for (let i = 0; i < s.length; i++)
351
+ mix(s.charCodeAt(i));
352
+ };
353
+ const mixArr = (arr) => {
354
+ mix(arr.length);
355
+ for (let i = 0; i < arr.length; i++)
356
+ mix(arr[i]);
357
+ };
358
+ mix(codes.length);
359
+ for (const c of codes) {
360
+ mix(c.index);
361
+ mixStr(c.name);
362
+ mix(c.flags);
363
+ mix(c.length);
364
+ mix(c.params);
365
+ mix(c.locals);
366
+ mix(c.maxStack);
367
+ mixArr(c.code);
368
+ mixArr(c.captures);
369
+ mixArr(c.handlers);
370
+ mixArr(c.finallies);
371
+ mixArr(c.sites);
372
+ mix(c.consts.length);
373
+ for (const k of c.consts) {
374
+ if (typeof k === "string") {
375
+ mix(1);
376
+ mixStr(k);
377
+ }
378
+ else if (typeof k === "number") {
379
+ mix(2);
380
+ mixStr(Object.is(k, -0) ? "-0" : String(k));
381
+ }
382
+ else if ("pattern" in k) {
383
+ mix(3);
384
+ mixStr(k.pattern);
385
+ mixStr(k.flags);
386
+ }
387
+ else if ("cooked" in k) {
388
+ mix(4);
389
+ mix(k.nodeIndex);
390
+ for (const s of k.raw)
391
+ mixStr(s);
392
+ }
393
+ else if ("specifier" in k) {
394
+ mix(5);
395
+ mixStr(k.specifier);
396
+ if (k.imported !== undefined)
397
+ mixStr(k.imported);
398
+ }
399
+ else {
400
+ mix(6);
401
+ mixStr(k.type);
402
+ mixStr(k.message);
403
+ }
404
+ }
405
+ }
406
+ return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0");
407
+ };
@@ -0,0 +1,13 @@
1
+ import { type Source } from "../runtime/source.js";
2
+ import { Code } from "../code.js";
3
+ /** Bump when the compiler emits different bytecode for the same source; it is part of the snapshot build id. */
4
+ export declare const COMPILER_VERSION = 1;
5
+ export type CompileOptions = {
6
+ readonly internal?: boolean;
7
+ readonly forceExtra?: boolean;
8
+ readonly noCache?: boolean;
9
+ };
10
+ /**
11
+ * Compiles a `Source` into an immutable `Code[]` array indexed by pre-order function index (`0` = program).
12
+ */
13
+ export declare const compileSource: (source: Source, options?: CompileOptions) => ReadonlyArray<Code>;