@inventarch/language 0.0.0-stage → 1.0.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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +33 -2
- package/SPEC.md +225 -0
- package/dist/ast.d.ts +114 -0
- package/dist/ast.d.ts.map +1 -0
- package/dist/ast.js +2 -0
- package/dist/ast.js.map +1 -0
- package/dist/compile/compile.d.ts +82 -0
- package/dist/compile/compile.d.ts.map +1 -0
- package/dist/compile/compile.js +249 -0
- package/dist/compile/compile.js.map +1 -0
- package/dist/compile/index.d.ts +6 -0
- package/dist/compile/index.d.ts.map +1 -0
- package/dist/compile/index.js +4 -0
- package/dist/compile/index.js.map +1 -0
- package/dist/compile/spellings.d.ts +7 -0
- package/dist/compile/spellings.d.ts.map +1 -0
- package/dist/compile/spellings.js +47 -0
- package/dist/compile/spellings.js.map +1 -0
- package/dist/compile/values.d.ts +32 -0
- package/dist/compile/values.d.ts.map +1 -0
- package/dist/compile/values.js +48 -0
- package/dist/compile/values.js.map +1 -0
- package/dist/diagnostics.d.ts +22 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +71 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/editor/index.d.ts +49 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +155 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/fold.d.ts +8 -0
- package/dist/fold.d.ts.map +1 -0
- package/dist/fold.js +26 -0
- package/dist/fold.js.map +1 -0
- package/dist/formatter.d.ts +10 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +108 -0
- package/dist/formatter.js.map +1 -0
- package/dist/identity.d.ts +31 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +64 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel.generated.d.ts +99 -0
- package/dist/kernel.generated.d.ts.map +1 -0
- package/dist/kernel.generated.js +422 -0
- package/dist/kernel.generated.js.map +1 -0
- package/dist/parser/index.d.ts +5 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +3 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/parser.d.ts +11 -0
- package/dist/parser/parser.d.ts.map +1 -0
- package/dist/parser/parser.js +297 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/values.d.ts +24 -0
- package/dist/parser/values.d.ts.map +1 -0
- package/dist/parser/values.js +284 -0
- package/dist/parser/values.js.map +1 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +21 -0
- package/dist/paths.js.map +1 -0
- package/dist/references.d.ts +15 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +40 -0
- package/dist/references.js.map +1 -0
- package/dist/registry/consent.d.ts +11 -0
- package/dist/registry/consent.d.ts.map +1 -0
- package/dist/registry/consent.js +31 -0
- package/dist/registry/consent.js.map +1 -0
- package/dist/registry/extract.d.ts +11 -0
- package/dist/registry/extract.d.ts.map +1 -0
- package/dist/registry/extract.js +275 -0
- package/dist/registry/extract.js.map +1 -0
- package/dist/registry/fields.d.ts +14 -0
- package/dist/registry/fields.d.ts.map +1 -0
- package/dist/registry/fields.js +30 -0
- package/dist/registry/fields.js.map +1 -0
- package/dist/registry/floor.d.ts +17 -0
- package/dist/registry/floor.d.ts.map +1 -0
- package/dist/registry/floor.js +42 -0
- package/dist/registry/floor.js.map +1 -0
- package/dist/registry/index.d.ts +19 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +80 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/merge.d.ts +32 -0
- package/dist/registry/merge.d.ts.map +1 -0
- package/dist/registry/merge.js +84 -0
- package/dist/registry/merge.js.map +1 -0
- package/dist/registry/order.d.ts +12 -0
- package/dist/registry/order.d.ts.map +1 -0
- package/dist/registry/order.js +134 -0
- package/dist/registry/order.js.map +1 -0
- package/dist/registry/records.d.ts +14 -0
- package/dist/registry/records.d.ts.map +1 -0
- package/dist/registry/records.js +64 -0
- package/dist/registry/records.js.map +1 -0
- package/dist/registry/schemas.d.ts +20 -0
- package/dist/registry/schemas.d.ts.map +1 -0
- package/dist/registry/schemas.js +282 -0
- package/dist/registry/schemas.js.map +1 -0
- package/dist/registry/types.d.ts +130 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +2 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/scanner/index.d.ts +16 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +78 -0
- package/dist/scanner/index.js.map +1 -0
- package/dist/scanner/lines.d.ts +46 -0
- package/dist/scanner/lines.d.ts.map +1 -0
- package/dist/scanner/lines.js +210 -0
- package/dist/scanner/lines.js.map +1 -0
- package/dist/scanner/tokenize.d.ts +9 -0
- package/dist/scanner/tokenize.d.ts.map +1 -0
- package/dist/scanner/tokenize.js +125 -0
- package/dist/scanner/tokenize.js.map +1 -0
- package/dist/scanner/tokens.d.ts +52 -0
- package/dist/scanner/tokens.d.ts.map +1 -0
- package/dist/scanner/tokens.js +2 -0
- package/dist/scanner/tokens.js.map +1 -0
- package/dist/semantic/cases.d.ts +12 -0
- package/dist/semantic/cases.d.ts.map +1 -0
- package/dist/semantic/cases.js +81 -0
- package/dist/semantic/cases.js.map +1 -0
- package/dist/semantic/cells.d.ts +9 -0
- package/dist/semantic/cells.d.ts.map +1 -0
- package/dist/semantic/cells.js +120 -0
- package/dist/semantic/cells.js.map +1 -0
- package/dist/semantic/conditions.d.ts +22 -0
- package/dist/semantic/conditions.d.ts.map +1 -0
- package/dist/semantic/conditions.js +54 -0
- package/dist/semantic/conditions.js.map +1 -0
- package/dist/semantic/contracts.d.ts +11 -0
- package/dist/semantic/contracts.d.ts.map +1 -0
- package/dist/semantic/contracts.js +75 -0
- package/dist/semantic/contracts.js.map +1 -0
- package/dist/semantic/edges.d.ts +19 -0
- package/dist/semantic/edges.d.ts.map +1 -0
- package/dist/semantic/edges.js +129 -0
- package/dist/semantic/edges.js.map +1 -0
- package/dist/semantic/placement.d.ts +6 -0
- package/dist/semantic/placement.d.ts.map +1 -0
- package/dist/semantic/placement.js +47 -0
- package/dist/semantic/placement.js.map +1 -0
- package/dist/semantic/requirements.d.ts +14 -0
- package/dist/semantic/requirements.d.ts.map +1 -0
- package/dist/semantic/requirements.js +32 -0
- package/dist/semantic/requirements.js.map +1 -0
- package/dist/semantic/resolve.d.ts +23 -0
- package/dist/semantic/resolve.d.ts.map +1 -0
- package/dist/semantic/resolve.js +62 -0
- package/dist/semantic/resolve.js.map +1 -0
- package/dist/semantic/selectors.d.ts +10 -0
- package/dist/semantic/selectors.d.ts.map +1 -0
- package/dist/semantic/selectors.js +33 -0
- package/dist/semantic/selectors.js.map +1 -0
- package/dist/semantic/types.d.ts +56 -0
- package/dist/semantic/types.d.ts.map +1 -0
- package/dist/semantic/types.js +11 -0
- package/dist/semantic/types.js.map +1 -0
- package/dist/semantic/variants.d.ts +10 -0
- package/dist/semantic/variants.d.ts.map +1 -0
- package/dist/semantic/variants.js +63 -0
- package/dist/semantic/variants.js.map +1 -0
- package/dist/semantic/vocabulary.d.ts +12 -0
- package/dist/semantic/vocabulary.d.ts.map +1 -0
- package/dist/semantic/vocabulary.js +33 -0
- package/dist/semantic/vocabulary.js.map +1 -0
- package/dist/taxonomy.d.ts +51 -0
- package/dist/taxonomy.d.ts.map +1 -0
- package/dist/taxonomy.js +42 -0
- package/dist/taxonomy.js.map +1 -0
- package/package.json +220 -3
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexical normalisation of a source path (spec 1.4): forward slashes; no empty, `.` or resolvable
|
|
3
|
+
* `..` segments; no leading `./`. Case is kept as given, because compile has no file system to ask.
|
|
4
|
+
*/
|
|
5
|
+
export declare function canonicalPath(path: string): string;
|
|
6
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYlD"}
|
package/dist/paths.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lexical normalisation of a source path (spec 1.4): forward slashes; no empty, `.` or resolvable
|
|
3
|
+
* `..` segments; no leading `./`. Case is kept as given, because compile has no file system to ask.
|
|
4
|
+
*/
|
|
5
|
+
export function canonicalPath(path) {
|
|
6
|
+
const out = [];
|
|
7
|
+
for (const segment of path.split('\\').join('/').split('/')) {
|
|
8
|
+
if (segment === '' || segment === '.')
|
|
9
|
+
continue;
|
|
10
|
+
if (segment === '..') {
|
|
11
|
+
if (out.length > 0 && out[out.length - 1] !== '..')
|
|
12
|
+
out.pop();
|
|
13
|
+
else
|
|
14
|
+
out.push('..');
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
out.push(segment);
|
|
18
|
+
}
|
|
19
|
+
return out.join('/');
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5D,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,GAAG;YAAE,SAAS;QAChD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI;gBAAE,GAAG,CAAC,GAAG,EAAE,CAAC;;gBACzD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,SAAS;QACX,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FileNode, RecordNode, Span } from './ast.js';
|
|
2
|
+
import type { EdgeReference } from './semantic/types.js';
|
|
3
|
+
export interface TypedReference {
|
|
4
|
+
readonly reference: EdgeReference;
|
|
5
|
+
readonly record: RecordNode;
|
|
6
|
+
readonly span: Span;
|
|
7
|
+
readonly field: string;
|
|
8
|
+
readonly section?: string;
|
|
9
|
+
readonly use: 'value' | 'relationship';
|
|
10
|
+
/** Index among typed references in this authored value, including repeated targets. */
|
|
11
|
+
readonly index: number;
|
|
12
|
+
}
|
|
13
|
+
/** Typed uses, not graph adjacency. The AST is the sole authority for reference syntax. */
|
|
14
|
+
export declare function references(ast: FileNode): readonly TypedReference[];
|
|
15
|
+
//# sourceMappingURL=references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAS,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAAC;IACvC,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,SAAS,cAAc,EAAE,CAqCnE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { targetOf, verbPrefix } from './semantic/edges.js';
|
|
2
|
+
/** Typed uses, not graph adjacency. The AST is the sole authority for reference syntax. */
|
|
3
|
+
export function references(ast) {
|
|
4
|
+
const result = [];
|
|
5
|
+
const valueRefs = (value) => value.kind === 'ref'
|
|
6
|
+
? [value]
|
|
7
|
+
: value.kind === 'list'
|
|
8
|
+
? value.items.filter((item) => item.kind === 'ref')
|
|
9
|
+
: [];
|
|
10
|
+
const visit = (children, record, section) => {
|
|
11
|
+
for (const child of children) {
|
|
12
|
+
if (child.kind === 'record') {
|
|
13
|
+
recordRefs(child);
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const verb = child.kind === 'field' && section === 'relationships' ? verbPrefix(child.words) : undefined;
|
|
17
|
+
const target = child.kind === 'field' && verb !== undefined ? targetOf(child, verb.length) : undefined;
|
|
18
|
+
const refs = target === undefined ? valueRefs(child.value) : [target];
|
|
19
|
+
refs.forEach((reference, index) => result.push({
|
|
20
|
+
reference,
|
|
21
|
+
record,
|
|
22
|
+
span: child.span,
|
|
23
|
+
field: child.kind === 'field' ? child.key : '-',
|
|
24
|
+
...(section === undefined ? {} : { section }),
|
|
25
|
+
use: target === undefined ? 'value' : 'relationship',
|
|
26
|
+
index,
|
|
27
|
+
}));
|
|
28
|
+
if (child.kind === 'field')
|
|
29
|
+
visit(child.children, record, section);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const recordRefs = (record) => {
|
|
33
|
+
visit(record.head, record);
|
|
34
|
+
for (const section of record.sections)
|
|
35
|
+
visit(section.children, record, section.name);
|
|
36
|
+
};
|
|
37
|
+
ast.records.forEach(recordRefs);
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAc3D,2FAA2F;AAC3F,MAAM,UAAU,UAAU,CAAC,GAAa;IACtC,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,MAAM,SAAS,GAAG,CAAC,KAAY,EAA4B,EAAE,CAC3D,KAAK,CAAC,IAAI,KAAK,KAAK;QAClB,CAAC,CAAC,CAAC,KAAK,CAAC;QACT,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM;YACrB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAA2C,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC;YAC5F,CAAC,CAAC,EAAE,CAAC;IACX,MAAM,KAAK,GAAG,CAAC,QAA8B,EAAE,MAAkB,EAAE,OAAgB,EAAQ,EAAE;QAC3F,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC5B,UAAU,CAAC,KAAK,CAAC,CAAC;gBAClB,SAAS;YACX,CAAC;YACD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACzG,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,K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AChC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Predicate } from '../taxonomy.js';
|
|
2
|
+
import type { ConsentRow, FrozenRegistry } from './types.js';
|
|
3
|
+
/** Row-wise consent: some single row admits the predicate with `source` among its sources and `target` among its targets. No ledger admits nothing. */
|
|
4
|
+
export declare function admits(rows: readonly ConsentRow[] | undefined, predicate: Predicate, source: string, target: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Two-sided consent (spec 6.4): the source keyword's system must admit the edge and so must the
|
|
7
|
+
* target keyword's. Returns the side that refused, or undefined when both admit. An unregistered
|
|
8
|
+
* end is undefined too: that record is refused on its own (2.6), so no edge is judged twice.
|
|
9
|
+
*/
|
|
10
|
+
export declare function consentFor(registry: FrozenRegistry, predicate: Predicate, source: string, target: string, targetFragment?: string): 'source' | 'target' | undefined;
|
|
11
|
+
//# sourceMappingURL=consent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent.d.ts","sourceRoot":"","sources":["../../src/registry/consent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM7D,uJAAuJ;AACvJ,wBAAgB,MAAM,CACpB,IAAI,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,EACvC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,MAAM,GACtB,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAYjC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FLOOR_CONSENT, FLOOR_SYSTEM } from './floor.js';
|
|
2
|
+
function onSide(side, keyword) {
|
|
3
|
+
return side === '*' || side.includes(keyword);
|
|
4
|
+
}
|
|
5
|
+
/** Row-wise consent: some single row admits the predicate with `source` among its sources and `target` among its targets. No ledger admits nothing. */
|
|
6
|
+
export function admits(rows, predicate, source, target) {
|
|
7
|
+
return (rows ?? []).some((row) => row.predicate === predicate && onSide(row.sources, source) && onSide(row.targets, target));
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Two-sided consent (spec 6.4): the source keyword's system must admit the edge and so must the
|
|
11
|
+
* target keyword's. Returns the side that refused, or undefined when both admit. An unregistered
|
|
12
|
+
* end is undefined too: that record is refused on its own (2.6), so no edge is judged twice.
|
|
13
|
+
*/
|
|
14
|
+
export function consentFor(registry, predicate, source, target, targetFragment) {
|
|
15
|
+
const from = registry.registrations.get(source);
|
|
16
|
+
const to = registry.registrations.get(target);
|
|
17
|
+
if (from === undefined || to === undefined)
|
|
18
|
+
return undefined;
|
|
19
|
+
// The floor's built-in ledger is incoming only. It cannot grant outgoing authority,
|
|
20
|
+
// including when an authored declaration happens to use the reserved owner name.
|
|
21
|
+
if (from.system === FLOOR_SYSTEM || !admits(registry.consent.get(from.system), predicate, source, target))
|
|
22
|
+
return 'source';
|
|
23
|
+
if (to.system === FLOOR_SYSTEM) {
|
|
24
|
+
if (targetFragment !== undefined || !admits(FLOOR_CONSENT, predicate, source, target))
|
|
25
|
+
return 'target';
|
|
26
|
+
}
|
|
27
|
+
else if (!admits(registry.consent.get(to.system), predicate, source, target))
|
|
28
|
+
return 'target';
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=consent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent.js","sourceRoot":"","sources":["../../src/registry/consent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY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IACzG,CAAC;SAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC;QAAE,OAAO,QAAQ,CAAC;IAChG,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FileNode } from '../ast.js';
|
|
2
|
+
import type { Diagnostic } from '../diagnostics.js';
|
|
3
|
+
import type { Band } from '../taxonomy.js';
|
|
4
|
+
import type { SystemDeclaration } from './types.js';
|
|
5
|
+
export interface ExtractedSystems {
|
|
6
|
+
readonly systems: readonly SystemDeclaration[];
|
|
7
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
8
|
+
}
|
|
9
|
+
/** Every `@system`, including nested records (spec 4.4). Parser diagnostics remain owned by the caller. */
|
|
10
|
+
export declare function extractSystems(ast: FileNode, band: Band, parserDiagnostics: readonly Diagnostic[]): ExtractedSystems;
|
|
11
|
+
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/registry/extract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,QAAQ,EAAoB,MAAM,WAAW,CAAC;AAElF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,gBAAgB,CAAC;AAIrD,OAAO,KAAK,EAA8C,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAchG,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED,2GAA2G;AAC3G,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,UAAU,EAAE,GAAG,gBAAgB,CAUpH"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { diag } from '../diagnostics.js';
|
|
2
|
+
import { CATEGORIES, KINDS, PREDICATES, isCategory, isKind, isPredicate } from '../taxonomy.js';
|
|
3
|
+
import { fieldOf, restAfter, spelledAs, stringOf } from './fields.js';
|
|
4
|
+
import { RESERVED_KEYWORDS } from './floor.js';
|
|
5
|
+
import { conditionsIn, recordsIn } from './records.js';
|
|
6
|
+
/** Class checks, like the header class checks in parser.ts: a keyword spells like a discriminator; a version is semver with no leading zeros. */
|
|
7
|
+
const KEYWORD = /^[a-z][a-z0-9-]*$/;
|
|
8
|
+
const NAME = /^[A-Za-z][A-Za-z0-9-]*$/;
|
|
9
|
+
const RETIRED_KEYWORDS = ['interface', 'protocol', 'shape'];
|
|
10
|
+
const SEMVER = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
11
|
+
function isSemver(version) {
|
|
12
|
+
const match = SEMVER.exec(version);
|
|
13
|
+
return match !== null && (match[1]?.split('.').every((part) => !/^0\d+$/.test(part)) ?? true);
|
|
14
|
+
}
|
|
15
|
+
/** Every `@system`, including nested records (spec 4.4). Parser diagnostics remain owned by the caller. */
|
|
16
|
+
export function extractSystems(ast, band, parserDiagnostics) {
|
|
17
|
+
const systems = [];
|
|
18
|
+
const diagnostics = [];
|
|
19
|
+
for (const { record, endLine, errors } of recordsIn(ast, parserDiagnostics)) {
|
|
20
|
+
if (record.discriminator !== 'system')
|
|
21
|
+
continue;
|
|
22
|
+
const refused = (span) => errors.some((d) => d.line >= span.line && d.line <= span.endLine);
|
|
23
|
+
const system = systemOf(record, endLine, ast.path, band, diagnostics, refused);
|
|
24
|
+
if (system !== undefined)
|
|
25
|
+
systems.push(system);
|
|
26
|
+
}
|
|
27
|
+
return { systems, diagnostics };
|
|
28
|
+
}
|
|
29
|
+
/** Ignore parser-refused units; items have no block, while field blocks extend to the next sibling. */
|
|
30
|
+
function sectionChildren(record, name, endLine, refused) {
|
|
31
|
+
return record.sections.flatMap((section, index) => {
|
|
32
|
+
if (section.name !== name)
|
|
33
|
+
return [];
|
|
34
|
+
const sectionEnd = (record.sections[index + 1]?.span.line ?? endLine + 1) - 1;
|
|
35
|
+
return section.children.filter((child, position) => {
|
|
36
|
+
const end = child.kind === 'field' ? (section.children[position + 1]?.span.line ?? sectionEnd + 1) - 1 : child.span.endLine;
|
|
37
|
+
return !refused({ line: child.span.line, endLine: end });
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Spec 7.4: report each forbidden condition once, at its authored field. */
|
|
42
|
+
function conditioned(children, where, path, diagnostics) {
|
|
43
|
+
const found = conditionsIn(children);
|
|
44
|
+
for (const child of found) {
|
|
45
|
+
diagnostics.push(diag('IA-LANG-CONDITION-MISPLACED', path, child.span.line, `${path}:${child.span.line}: a when clause cannot sit on ${where} ('${child.key}')`));
|
|
46
|
+
}
|
|
47
|
+
return found.length > 0;
|
|
48
|
+
}
|
|
49
|
+
/** The one head field spelled `spelling`; a second one is a fault on the second. */
|
|
50
|
+
function single(record, spelling, refuse) {
|
|
51
|
+
const matches = record.head.filter((field) => spelledAs(field, spelling));
|
|
52
|
+
const second = matches[1];
|
|
53
|
+
if (second !== undefined)
|
|
54
|
+
refuse(spelling.join(' '), second.span.line, 'appears twice; a head field is written once');
|
|
55
|
+
return matches[0];
|
|
56
|
+
}
|
|
57
|
+
function systemOf(record, endLine, path, band, diagnostics, refused) {
|
|
58
|
+
const headEnd = (record.sections[0]?.span.line ?? endLine + 1) - 1;
|
|
59
|
+
if (refused({ line: record.span.line, endLine: headEnd }))
|
|
60
|
+
return undefined;
|
|
61
|
+
let ok = !conditioned(record.head, `a head field of @system ${record.name}`, path, diagnostics);
|
|
62
|
+
const incomplete = (element, line, why) => {
|
|
63
|
+
diagnostics.push(diag('IA-LANG-REGISTRATION-INCOMPLETE', path, line, `${path}:${line}: @system ${record.name}: ${element} ${why}`));
|
|
64
|
+
};
|
|
65
|
+
const refuse = (element, line, why) => {
|
|
66
|
+
incomplete(element, line, why);
|
|
67
|
+
ok = false;
|
|
68
|
+
};
|
|
69
|
+
const providerField = single(record, ['provider'], refuse);
|
|
70
|
+
const provider = stringOf(providerField);
|
|
71
|
+
if (providerField === undefined)
|
|
72
|
+
refuse('provider', record.span.line, 'is required: a quoted string');
|
|
73
|
+
else if (provider === undefined)
|
|
74
|
+
refuse('provider', providerField.span.line, 'is a quoted string');
|
|
75
|
+
const versionField = single(record, ['version'], refuse);
|
|
76
|
+
const version = stringOf(versionField);
|
|
77
|
+
if (versionField === undefined)
|
|
78
|
+
refuse('version', record.span.line, 'is required: a quoted semver string');
|
|
79
|
+
else if (version === undefined)
|
|
80
|
+
refuse('version', versionField.span.line, 'is a quoted semver string');
|
|
81
|
+
else if (!isSemver(version))
|
|
82
|
+
refuse('version', versionField.span.line, `"${version}" is not a semver string (nonempty identifiers; no leading zeros in core numbers or numeric prerelease identifiers)`);
|
|
83
|
+
const describes = stringOf(fieldOf(record.head, ['describes']));
|
|
84
|
+
let steward;
|
|
85
|
+
for (const stewardField of record.head.filter((field) => spelledAs(field, ['steward']))) {
|
|
86
|
+
if (stewardField.value.kind === 'ref' && stewardField.value.fragment === undefined)
|
|
87
|
+
steward ??= { discriminator: stewardField.value.discriminator, name: stewardField.value.name.toLowerCase() };
|
|
88
|
+
else
|
|
89
|
+
refuse('steward', stewardField.span.line, 'names the steward by reference: `steward @<discriminator> <name>`');
|
|
90
|
+
}
|
|
91
|
+
const requires = [];
|
|
92
|
+
const requiresHead = fieldOf(record.head, ['requires']);
|
|
93
|
+
if (requiresHead !== undefined)
|
|
94
|
+
refuse('requires', requiresHead.span.line, 'is a section holding one bare system name per item, not a head field');
|
|
95
|
+
for (const child of sectionChildren(record, 'requires', endLine, refused)) {
|
|
96
|
+
if (child.kind === 'item' && child.value.kind === 'none')
|
|
97
|
+
continue;
|
|
98
|
+
if (conditioned([child], `requires of @system ${record.name}`, path, diagnostics))
|
|
99
|
+
continue;
|
|
100
|
+
// A system name is an identity slot, lowercased like the header name it must match.
|
|
101
|
+
if (child.kind === 'item' && child.value.kind === 'scalar' && NAME.test(child.value.text))
|
|
102
|
+
requires.push({ name: child.value.text.toLowerCase(), span: child.span });
|
|
103
|
+
else
|
|
104
|
+
incomplete('requires', child.span.line, 'holds one bare system name per item');
|
|
105
|
+
}
|
|
106
|
+
const entries = [];
|
|
107
|
+
const registered = new Set();
|
|
108
|
+
for (const child of sectionChildren(record, 'discriminators', endLine, refused)) {
|
|
109
|
+
if (child.kind !== 'field') {
|
|
110
|
+
incomplete('discriminators', child.span.line, 'holds entries of the form `<keyword> lowers to <kind>`');
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const entry = entryOf(child, record.name, path, diagnostics, incomplete);
|
|
114
|
+
if (entry === undefined)
|
|
115
|
+
continue;
|
|
116
|
+
if (registered.has(entry.keyword)) {
|
|
117
|
+
incomplete(`discriminator '${entry.keyword}'`, child.span.line, 'is registered twice in this system');
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
registered.add(entry.keyword);
|
|
121
|
+
entries.push(entry);
|
|
122
|
+
}
|
|
123
|
+
const consent = [];
|
|
124
|
+
for (const child of sectionChildren(record, 'edges', endLine, refused)) {
|
|
125
|
+
if (child.kind !== 'field') {
|
|
126
|
+
incomplete('edges', child.span.line, 'holds rows of the form `<predicate> <targets> using <sources>`');
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const row = consentRowOf(child, path, diagnostics, incomplete);
|
|
130
|
+
if (row !== undefined)
|
|
131
|
+
consent.push(row);
|
|
132
|
+
}
|
|
133
|
+
if (!ok || provider === undefined || version === undefined)
|
|
134
|
+
return undefined;
|
|
135
|
+
return {
|
|
136
|
+
name: record.name.toLowerCase(),
|
|
137
|
+
displayName: record.name,
|
|
138
|
+
provider,
|
|
139
|
+
version,
|
|
140
|
+
...(describes === undefined ? {} : { describes }),
|
|
141
|
+
...(steward === undefined ? {} : { steward }),
|
|
142
|
+
requires,
|
|
143
|
+
entries,
|
|
144
|
+
consent,
|
|
145
|
+
path,
|
|
146
|
+
span: record.span,
|
|
147
|
+
band,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** `<keyword> lowers to <kind>` with `category`, `facets` and `schema` beneath it; every fault is reported, the entry is dropped on any. */
|
|
151
|
+
function entryOf(field, systemName, path, diagnostics, incomplete) {
|
|
152
|
+
const words = field.words;
|
|
153
|
+
const line = field.span.line;
|
|
154
|
+
const keyword = words[0];
|
|
155
|
+
const kind = words[3];
|
|
156
|
+
const entryShape = keyword !== undefined &&
|
|
157
|
+
kind !== undefined &&
|
|
158
|
+
words.length === 4 &&
|
|
159
|
+
words[1] === 'lowers' &&
|
|
160
|
+
words[2] === 'to' &&
|
|
161
|
+
field.value.kind === 'scalar';
|
|
162
|
+
// `when` is a legal discriminator keyword in this entry grammar, not a standalone condition.
|
|
163
|
+
const conditionNodes = entryShape && field.when === undefined ? field.children : [field];
|
|
164
|
+
if (conditioned(conditionNodes, `a discriminators entry of @system ${systemName}`, path, diagnostics))
|
|
165
|
+
return undefined;
|
|
166
|
+
if (!entryShape) {
|
|
167
|
+
incomplete('discriminators', line, 'entry must read `<keyword> lowers to <kind>`');
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
let ok = true;
|
|
171
|
+
if (!KEYWORD.test(keyword)) {
|
|
172
|
+
incomplete('discriminators', line, `keyword '${keyword}' must spell like a discriminator: [a-z][a-z0-9-]*`);
|
|
173
|
+
ok = false;
|
|
174
|
+
}
|
|
175
|
+
if (RESERVED_KEYWORDS.includes(keyword) || RETIRED_KEYWORDS.includes(keyword)) {
|
|
176
|
+
const reason = RETIRED_KEYWORDS.includes(keyword) ? 'retired by language section 8.4' : 'reserved by the floor';
|
|
177
|
+
diagnostics.push(diag('IA-LANG-KEYWORD-RESERVED', path, line, `${path}:${line}: '${keyword}' is ${reason}; @system ${systemName} cannot register it`));
|
|
178
|
+
ok = false;
|
|
179
|
+
}
|
|
180
|
+
const lowered = isKind(kind) ? kind : undefined;
|
|
181
|
+
if (lowered === undefined) {
|
|
182
|
+
diagnostics.push(diag('IA-LANG-KIND-UNKNOWN', path, line, `${path}:${line}: '${kind}' is not a closed kind; admitted: ${KINDS.join(', ')}`));
|
|
183
|
+
ok = false;
|
|
184
|
+
}
|
|
185
|
+
const element = `discriminator '${keyword}'`;
|
|
186
|
+
let category;
|
|
187
|
+
const categoryField = fieldOf(field.children, ['category']);
|
|
188
|
+
if (categoryField === undefined) {
|
|
189
|
+
incomplete(element, line, 'needs `category <category>`');
|
|
190
|
+
ok = false;
|
|
191
|
+
}
|
|
192
|
+
else if (categoryField.value.kind !== 'scalar') {
|
|
193
|
+
incomplete(element, categoryField.span.line, 'names its category as a bare word');
|
|
194
|
+
ok = false;
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
const named = categoryField.assertive === true ? categoryField.value.text : restAfter(categoryField, ['category']).join(' ');
|
|
198
|
+
if (isCategory(named))
|
|
199
|
+
category = named;
|
|
200
|
+
else {
|
|
201
|
+
diagnostics.push(diag('IA-LANG-CATEGORY-UNKNOWN', path, categoryField.span.line, `${path}:${categoryField.span.line}: '${named}' is not a category; admitted: ${CATEGORIES.join(', ')}`));
|
|
202
|
+
ok = false;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const facets = [];
|
|
206
|
+
const facetsField = fieldOf(field.children, ['facets']);
|
|
207
|
+
if (facetsField === undefined || facetsField.value.kind !== 'list' || facetsField.value.items.length === 0) {
|
|
208
|
+
incomplete(element, line, 'needs `facets [<facet>, ...]` with at least one facet');
|
|
209
|
+
ok = false;
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
for (const item of facetsField.value.items) {
|
|
213
|
+
if (item.kind === 'scalar')
|
|
214
|
+
facets.push(item.text);
|
|
215
|
+
else {
|
|
216
|
+
incomplete(element, facetsField.span.line, 'names facets as bare words');
|
|
217
|
+
ok = false;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const schemaField = fieldOf(field.children, ['schema']);
|
|
222
|
+
const schema = schemaField !== undefined &&
|
|
223
|
+
schemaField.value.kind === 'ref' &&
|
|
224
|
+
schemaField.value.discriminator === 'schema' &&
|
|
225
|
+
schemaField.value.fragment === undefined
|
|
226
|
+
? schemaField.value.name.toLowerCase()
|
|
227
|
+
: undefined;
|
|
228
|
+
if (schema === undefined) {
|
|
229
|
+
incomplete(element, line, 'needs `schema @schema <name>`');
|
|
230
|
+
ok = false;
|
|
231
|
+
}
|
|
232
|
+
if (!ok || lowered === undefined || category === undefined || schema === undefined)
|
|
233
|
+
return undefined;
|
|
234
|
+
return { keyword, kind: lowered, category, facets, schema, span: field.span };
|
|
235
|
+
}
|
|
236
|
+
/** `<predicate> <targets> using <sources>`: each side is `*` or comma-separated keywords; one `using`; no when clause. */
|
|
237
|
+
function consentRowOf(field, path, diagnostics, incomplete) {
|
|
238
|
+
const words = field.words;
|
|
239
|
+
const line = field.span.line;
|
|
240
|
+
const using = words.indexOf('using');
|
|
241
|
+
const predicate = words[0];
|
|
242
|
+
if (predicate === undefined ||
|
|
243
|
+
field.value.kind !== 'scalar' ||
|
|
244
|
+
words.length < 4 ||
|
|
245
|
+
using < 2 ||
|
|
246
|
+
using === words.length - 1 ||
|
|
247
|
+
words.lastIndexOf('using') !== using) {
|
|
248
|
+
incomplete('edges', line, 'row must read `<predicate> <targets> using <sources>`, with one `using`');
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
if (conditionsIn([field]).length > 0) {
|
|
252
|
+
incomplete('edges', line, 'a consent row carries no when clause');
|
|
253
|
+
return undefined;
|
|
254
|
+
}
|
|
255
|
+
if (!isPredicate(predicate)) {
|
|
256
|
+
diagnostics.push(diag('IA-LANG-PREDICATE-UNKNOWN', path, line, `${path}:${line}: '${predicate}' is not a predicate; admitted: ${PREDICATES.join(', ')}`));
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
const targets = sideOf(words.slice(1, using));
|
|
260
|
+
const sources = sideOf(words.slice(using + 1));
|
|
261
|
+
if (targets === undefined || sources === undefined) {
|
|
262
|
+
incomplete('edges', line, 'each side of `using` is `*` alone or comma-separated discriminators, with no dangling comma');
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
return { predicate, targets, sources, span: field.span };
|
|
266
|
+
}
|
|
267
|
+
/** A wildcard alone, or comma-separated keywords with optional whitespace around each comma. */
|
|
268
|
+
function sideOf(words) {
|
|
269
|
+
const side = words.join(' ');
|
|
270
|
+
if (side === '*')
|
|
271
|
+
return '*';
|
|
272
|
+
const names = side.split(',').map((name) => name.trim());
|
|
273
|
+
return names.every((name) => KEYWORD.test(name)) ? names : undefined;
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/registry/extract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGvD,iJAAiJ;AACjJ,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC,MAAM,IAAI,GAAG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B,IAAI,IAAI,KAAK,GAAG;QAAE,OAAO,GAAG,CAAC;IAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChildNode, FieldNode, RecordNode, SectionNode } from '../ast.js';
|
|
2
|
+
/**
|
|
3
|
+
* True when `spelling` starts the field's words as a whole key: on an all-words line the words must
|
|
4
|
+
* continue past the spelling (they are the value); on any other line the words must be exactly the spelling.
|
|
5
|
+
*/
|
|
6
|
+
export declare function spelledAs(field: FieldNode, spelling: readonly string[]): boolean;
|
|
7
|
+
/** The first field among `children` spelled `spelling`. */
|
|
8
|
+
export declare function fieldOf(children: readonly ChildNode[], spelling: readonly string[]): FieldNode | undefined;
|
|
9
|
+
/** The words after a spelling on an all-words line: the scalar it carries. */
|
|
10
|
+
export declare function restAfter(field: FieldNode, spelling: readonly string[]): readonly string[];
|
|
11
|
+
/** The text of a quoted string value, or undefined for any other value or no field. */
|
|
12
|
+
export declare function stringOf(field: FieldNode | undefined): string | undefined;
|
|
13
|
+
export declare function sectionOf(record: RecordNode, name: string): SectionNode | undefined;
|
|
14
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/registry/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE/E;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAIhF;AAED,2DAA2D;AAC3D,wBAAgB,OAAO,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,SAAS,CAG1G;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAE1F;AAED,uFAAuF;AACvF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEzE;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEnF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when `spelling` starts the field's words as a whole key: on an all-words line the words must
|
|
3
|
+
* continue past the spelling (they are the value); on any other line the words must be exactly the spelling.
|
|
4
|
+
*/
|
|
5
|
+
export function spelledAs(field, spelling) {
|
|
6
|
+
if (field.words.length < spelling.length)
|
|
7
|
+
return false;
|
|
8
|
+
if (!spelling.every((word, index) => field.words[index] === word))
|
|
9
|
+
return false;
|
|
10
|
+
return field.value.kind === 'scalar' ? field.words.length > spelling.length : field.words.length === spelling.length;
|
|
11
|
+
}
|
|
12
|
+
/** The first field among `children` spelled `spelling`. */
|
|
13
|
+
export function fieldOf(children, spelling) {
|
|
14
|
+
for (const child of children)
|
|
15
|
+
if (child.kind === 'field' && spelledAs(child, spelling))
|
|
16
|
+
return child;
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
/** The words after a spelling on an all-words line: the scalar it carries. */
|
|
20
|
+
export function restAfter(field, spelling) {
|
|
21
|
+
return field.words.slice(spelling.length);
|
|
22
|
+
}
|
|
23
|
+
/** The text of a quoted string value, or undefined for any other value or no field. */
|
|
24
|
+
export function stringOf(field) {
|
|
25
|
+
return field !== undefined && field.value.kind === 'string' ? field.value.text : undefined;
|
|
26
|
+
}
|
|
27
|
+
export function sectionOf(record, name) {
|
|
28
|
+
return record.sections.find((section) => section.name === name);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../src/registry/fields.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB,EAAE,QAA2B;IACrE,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACvD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAChF,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;AACvH,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,OAAO,CAAC,QAA8B,EAAE,QAA2B;IACjF,KAAK,MAAM,KAAK,IAAI,QAAQ;QAAE,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC;YAAE,OAAO,KAAK,CAAC;IACrG,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,SAAS,CAAC,KAAgB,EAAE,QAA2B;IACrE,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,QAAQ,CAAC,KAA4B;IACnD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7F,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAkB,EAAE,IAAY;IACxD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ConsentRow, Registration } from './types.js';
|
|
2
|
+
/** The system that owns the two structural words (spec 4.1) and the system name the kernel's closed axes use (spec 3.1). */
|
|
3
|
+
export declare const FLOOR_SYSTEM = "floor";
|
|
4
|
+
export declare const TAXONOMY_SYSTEM = "taxonomy";
|
|
5
|
+
/** Always visible; a `requires` naming one of these resolves without a record. */
|
|
6
|
+
export declare const BUILTIN_SYSTEMS: readonly string[];
|
|
7
|
+
/** No `@system` may register these (`IA-LANG-KEYWORD-RESERVED`). */
|
|
8
|
+
export declare const RESERVED_KEYWORDS: readonly string[];
|
|
9
|
+
/** Fixed incoming-only schema citation permission; no authored floor declaration owns it. */
|
|
10
|
+
export declare const FLOOR_CONSENT: readonly ConsentRow[];
|
|
11
|
+
/**
|
|
12
|
+
* The floor's registrations. Their schemas are the kernel records `floor/contract/head/system` and
|
|
13
|
+
* `floor/contract/head/schema`, authored in plan 4; the registry does not require them to resolve,
|
|
14
|
+
* because the shapes of `@system` and `@schema` are fixed by spec 4.2 and 4.3 and read by this package.
|
|
15
|
+
*/
|
|
16
|
+
export declare const FLOOR_REGISTRATIONS: readonly Registration[];
|
|
17
|
+
//# sourceMappingURL=floor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floor.d.ts","sourceRoot":"","sources":["../../src/registry/floor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE3D,4HAA4H;AAC5H,eAAO,MAAM,YAAY,UAAU,CAAC;AACpC,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,kFAAkF;AAClF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAoC,CAAC;AAClF,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAyB,CAAC;AAEzE,6FAA6F;AAC7F,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAO7C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,YAAY,EAmBtD,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** The system that owns the two structural words (spec 4.1) and the system name the kernel's closed axes use (spec 3.1). */
|
|
2
|
+
export const FLOOR_SYSTEM = 'floor';
|
|
3
|
+
export const TAXONOMY_SYSTEM = 'taxonomy';
|
|
4
|
+
/** Always visible; a `requires` naming one of these resolves without a record. */
|
|
5
|
+
export const BUILTIN_SYSTEMS = [FLOOR_SYSTEM, TAXONOMY_SYSTEM];
|
|
6
|
+
/** No `@system` may register these (`IA-LANG-KEYWORD-RESERVED`). */
|
|
7
|
+
export const RESERVED_KEYWORDS = ['system', 'schema'];
|
|
8
|
+
/** Fixed incoming-only schema citation permission; no authored floor declaration owns it. */
|
|
9
|
+
export const FLOOR_CONSENT = Object.freeze([
|
|
10
|
+
Object.freeze({
|
|
11
|
+
predicate: 'cite',
|
|
12
|
+
targets: Object.freeze(['schema']),
|
|
13
|
+
sources: '*',
|
|
14
|
+
span: Object.freeze({ line: 1, endLine: 1 }),
|
|
15
|
+
}),
|
|
16
|
+
]);
|
|
17
|
+
/**
|
|
18
|
+
* The floor's registrations. Their schemas are the kernel records `floor/contract/head/system` and
|
|
19
|
+
* `floor/contract/head/schema`, authored in plan 4; the registry does not require them to resolve,
|
|
20
|
+
* because the shapes of `@system` and `@schema` are fixed by spec 4.2 and 4.3 and read by this package.
|
|
21
|
+
*/
|
|
22
|
+
export const FLOOR_REGISTRATIONS = [
|
|
23
|
+
{
|
|
24
|
+
keyword: 'system',
|
|
25
|
+
system: FLOOR_SYSTEM,
|
|
26
|
+
kind: 'definition',
|
|
27
|
+
category: 'boundary',
|
|
28
|
+
facets: ['system'],
|
|
29
|
+
schema: 'system',
|
|
30
|
+
band: 10,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
keyword: 'schema',
|
|
34
|
+
system: FLOOR_SYSTEM,
|
|
35
|
+
kind: 'contract',
|
|
36
|
+
category: 'representation',
|
|
37
|
+
facets: ['head'],
|
|
38
|
+
schema: 'schema',
|
|
39
|
+
band: 10,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=floor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floor.js","sourceRoot":"","sources":["../../src/registry/floor.ts"],"names":[],"mappings":"AAEA,4HAA4H;AAC5H,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAC1C,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;AAClF,oEAAoE;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEzE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,aAAa,GAA0B,MAAM,CAAC,MAAM,CAAC;IAChE,MAAM,CAAC,MAAM,CAAC;QACZ,SAAS,EAAE,MAAe;QAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,EAAE,GAAY;QACrB,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;KAC7C,CAAC;CACH,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA4B;IAC1D;QACE,OAAO,EAAE,QAAQ;QACjB,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,EAAE;KACT;IACD;QACE,OAAO,EAAE,QAAQ;QACjB,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,gBAAgB;QAC1B,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,EAAE;KACT;CACF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Diagnostic } from '../diagnostics.js';
|
|
2
|
+
export { fieldTypeText } from './schemas.js';
|
|
3
|
+
import type { FrozenRegistry, Source } from './types.js';
|
|
4
|
+
export { admits, consentFor } from './consent.js';
|
|
5
|
+
export { BUILTIN_SYSTEMS, FLOOR_REGISTRATIONS, FLOOR_SYSTEM, RESERVED_KEYWORDS, TAXONOMY_SYSTEM } from './floor.js';
|
|
6
|
+
export { fieldOf, restAfter, sectionOf, spelledAs, stringOf } from './fields.js';
|
|
7
|
+
export type { ConsentRow, Entry, FrozenRegistry, Location, Placement, Registration, RequiredSystem, SchemaDeclaration, SchemaEdge, SchemaField, SchemaSection, Source, Steward, SystemDeclaration, } from './types.js';
|
|
8
|
+
export interface RegistryResult {
|
|
9
|
+
readonly registry: FrozenRegistry;
|
|
10
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
11
|
+
}
|
|
12
|
+
/** Diagnostics leave in path order, then line order, whichever stage found them. */
|
|
13
|
+
export declare function sortDiagnostics(diagnostics: readonly Diagnostic[]): Diagnostic[];
|
|
14
|
+
/**
|
|
15
|
+
* The minting join at one location (spec 4.4): extract every @system without a vocabulary; band
|
|
16
|
+
* merge; resolve and order requires; lower consent; resolve schemas. A word is joined or refused.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildRegistry(sources: readonly Source[]): RegistryResult;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAmC,MAAM,EAAqB,MAAM,YAAY,CAAC;AAE7G,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EACV,UAAU,EACV,KAAK,EACL,cAAc,EACd,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,MAAM,EACN,OAAO,EACP,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,EAAE,CAEhF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,CA2ExE"}
|