@mark1russell7/vex-compiler 0.11.0 → 0.11.2
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 +2 -0
- package/build/index.d.ts +37 -5
- package/build/index.d.ts.map +1 -1
- package/build/index.js +800 -85
- package/build/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -1
- package/src/js.ts +4 -2
- package/src/module.ts +655 -68
- package/src/runtime.ts +2 -7
- package/src/sheet-order.ts +123 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/vex-compiler",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.2",
|
|
5
5
|
"description": "The Vex compiler: generated JavaScript for Vex programs, at run time and at build time, with the results of the interpreter.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vex",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@mark1russell7/cue": "github:mark1russell7/cue",
|
|
46
|
-
"@mark1russell7/vex-domains": "0.11.
|
|
47
|
-
"@mark1russell7/vex-testkit": "0.11.
|
|
46
|
+
"@mark1russell7/vex-domains": "0.11.2",
|
|
47
|
+
"@mark1russell7/vex-testkit": "0.11.2",
|
|
48
48
|
"@types/node": "^26.6.4",
|
|
49
49
|
"fast-check": "^4.10.2",
|
|
50
50
|
"typescript": "^7.0.2",
|
|
51
51
|
"vitest": "^5.0.3"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@mark1russell7/vex": "0.11.
|
|
54
|
+
"@mark1russell7/vex": "0.11.2"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsdown",
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { generate, load, tiered, type Generated, type GenerateOptions, type Tier2, type TieredProgram, type TierStats } from "./tiers.ts";
|
|
5
5
|
export type { Schema } from "./facts.ts";
|
|
6
|
-
export { emitModule, type Emitted, type ModuleOptions } from "./module.ts";
|
|
6
|
+
export { emitModule, emitSheetModule, type Emitted, type ModuleOptions, type SheetModuleOptions } from "./module.ts";
|
|
7
7
|
export { FALLBACK, createRuntime, type Fallback, type Runtime, type RuntimeOptions } from "./runtime.ts";
|
|
8
8
|
export type { LExpr, LoopProgram, LStmt, PrimOp, RuntimeFn } from "./loop.ts";
|
package/src/js.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* inline caches in the engine, and a guard sends each other case to the dispatch of the runtime.
|
|
10
10
|
*/
|
|
11
11
|
import { liftsAt, type ParamKind } from "@mark1russell7/vex";
|
|
12
|
-
import type
|
|
12
|
+
import { primitiveOf, type Facts, type SiteFacts, type StaticSite } from "./facts.ts";
|
|
13
13
|
import { constant, FIXED_LOCALS, type Fail, type LExpr, type LoopProgram, type LStmt, type RuntimeFn } from "./loop.ts";
|
|
14
14
|
|
|
15
15
|
type OpExpr = Extract<LExpr, { readonly t: "op" }>;
|
|
@@ -189,7 +189,9 @@ export function printJs(p: LoopProgram, facts: Facts): string {
|
|
|
189
189
|
const f = `f${x.name}_${st.domain}`;
|
|
190
190
|
fns.set(f, `${domain(st.domain)}.ops[${expr(constant(x.name))}].fn`);
|
|
191
191
|
attempt(`${f}(${values.join(", ")})`, indent);
|
|
192
|
-
|
|
192
|
+
// A local of tier 2 has a primitive kind or no kind (lower.ts). Thus a result of the kind of a domain gets the checks
|
|
193
|
+
// of the interpreter, as a result of the kind any (V-059).
|
|
194
|
+
const kind = primitiveOf(st.returns);
|
|
193
195
|
if (kind === undefined) {
|
|
194
196
|
resultChecks(out, facts.checks, indent);
|
|
195
197
|
return;
|