@dancrumb/cant-compiler 0.0.0-stage → 0.10.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.
Files changed (78) hide show
  1. package/dist/bodies.d.ts +33 -0
  2. package/dist/bodies.d.ts.map +1 -0
  3. package/dist/bodies.js +512 -0
  4. package/dist/bodies.js.map +1 -0
  5. package/dist/check.d.ts +18 -0
  6. package/dist/check.d.ts.map +1 -0
  7. package/dist/check.js +30 -0
  8. package/dist/check.js.map +1 -0
  9. package/dist/cli.d.ts +3 -0
  10. package/dist/cli.d.ts.map +1 -0
  11. package/dist/cli.js +90 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/compile.d.ts +20 -0
  14. package/dist/compile.d.ts.map +1 -0
  15. package/dist/compile.js +777 -0
  16. package/dist/compile.js.map +1 -0
  17. package/dist/constants.d.ts +22 -0
  18. package/dist/constants.d.ts.map +1 -0
  19. package/dist/constants.js +262 -0
  20. package/dist/constants.js.map +1 -0
  21. package/dist/declarations.d.ts +54 -0
  22. package/dist/declarations.d.ts.map +1 -0
  23. package/dist/declarations.js +202 -0
  24. package/dist/declarations.js.map +1 -0
  25. package/dist/diagnostic.d.ts +19 -0
  26. package/dist/diagnostic.d.ts.map +1 -0
  27. package/dist/diagnostic.js +27 -0
  28. package/dist/diagnostic.js.map +1 -0
  29. package/dist/entities.d.ts +32 -0
  30. package/dist/entities.d.ts.map +1 -0
  31. package/dist/entities.js +235 -0
  32. package/dist/entities.js.map +1 -0
  33. package/dist/evaluate.d.ts +30 -0
  34. package/dist/evaluate.d.ts.map +1 -0
  35. package/dist/evaluate.js +79 -0
  36. package/dist/evaluate.js.map +1 -0
  37. package/dist/host.d.ts +8 -0
  38. package/dist/host.d.ts.map +1 -0
  39. package/dist/host.js +13 -0
  40. package/dist/host.js.map +1 -0
  41. package/dist/index.d.ts +31 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +16 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/manifest.d.ts +23 -0
  46. package/dist/manifest.d.ts.map +1 -0
  47. package/dist/manifest.js +93 -0
  48. package/dist/manifest.js.map +1 -0
  49. package/dist/modules.d.ts +84 -0
  50. package/dist/modules.d.ts.map +1 -0
  51. package/dist/modules.js +259 -0
  52. package/dist/modules.js.map +1 -0
  53. package/dist/program.d.ts +24 -0
  54. package/dist/program.d.ts.map +1 -0
  55. package/dist/program.js +38 -0
  56. package/dist/program.js.map +1 -0
  57. package/dist/resolve.d.ts +24 -0
  58. package/dist/resolve.d.ts.map +1 -0
  59. package/dist/resolve.js +203 -0
  60. package/dist/resolve.js.map +1 -0
  61. package/dist/stdlib.d.ts +12 -0
  62. package/dist/stdlib.d.ts.map +1 -0
  63. package/dist/stdlib.js +38 -0
  64. package/dist/stdlib.js.map +1 -0
  65. package/dist/typecheck.d.ts +52 -0
  66. package/dist/typecheck.d.ts.map +1 -0
  67. package/dist/typecheck.js +1408 -0
  68. package/dist/typecheck.js.map +1 -0
  69. package/dist/types.d.ts +130 -0
  70. package/dist/types.d.ts.map +1 -0
  71. package/dist/types.js +199 -0
  72. package/dist/types.js.map +1 -0
  73. package/dist/weave.d.ts +3 -0
  74. package/dist/weave.d.ts.map +1 -0
  75. package/dist/weave.js +40 -0
  76. package/dist/weave.js.map +1 -0
  77. package/package.json +47 -3
  78. package/README.md +0 -3
