@intentius/tsad-reference 1.4.0
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/CAVEATS.md +95 -0
- package/README.md +42 -0
- package/dist/adapter.d.ts +5 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +50 -0
- package/dist/adapter.js.map +1 -0
- package/dist/fnbody.d.ts +11 -0
- package/dist/fnbody.d.ts.map +1 -0
- package/dist/fnbody.js +68 -0
- package/dist/fnbody.js.map +1 -0
- package/dist/fold.d.ts +86 -0
- package/dist/fold.d.ts.map +1 -0
- package/dist/fold.js +558 -0
- package/dist/fold.js.map +1 -0
- package/dist/foldable-helpers.d.ts +23 -0
- package/dist/foldable-helpers.d.ts.map +1 -0
- package/dist/foldable-helpers.js +25 -0
- package/dist/foldable-helpers.js.map +1 -0
- package/dist/host.d.ts +45 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +5 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +20 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +74 -0
- package/dist/module.js.map +1 -0
- package/dist/project.d.ts +22 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +481 -0
- package/dist/project.js.map +1 -0
- package/dist/revive.d.ts +16 -0
- package/dist/revive.d.ts.map +1 -0
- package/dist/revive.js +109 -0
- package/dist/revive.js.map +1 -0
- package/dist/subset.d.ts +42 -0
- package/dist/subset.d.ts.map +1 -0
- package/dist/subset.js +214 -0
- package/dist/subset.js.map +1 -0
- package/package.json +37 -0
- package/src/adapter.ts +48 -0
- package/src/fnbody.ts +61 -0
- package/src/fold.ts +581 -0
- package/src/foldable-helpers.ts +38 -0
- package/src/host.ts +38 -0
- package/src/index.ts +8 -0
- package/src/module.ts +52 -0
- package/src/no-own-execution.test.ts +86 -0
- package/src/prebuild.test.ts +68 -0
- package/src/project.ts +495 -0
- package/src/revive.ts +120 -0
- package/src/subset.ts +224 -0
package/dist/host.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface IntrinsicDef {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly description?: string;
|
|
4
|
+
readonly outputKey?: string;
|
|
5
|
+
/** Required: authored as a tagged template. Mutually exclusive with the two flags below (F-Host-Registry). */
|
|
6
|
+
readonly isTag: boolean;
|
|
7
|
+
/** Opt-in, per intrinsic: the plain-call form folds to an envelope. */
|
|
8
|
+
readonly foldsAsCall?: boolean;
|
|
9
|
+
/** Opt-in, per intrinsic: the plain-call form is evaluated at fold time. */
|
|
10
|
+
readonly foldsEagerly?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function intrinsicTagFolds(def: {
|
|
13
|
+
isTag?: boolean;
|
|
14
|
+
}): boolean;
|
|
15
|
+
export declare function intrinsicCallFolds(def: {
|
|
16
|
+
isTag?: boolean;
|
|
17
|
+
foldsAsCall?: boolean;
|
|
18
|
+
}): boolean;
|
|
19
|
+
export declare function intrinsicCallFoldsEagerly(def: {
|
|
20
|
+
isTag?: boolean;
|
|
21
|
+
foldsEagerly?: boolean;
|
|
22
|
+
}): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* What a host-owned specifier really exports: specifier, then export name, to
|
|
25
|
+
* the live value. F-Host-Interface item 1's entity constructors live here, as
|
|
26
|
+
* do the intrinsic and helper functions items 3 and 4 name, because revival
|
|
27
|
+
* has to *call* them (F-Val-Fate) and a description cannot be called.
|
|
28
|
+
*/
|
|
29
|
+
export type HostValues = ReadonlyMap<string, ReadonlyMap<string, unknown>>;
|
|
30
|
+
/** F-Profile: which profile the implementation is being judged in. */
|
|
31
|
+
export type Profile = "full" | "data-host";
|
|
32
|
+
export interface Host {
|
|
33
|
+
/** Defaults to `full`. `data-host` admits S-ExportDefault (spec 1.2) and is what an evaluator with no runtime declares. */
|
|
34
|
+
readonly profile?: Profile;
|
|
35
|
+
readonly intrinsics: readonly IntrinsicDef[];
|
|
36
|
+
readonly helpers: readonly {
|
|
37
|
+
name: string;
|
|
38
|
+
module: string;
|
|
39
|
+
note: string;
|
|
40
|
+
}[];
|
|
41
|
+
readonly ownedSpecifierPrefixes: readonly string[];
|
|
42
|
+
readonly values: HostValues;
|
|
43
|
+
}
|
|
44
|
+
export declare const EMPTY_HOST: Host;
|
|
45
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,8GAA8G;IAC9G,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AACD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAA+B;AACnG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAA2D;AACvJ,wBAAgB,yBAAyB,CAAC,GAAG,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAA4D;AAEhK;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3E,sEAAsE;AACtE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;AAE3C,MAAM,WAAW,IAAI;IACnB,2HAA2H;IAC3H,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5E,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AACD,eAAO,MAAM,UAAU,EAAE,IAAsG,CAAC"}
|
package/dist/host.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function intrinsicTagFolds(def) { return def.isTag === true; }
|
|
2
|
+
export function intrinsicCallFolds(def) { return def.isTag !== true && def.foldsAsCall === true; }
|
|
3
|
+
export function intrinsicCallFoldsEagerly(def) { return def.isTag !== true && def.foldsEagerly === true; }
|
|
4
|
+
export const EMPTY_HOST = { profile: "full", intrinsics: [], helpers: [], ownedSpecifierPrefixes: [], values: new Map() };
|
|
5
|
+
//# sourceMappingURL=host.js.map
|
package/dist/host.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,iBAAiB,CAAC,GAAwB,IAAa,OAAO,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC;AACnG,MAAM,UAAU,kBAAkB,CAAC,GAA+C,IAAa,OAAO,GAAG,CAAC,KAAK,KAAK,IAAI,IAAI,GAAG,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC;AACvJ,MAAM,UAAU,yBAAyB,CAAC,GAAgD,IAAa,OAAO,GAAG,CAAC,KAAK,KAAK,IAAI,IAAI,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC;AAqBhK,MAAM,CAAC,MAAM,UAAU,GAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./host.js";
|
|
2
|
+
export * from "./subset.js";
|
|
3
|
+
export * from "./fnbody.js";
|
|
4
|
+
export * from "./fold.js";
|
|
5
|
+
export * from "./foldable-helpers.js";
|
|
6
|
+
export * from "./module.js";
|
|
7
|
+
export * from "./project.js";
|
|
8
|
+
export { referenceAdapter, referenceDataHostAdapter } from "./adapter.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./host.js";
|
|
2
|
+
export * from "./subset.js";
|
|
3
|
+
export * from "./fnbody.js";
|
|
4
|
+
export * from "./fold.js";
|
|
5
|
+
export * from "./foldable-helpers.js";
|
|
6
|
+
export * from "./module.js";
|
|
7
|
+
export * from "./project.js";
|
|
8
|
+
export { referenceAdapter, referenceDataHostAdapter } from "./adapter.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
import { type ShapeViolation } from "./subset.js";
|
|
3
|
+
import { type Host } from "./host.js";
|
|
4
|
+
export declare function installHost(host: Host): void;
|
|
5
|
+
export declare function parse(source: string, fileName?: string): ts.SourceFile;
|
|
6
|
+
export declare function exportInitializer(sf: ts.SourceFile, name: string, admitDefault?: boolean): ts.Expression | undefined;
|
|
7
|
+
/** S-CallLocal's callee set: names this file binds by S-LocalFunction or imports from a project specifier. Syntax only. */
|
|
8
|
+
export declare function localCallees(sf: ts.SourceFile): Set<string>;
|
|
9
|
+
export declare function shapeOfExport(source: string, name: string, host?: Host): ShapeViolation | undefined | "no-such-export";
|
|
10
|
+
export declare function foldExport(source: string, name: string, host?: Host, externals?: ReadonlyMap<string, unknown>, fileName?: string): {
|
|
11
|
+
ok: true;
|
|
12
|
+
value: unknown;
|
|
13
|
+
} | {
|
|
14
|
+
ok: false;
|
|
15
|
+
rule: string;
|
|
16
|
+
line: number;
|
|
17
|
+
column: number;
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAA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fold.js";
|
|
3
|
+
import { findShapeViolation } from "./subset.js";
|
|
4
|
+
import { registerHelpers, registerHostSpecifiers } from "./foldable-helpers.js";
|
|
5
|
+
import { EMPTY_HOST } from "./host.js";
|
|
6
|
+
export function installHost(host) { registerHelpers(host.helpers); registerHostSpecifiers(host.ownedSpecifierPrefixes); }
|
|
7
|
+
export function parse(source, fileName = "fixture.ts") { return ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true); }
|
|
8
|
+
export function exportInitializer(sf, name, admitDefault = false) {
|
|
9
|
+
for (const st of sf.statements) {
|
|
10
|
+
// S-ExportDefault: `export default ⟨Expr⟩` is the export named `default`, in data-host.
|
|
11
|
+
if (name === "default" && admitDefault && ts.isExportAssignment(st) && !st.isExportEquals)
|
|
12
|
+
return st.expression;
|
|
13
|
+
if (!ts.isVariableStatement(st) || !st.modifiers?.some((x) => x.kind === ts.SyntaxKind.ExportKeyword))
|
|
14
|
+
continue;
|
|
15
|
+
for (const d of st.declarationList.declarations)
|
|
16
|
+
if (ts.isIdentifier(d.name) && d.name.text === name)
|
|
17
|
+
return d.initializer;
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
/** S-CallLocal's callee set: names this file binds by S-LocalFunction or imports from a project specifier. Syntax only. */
|
|
22
|
+
export function localCallees(sf) {
|
|
23
|
+
const names = new Set();
|
|
24
|
+
for (const st of sf.statements) {
|
|
25
|
+
if (ts.isFunctionDeclaration(st) && st.name && st.body)
|
|
26
|
+
names.add(st.name.text);
|
|
27
|
+
if (ts.isVariableStatement(st) && (st.declarationList.flags & ts.NodeFlags.Const) !== 0) {
|
|
28
|
+
for (const d of st.declarationList.declarations) {
|
|
29
|
+
if (ts.isIdentifier(d.name) && d.initializer && (ts.isArrowFunction(d.initializer) || ts.isFunctionExpression(d.initializer)))
|
|
30
|
+
names.add(d.name.text);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (ts.isImportDeclaration(st) && ts.isStringLiteral(st.moduleSpecifier) && /^\.{1,2}\//.test(st.moduleSpecifier.text) && st.importClause && !st.importClause.isTypeOnly) {
|
|
34
|
+
const c = st.importClause;
|
|
35
|
+
if (c.name)
|
|
36
|
+
names.add(c.name.text);
|
|
37
|
+
if (c.namedBindings && ts.isNamedImports(c.namedBindings))
|
|
38
|
+
for (const el of c.namedBindings.elements)
|
|
39
|
+
if (!el.isTypeOnly)
|
|
40
|
+
names.add(el.name.text);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return names;
|
|
44
|
+
}
|
|
45
|
+
export function shapeOfExport(source, name, host = EMPTY_HOST) {
|
|
46
|
+
installHost(host);
|
|
47
|
+
const sf = parse(source);
|
|
48
|
+
const init = exportInitializer(sf, name, host.profile === "data-host");
|
|
49
|
+
if (!init)
|
|
50
|
+
return "no-such-export";
|
|
51
|
+
return findShapeViolation(init, host.intrinsics, localCallees(sf));
|
|
52
|
+
}
|
|
53
|
+
export function foldExport(source, name, host = EMPTY_HOST, externals = new Map(), fileName = "fixture.ts") {
|
|
54
|
+
installHost(host);
|
|
55
|
+
const sf = parse(source, fileName);
|
|
56
|
+
const init = exportInitializer(sf, name, host.profile === "data-host");
|
|
57
|
+
if (!init)
|
|
58
|
+
return { ok: false, rule: "S-Module", line: 1, column: 1, message: `no export named ${name}` };
|
|
59
|
+
// F-Bind at the expression level: the file's own functions are bound so a
|
|
60
|
+
// same-file call folds here the way it does in a build.
|
|
61
|
+
const consts = collectConsts(sf);
|
|
62
|
+
const bound = new Map(externals);
|
|
63
|
+
for (const fn of collectLocalFunctions(sf, fileName, consts, bound))
|
|
64
|
+
bound.set(fn.name, fn);
|
|
65
|
+
try {
|
|
66
|
+
return { ok: true, value: foldExpr(init, { consts, externals: bound, depth: 0 }, { intrinsics: host.intrinsics }) };
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
if (e instanceof FoldRejection)
|
|
70
|
+
return { ok: false, rule: e.rule, line: e.line, column: e.column, message: e.message };
|
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;IAAC,CAAC;AAChJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Host } from "./host.js";
|
|
2
|
+
export type Verdict = {
|
|
3
|
+
kind: "fold";
|
|
4
|
+
exports: Map<string, unknown>;
|
|
5
|
+
captures: Set<string>;
|
|
6
|
+
} | {
|
|
7
|
+
kind: "run";
|
|
8
|
+
rule: string;
|
|
9
|
+
reason: string;
|
|
10
|
+
};
|
|
11
|
+
export interface ProjectResult {
|
|
12
|
+
/** Final verdicts, after the fixpoint. */
|
|
13
|
+
readonly verdicts: Map<string, Verdict>;
|
|
14
|
+
/** Tentative J2 verdicts, before J3 disposed of them. */
|
|
15
|
+
readonly tentative: Map<string, Verdict>;
|
|
16
|
+
/** Why a file that reduced on its own was nonetheless tainted. */
|
|
17
|
+
readonly taintReason: Map<string, string>;
|
|
18
|
+
/** The file whose taint reached it, the other end of the F-Succ edge that fired. */
|
|
19
|
+
readonly taintSource: Map<string, string>;
|
|
20
|
+
}
|
|
21
|
+
export declare function foldProject(files: ReadonlyMap<string, string>, host?: Host): ProjectResult;
|
|
22
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAMlD,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,GACtE;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAsYlD,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,GAAE,IAAiB,GAAG,aAAa,CAoEtG"}
|