@@ -0,0 +1,79 @@
1
+ import { evaluate, } from '@dancrumb/cant-shared';
2
+ /** A symbol's ID in a compiled program, `<module>#<name>` (docs/adr/0039-compiled-programs.md). */
3
+ export const symbolId = (symbol) => `${symbol.module}#${symbol.name}`;
4
+ /**
5
+ * Works out the values of constant expressions with the evaluator the interpreter shares
6
+ * (docs/adr/0039-compiled-programs.md), resolving names through the compiler's references.
7
+ * Each top-level constant is evaluated once.
8
+ */
9
+ export class ConstantValues {
10
+ references;
11
+ idOf;
12
+ values = new Map();
13
+ working = new Set();
14
+ /** `idOf` names an enum's symbol in the values it gives, as a compiled program names it. */
15
+ constructor(references, idOf = symbolId) {
16
+ this.references = references;
17
+ this.idOf = idOf;
18
+ }
19
+ /** What evaluating a top-level constant's value gives. A constant that depends on itself isn't constant. */
20
+ of(constant) {
21
+ let result = this.values.get(constant);
22
+ if (result === undefined) {
23
+ if (this.working.has(constant))
24
+ return { kind: 'notConstant', expression: constant.value };
25
+ this.working.add(constant);
26
+ result = evaluate(constant.value, this.scope());
27
+ this.working.delete(constant);
28
+ this.values.set(constant, result);
29
+ }
30
+ return result;
31
+ }
32
+ /**
33
+ * Evaluate an expression. Inside an action, `locals` says which names are locals, and
34
+ * `localValues` gives the value of those given a constant value, by where they are declared.
35
+ */
36
+ evaluate(expression, locals, localValues) {
37
+ return evaluate(expression, this.scope(locals, localValues));
38
+ }
39
+ /** The value of a constant expression, or `undefined` if it doesn't have one. */
40
+ value(expression, locals, localValues) {
41
+ const result = this.evaluate(expression, locals, localValues);
42
+ return result.kind === 'value' ? result.value : undefined;
43
+ }
44
+ scope(locals, localValues) {
45
+ return {
46
+ value: (name) => {
47
+ if (name.type === 'identifier') {
48
+ const local = locals?.get(name);
49
+ if (local !== undefined)
50
+ return localValues?.get(local.declaration);
51
+ }
52
+ const declaration = this.references.get(name)?.declaration;
53
+ if (declaration?.type !== 'const')
54
+ return undefined;
55
+ const result = this.of(declaration);
56
+ return result.kind === 'value' ? result.value : undefined;
57
+ },
58
+ enumMember: (object, member) => {
59
+ const symbol = this.references.get(object);
60
+ const declaration = symbol?.declaration;
61
+ if (symbol === undefined || declaration?.type !== 'enumDeclaration')
62
+ return undefined;
63
+ const found = declaration.members.find((candidate) => candidate.name.value === member.value);
64
+ if (found === undefined)
65
+ return undefined;
66
+ // A member without a value has its name as its value (docs/adr/0013-enums.md).
67
+ let value = { kind: 'text', value: found.name.value };
68
+ if (found.value !== undefined) {
69
+ const result = evaluate(found.value, this.scope());
70
+ if (result.kind !== 'value' || result.value.kind === 'enum' || result.value.kind === 'object')
71
+ return undefined;
72
+ value = result.value;
73
+ }
74
+ return { kind: 'enum', enum: this.idOf(symbol), value };
75
+ },
76
+ };
77
+ }
78
+ }
79
+ //# sourceMappingURL=evaluate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate.js","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAQT,MAAM,uBAAuB,CAAC;AAK/B,mGAAmG;AACnG,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAoB,EAAU,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;AAE5F;;;;GAIG;AACH,MAAM,OAAO,cAAc;IACR,UAAU,CAAa;IACvB,IAAI,CAAmC;IACvC,MAAM,GAAG,IAAI,GAAG,EAAgC,CAAC;IACjD,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAEvD,4FAA4F;IAC5F,YAAY,UAAsB,EAAE,IAAI,GAAqC,QAAQ;QACnF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,4GAA4G;IAC5G,EAAE,CAAC,QAA0B;QAC3B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;YAC3F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC3B,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YAChD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,IA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that live only in memory. */
2
+ export interface Host {
3
+ /** The file's text, or `undefined` if it doesn't exist or can't be read. */
4
+ readFile(path: string): string | undefined;
5
+ }
6
+ /** Reads files from the file system. */
7
+ export declare const fileSystemHost: Host;
8
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,MAAM,WAAW,IAAI;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC5C;AAED,wCAAwC;AACxC,eAAO,MAAM,cAAc,EAAE,IAQ5B,CAAC"}
package/dist/host.js ADDED
@@ -0,0 +1,13 @@
1
+ import { readFileSync } from 'node:fs';
2
+ /** Reads files from the file system. */
3
+ export const fileSystemHost = {
4
+ readFile(path) {
5
+ try {
6
+ return readFileSync(path, 'utf-8');
7
+ }
8
+ catch {
9
+ return undefined;
10
+ }
11
+ },
12
+ };
13
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,wCAAwC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,QAAQ,CAAC,IAAI;QACX,IAAI,CAAC;YACH,OAAO,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1,31 @@
1
+ export { check } from './check.ts';
2
+ export type { CheckResult } from './check.ts';
3
+ export { checkProgram } from './program.ts';
4
+ export type { CheckedProgram } from './program.ts';
5
+ export { collectDeclarations, MAIN_NAMESPACE } from './declarations.ts';
6
+ export type { CollectedDeclarations, InNamespace, ModuleSymbols, NamespaceSymbols, TypeDeclaration, } from './declarations.ts';
7
+ export { formatDiagnostic } from './diagnostic.ts';
8
+ export type { Diagnostic } from './diagnostic.ts';
9
+ export { fileSystemHost } from './host.ts';
10
+ export type { Host } from './host.ts';
11
+ export { findManifest, MANIFEST, readManifest } from './manifest.ts';
12
+ export type { Manifest } from './manifest.ts';
13
+ export { loadProgram, symbolOf } from './modules.ts';
14
+ export type { ImportedSymbol, ImportTarget, LoadedProgram, Module, ModuleSymbol, SymbolKind, TypeKind, } from './modules.ts';
15
+ export { resolveBodies } from './bodies.ts';
16
+ export type { LocalBinding, Locals } from './bodies.ts';
17
+ export { checkEntities } from './entities.ts';
18
+ export type { NavigationField } from './entities.ts';
19
+ export { resolveNames } from './resolve.ts';
20
+ export type { References } from './resolve.ts';
21
+ export { checkConstants } from './constants.ts';
22
+ export type { ConstantsInput } from './constants.ts';
23
+ export { checkTypes } from './typecheck.ts';
24
+ export type { ResolvedProgram } from './typecheck.ts';
25
+ export { createAssignable, describe as describeType, typeOf } from './types.ts';
26
+ export type { Assignable, Type } from './types.ts';
27
+ export { STANDARD_LIBRARY } from './stdlib.ts';
28
+ export type { StandardKind } from './stdlib.ts';
29
+ export { compile, rootOf } from './compile.ts';
30
+ export type { CompileResult } from './compile.ts';
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,YAAY,EACV,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,M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;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ export { check } from './check.js';
2
+ export { checkProgram } from './program.js';
3
+ export { collectDeclarations, MAIN_NAMESPACE } from './declarations.js';
4
+ export { formatDiagnostic } from './diagnostic.js';
5
+ export { fileSystemHost } from './host.js';
6
+ export { findManifest, MANIFEST, readManifest } from './manifest.js';
7
+ export { loadProgram, symbolOf } from './modules.js';
8
+ export { resolveBodies } from './bodies.js';
9
+ export { checkEntities } from './entities.js';
10
+ export { resolveNames } from './resolve.js';
11
+ export { checkConstants } from './constants.js';
12
+ export { checkTypes } from './typecheck.js';
13
+ export { createAssignable, describe as describeType, typeOf } from './types.js';
14
+ export { STANDARD_LIBRARY } from './stdlib.js';
15
+ export { compile, rootOf } from './compile.js';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAWrD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type Diagnostic } from './diagnostic.ts';
2
+ import type { Host } from './host.ts';
3
+ /** The manifest's file name (docs/adr/0031-module-resolution.md). */
4
+ export declare const MANIFEST = "cant.json";
5
+ /** A program's `cant.json`: where each scope's modules are. */
6
+ export interface Manifest {
7
+ path: string;
8
+ /** Each scope's directory, as an absolute path ending in the path separator. */
9
+ scopes: Map<string, string>;
10
+ }
11
+ export interface LoadedManifest {
12
+ manifest?: Manifest;
13
+ diagnostics: Diagnostic[];
14
+ }
15
+ /**
16
+ * Find the program's manifest: `cant.json` in the entry module's directory, or the nearest
17
+ * directory above it that has one. A program with no manifest can only use the `cant` scope and
18
+ * URL imports.
19
+ */
20
+ export declare function findManifest(entry: string, host: Host): LoadedManifest;
21
+ /** Read a manifest's scopes, reporting anything that breaks the rules of docs/adr/0031-module-resolution.md. */
22
+ export declare function readManifest(path: string, source: string): LoadedManifest;
23
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,qEAAqE;AACrE,eAAO,MAAM,QAAQ,cAAc,CAAC;AAEpC,+DAA+D;AAC/D,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAkBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,cAAc,CAUtE;AAED,gHAAgH;AAChH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,CAgDzE"}
@@ -0,0 +1,93 @@
1
+ import { dirname, join } from 'node:path';
2
+ import { fileURLToPath, pathToFileURL } from 'node:url';
3
+ import { error } from './diagnostic.js';
4
+ /** The manifest's file name (docs/adr/0031-module-resolution.md). */
5
+ export const MANIFEST = 'cant.json';
6
+ const START = { start: { line: 1, column: 1, offset: 0 }, end: { line: 1, column: 1, offset: 0 } };
7
+ /** The position of the first `"text"` in `source`, or the start of the file if it isn't there. */
8
+ function positionOf(source, text) {
9
+ const offset = source.indexOf(JSON.stringify(text));
10
+ if (offset < 0)
11
+ return START;
12
+ const before = source.slice(0, offset).split('\n');
13
+ const line = before.length;
14
+ const column = (before.at(-1)?.length ?? 0) + 1;
15
+ const length = JSON.stringify(text).length;
16
+ return {
17
+ start: { line, column, offset },
18
+ end: { line, column: column + length, offset: offset + length },
19
+ };
20
+ }
21
+ /**
22
+ * Find the program's manifest: `cant.json` in the entry module's directory, or the nearest
23
+ * directory above it that has one. A program with no manifest can only use the `cant` scope and
24
+ * URL imports.
25
+ */
26
+ export function findManifest(entry, host) {
27
+ let directory = dirname(entry);
28
+ for (;;) {
29
+ const path = join(directory, MANIFEST);
30
+ const source = host.readFile(path);
31
+ if (source !== undefined)
32
+ return readManifest(path, source);
33
+ const parent = dirname(directory);
34
+ if (parent === directory)
35
+ return { diagnostics: [] };
36
+ directory = parent;
37
+ }
38
+ }
39
+ /** Read a manifest's scopes, reporting anything that breaks the rules of docs/adr/0031-module-resolution.md. */
40
+ export function readManifest(path, source) {
41
+ const diagnostics = [];
42
+ const fail = (code, message, position = START) => {
43
+ diagnostics.push({ ...error(code, message, position), file: path });
44
+ return { diagnostics };
45
+ };
46
+ let parsed;
47
+ try {
48
+ parsed = JSON.parse(source);
49
+ }
50
+ catch (caught) {
51
+ return fail('manifest', `${MANIFEST} isn't valid JSON: ${caught instanceof Error ? caught.message : String(caught)}`);
52
+ }
53
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
54
+ return fail('manifest', `${MANIFEST} must hold a JSON object.`);
55
+ }
56
+ const scopes = new Map();
57
+ const declared = parsed.scopes;
58
+ if (declared === undefined)
59
+ return { manifest: { path, scopes }, diagnostics };
60
+ if (typeof declared !== 'object' || declared === null || Array.isArray(declared)) {
61
+ return fail('manifest', '`scopes` must be an object that maps each scope to a directory.', positionOf(source, 'scopes'));
62
+ }
63
+ const base = pathToFileURL(path);
64
+ for (const [scope, value] of Object.entries(declared)) {
65
+ const position = positionOf(source, scope);
66
+ const report = (message) => {
67
+ diagnostics.push({ ...error('manifest', message, position), file: path });
68
+ };
69
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(scope)) {
70
+ report(`The scope "${scope}" isn't an identifier.`);
71
+ }
72
+ else if (scope === 'cant') {
73
+ report('The `cant` scope is built into the interpreter, so the manifest can\'t map it.');
74
+ }
75
+ else if (typeof value !== 'string') {
76
+ report(`The scope "${scope}" must map to a directory, written as a string.`);
77
+ }
78
+ else if (!value.endsWith('/')) {
79
+ report(`The directory for "${scope}", "${value}", must end in /.`);
80
+ }
81
+ else {
82
+ const url = new URL(value, base);
83
+ if (url.protocol !== 'file:') {
84
+ report(`The directory for "${scope}", "${value}", must be a local file URL: modules can't be fetched from remote URLs.`);
85
+ }
86
+ else {
87
+ scopes.set(scope, fileURLToPath(url));
88
+ }
89
+ }
90
+ }
91
+ return { manifest: { path, scopes }, diagnostics };
92
+ }
93
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAAE,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AAGzD,qEAAqE;AACrE,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC;AAcpC,MAAM,KAAK,GAAa,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;AAE7G,kGAAkG;AAClG,SAAS,UAAU,CAAC,MAAc,EAAE,IAAY;IAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3B,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO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,IAAI,EAAE,CAAC,CAAC;QAC5E,CAAC,CAAC;QACF,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,MAAM,CAAC,cAAc,KAAK,wBAAwB,CAAC,CAAC;QACtD,CAAC;aAAM,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YAC5B,MAAM,CAAC,gFAAgF,CAAC,CAAC;QAC3F,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACrC,MAAM,CAAC,cAAc,KAAK,iDAAiD,CAAC,CAAC;QAC/E,CAAC;aAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,sBAAsB,KAAK,OAAO,KAAK,mBAAmB,CAAC,CAAC;QACrE,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACjC,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;gBAC7B,MAAM,CAAC,sBAAsB,KAAK,OAAO,KAAK,yEAAyE,CAAC,CAAC;YAC3H,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { ActionDeclaration, ConstDeclaration, ImportDeclaration, Name, Program } from '@dancrumb/cant-shared';
2
+ import { type ModuleSymbols, type TypeDeclaration } from './declarations.ts';
3
+ import { type Diagnostic } from './diagnostic.ts';
4
+ import type { Host } from './host.ts';
5
+ import { type Manifest } from './manifest.ts';
6
+ /** What a declared name is (docs/adr/0006-imports.md lists the constructs a module can export). */
7
+ export type SymbolKind = 'type' | 'action' | 'const';
8
+ /** The kinds of declaration that are types. */
9
+ export type TypeKind = 'enum' | 'model' | 'entity' | 'error';
10
+ /** A top-level symbol: a declaration in some module, or a name a standard library module exports. */
11
+ export interface ModuleSymbol {
12
+ kind: SymbolKind;
13
+ /** For a type, which kind of type it is. */
14
+ typeKind?: TypeKind;
15
+ /** The name it is declared with. */
16
+ name: string;
17
+ /** The file that declares it, or the standard library module, such as `cant::Errors`. */
18
+ module: string;
19
+ /** Its declaration, unless it comes from the standard library. */
20
+ declaration?: TypeDeclaration | ActionDeclaration | ConstDeclaration;
21
+ }
22
+ /** Where an import leads: a file, a standard library module, or nowhere it can be found. */
23
+ export type ImportTarget = {
24
+ kind: 'file';
25
+ path: string;
26
+ } | {
27
+ kind: 'standard';
28
+ name: string;
29
+ } | {
30
+ kind: 'unresolved';
31
+ };
32
+ /** A symbol that an import has placed in a namespace. */
33
+ export interface ImportedSymbol {
34
+ symbol: ModuleSymbol;
35
+ via: ImportDeclaration;
36
+ }
37
+ export interface Module {
38
+ /** The module's file, as an absolute path. */
39
+ path: string;
40
+ source: string;
41
+ /** Its syntax tree and declarations, unless it has a syntax error. */
42
+ program?: Program;
43
+ symbols?: ModuleSymbols;
44
+ /** Where each of its imports leads. */
45
+ imports: Map<ImportDeclaration, ImportTarget>;
46
+ /** The symbols its imports place in each namespace, by name. */
47
+ imported: Map<string, Map<string, ImportedSymbol>>;
48
+ /** What it exports, by the names importers see. */
49
+ exports: Map<string, ModuleSymbol>;
50
+ }
51
+ export interface LoadedProgram {
52
+ entry: string;
53
+ manifest?: Manifest;
54
+ /** Every module the program uses, starting with the entry module, by path. */
55
+ modules: Map<string, Module>;
56
+ /** Every problem found, each with the file it is in. */
57
+ diagnostics: Diagnostic[];
58
+ }
59
+ export declare const symbolOf: (module: string, declaration: TypeDeclaration | ActionDeclaration | ConstDeclaration) => ModuleSymbol;
60
+ /**
61
+ * Load a program: the entry module, and every module it imports, directly or not. Each module is
62
+ * parsed and its declarations collected (see `check`), its imports are resolved
63
+ * (docs/adr/0031-module-resolution.md), and its exports, including re-exports, are worked out
64
+ * (docs/adr/0006-imports.md). Each import's symbols are placed in the namespace its `into`
65
+ * names, or the namespace it appears in, and names that clash there are reported.
66
+ */
67
+ export declare function loadProgram(entry: string, host: Host): LoadedProgram;
68
+ /**
69
+ * The file a URL in a module names, resolved against the module's own location, or `undefined`
70
+ * if it is a remote URL (docs/adr/0031-module-resolution.md).
71
+ */
72
+ export declare function fileFromUrl(modulePath: string, url: string): string | undefined;
73
+ /** Every symbol `name` could mean in `namespace` of `module`: its own declarations, then imported ones. */
74
+ export declare function symbolsNamed(module: Module, namespace: string, name: string): ModuleSymbol[];
75
+ /** Whether `namespace` exists in `module`: it declares something there, or imports into it. */
76
+ export declare function hasNamespace(module: Module, namespace: string): boolean;
77
+ /**
78
+ * The symbol a name means where it appears: in the namespace it names, or the current namespace
79
+ * if it names none (docs/adr/0005-module-namespaces.md). When it could mean symbols of several
80
+ * kinds, the first is a type, then an action, then a constant.
81
+ */
82
+ export declare function findSymbol(module: Module, namespace: string, name: Name): ModuleSymbol | undefined;
83
+ export declare const describeName: (name: Name) => string;
84
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAEhB,iBAAiB,EACjB,IAAI,EACJ,OAAO,EAER,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGtE,mGAAmG;AACnG,MAAM,MAAM,U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