@shapeshift-labs/frontier-lang-parser 0.3.39 → 0.3.40
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/dist/conversion-metadata.js +43 -0
- package/dist/conversion.js +25 -0
- package/dist/index.d.ts +11 -1
- package/dist/metadata.js +1 -18
- package/dist/source-syntax-children.js +69 -12
- package/dist/source-syntax-report.js +9 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -88,6 +88,7 @@ The published Frontier package family is generated from one shared package catal
|
|
|
88
88
|
- [`@shapeshift-labs/frontier-dnd`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dnd): Renderer-neutral drag-and-drop sessions, sensor descriptors, collision ranking, drop planning, reorder patches, state partitioning, and registry evidence for Frontier apps.
|
|
89
89
|
- [`@shapeshift-labs/frontier-dom`](https://www.npmjs.com/package/@shapeshift-labs/frontier-dom): Patch-native DOM and host renderer bindings, manifest hydration, JSX runtime/compiler helpers, SSR, devtools, and logging bridges.
|
|
90
90
|
- [`@shapeshift-labs/frontier-playwright`](https://www.npmjs.com/package/@shapeshift-labs/frontier-playwright): Playwright/headless automation probes for Frontier state, DOM, devtools, marks, and timeline queries.
|
|
91
|
+
- [`@shapeshift-labs/frontier-annotations`](https://www.npmjs.com/package/@shapeshift-labs/frontier-annotations): Browser harness DOM annotation overlay, selected-node targeting records, CSS/source-hint capture, AST/source graph context ranking, and Codex/frontier-swarm task planning for AI-operable UI fixes.
|
|
91
92
|
- [`@shapeshift-labs/frontier-test`](https://www.npmjs.com/package/@shapeshift-labs/frontier-test): Serializable test/spec evidence manifests for Frontier apps, including fixtures, commands, expected patches/effects/routes/policies, coverage declarations, run plans, run records, report adapters, replay proofs, fuzzers, benchmarks, registry graph output, and impact queries.
|
|
92
93
|
- [`@shapeshift-labs/frontier-fixtures`](https://www.npmjs.com/package/@shapeshift-labs/frontier-fixtures): Deterministic fixture and scenario generation for Frontier apps, including schema-valid sample state, related entity collections, actor personas, route states, replay-verified patch streams, event records, JSONL bundles, and evidence summaries.
|
|
93
94
|
- [`@shapeshift-labs/frontier-component-preview`](https://www.npmjs.com/package/@shapeshift-labs/frontier-component-preview): Frontier-native component preview books, generated preview manifests, stateful variants, Vite virtual modules, standalone browser preview shells, inspector bridges, and preview harness evidence for Frontier apps.
|
|
@@ -192,6 +193,7 @@ Package source repositories:
|
|
|
192
193
|
- [`siliconjungle/-shapeshift-labs-frontier-dnd`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dnd)
|
|
193
194
|
- [`siliconjungle/-shapeshift-labs-frontier-dom`](https://github.com/siliconjungle/-shapeshift-labs-frontier-dom)
|
|
194
195
|
- [`siliconjungle/-shapeshift-labs-frontier-playwright`](https://github.com/siliconjungle/-shapeshift-labs-frontier-playwright)
|
|
196
|
+
- [`siliconjungle/-shapeshift-labs-frontier-annotations`](https://github.com/siliconjungle/-shapeshift-labs-frontier-annotations)
|
|
195
197
|
- [`siliconjungle/-shapeshift-labs-frontier-test`](https://github.com/siliconjungle/-shapeshift-labs-frontier-test)
|
|
196
198
|
- [`siliconjungle/-shapeshift-labs-frontier-fixtures`](https://github.com/siliconjungle/-shapeshift-labs-frontier-fixtures)
|
|
197
199
|
- [`siliconjungle/-shapeshift-labs-frontier-component-preview`](https://github.com/siliconjungle/-shapeshift-labs-frontier-component-preview)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export function mergeConversionBlocks(blocks) {
|
|
2
|
+
const plan = {
|
|
3
|
+
id: blocks.length === 1 ? blocks[0].id : 'universalConversionPlan:source',
|
|
4
|
+
targets: [...new Set(blocks.flatMap((block) => block.targets ?? []))],
|
|
5
|
+
metadata: { authoredConversionBlockIds: blocks.map((block) => block.id) }
|
|
6
|
+
};
|
|
7
|
+
for (const block of blocks) {
|
|
8
|
+
if (block.sourceLanguage && !plan.sourceLanguage) plan.sourceLanguage = block.sourceLanguage;
|
|
9
|
+
for (const [key, value] of Object.entries(block)) {
|
|
10
|
+
if (Array.isArray(value) && key !== 'targets') plan[key] = [...(plan[key] ?? []), ...value];
|
|
11
|
+
else if ((key === 'sourceRuntimes' || key === 'targetRuntimes') && value && typeof value === 'object') {
|
|
12
|
+
plan[key] = { ...(plan[key] ?? {}), ...value };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
plan.evidenceIds = ids(plan.evidence);
|
|
17
|
+
plan.summary = {
|
|
18
|
+
evidenceCount: plan.evidence?.length ?? 0,
|
|
19
|
+
runtimeRequirementCount: plan.runtimeRequirements?.length ?? 0,
|
|
20
|
+
dialectCount: plan.dialects?.length ?? 0,
|
|
21
|
+
externCount: plan.externs?.length ?? 0,
|
|
22
|
+
constraintCount: conversionConstraintCount(plan)
|
|
23
|
+
};
|
|
24
|
+
plan.claims = {
|
|
25
|
+
autoMergeClaim: false,
|
|
26
|
+
semanticEquivalenceClaim: false,
|
|
27
|
+
conversionEquivalenceClaim: false,
|
|
28
|
+
runtimeEquivalenceClaim: false
|
|
29
|
+
};
|
|
30
|
+
return plan;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ids(records = []) {
|
|
34
|
+
return records.map((record) => record?.id).filter(Boolean);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function conversionConstraintCount(plan) {
|
|
38
|
+
return Object.entries(plan).reduce((total, [key, value]) => {
|
|
39
|
+
if (!Array.isArray(value)) return total;
|
|
40
|
+
if (key.endsWith('Constraints') || key === 'resourceTransfers') return total + value.length;
|
|
41
|
+
return total;
|
|
42
|
+
}, 0);
|
|
43
|
+
}
|
package/dist/conversion.js
CHANGED
|
@@ -13,6 +13,7 @@ export function parseConversionBlock(block) {
|
|
|
13
13
|
const runtimeRequirement = /^(?:runtimeRequirement|requiredRuntime|requiresRuntime)\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line);
|
|
14
14
|
const dialect = /^dialect\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line);
|
|
15
15
|
const extern = /^extern\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line);
|
|
16
|
+
const evidence = /^(?:evidence|proofEvidence)\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line);
|
|
16
17
|
const constraint = /^constraint\s+([A-Za-z_$][\w$-]*)\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line);
|
|
17
18
|
if (target) plan.targets.push(target);
|
|
18
19
|
else if (sourceLanguage) plan.sourceLanguage = sourceLanguage;
|
|
@@ -21,11 +22,35 @@ export function parseConversionBlock(block) {
|
|
|
21
22
|
else if (runtimeRequirement) addRuntimeRequirement(plan, runtimeRequirement[1], runtimeRequirement[2]);
|
|
22
23
|
else if (dialect) addDialectRecord(plan, dialect[1], dialect[2], false);
|
|
23
24
|
else if (extern) addDialectRecord(plan, extern[1], extern[2], true);
|
|
25
|
+
else if (evidence) addEvidenceRecord(plan, evidence[1], evidence[2], authoredLine);
|
|
24
26
|
else if (constraint) addConstraint(plan, constraint[1], constraint[2], constraint[3], authoredLine);
|
|
25
27
|
}
|
|
26
28
|
return cleanRecord({ ...plan, targets: unique(plan.targets) });
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
function addEvidenceRecord(plan, name, text, authoredLine = {}) {
|
|
32
|
+
plan.evidence = [...(plan.evidence ?? []), cleanRecord({
|
|
33
|
+
id: idFrom(text, `conversion_evidence_${name}`),
|
|
34
|
+
name,
|
|
35
|
+
kind: readInlineWord('kind', text) ?? 'conversion-route-evidence',
|
|
36
|
+
status: readInlineWord('status', text) ?? 'unknown',
|
|
37
|
+
sourceLanguage: readInlineWord('sourceLanguage', text) ?? readInlineWord('language', text) ?? plan.sourceLanguage,
|
|
38
|
+
target: readInlineWord('target', text) ?? readInlineWord('targetLanguage', text) ?? plan.targets[0],
|
|
39
|
+
routeId: readInlineWord('routeId', text) ?? readInlineWord('route', text),
|
|
40
|
+
path: readInlineWord('path', text) ?? readInlineWord('report', text),
|
|
41
|
+
command: readInlineQuoted('command', text) ?? readInlineWord('command', text),
|
|
42
|
+
probeId: readInlineWord('probeId', text) ?? readInlineWord('probe', text),
|
|
43
|
+
sourceHash: readInlineWord('sourceHash', text),
|
|
44
|
+
targetHash: readInlineWord('targetHash', text),
|
|
45
|
+
telemetryHash: readInlineWord('telemetryHash', text),
|
|
46
|
+
proofEvidenceIds: readInlineList(text, 'proofEvidence', 'proofEvidenceId', 'proofEvidenceIds', 'proof'),
|
|
47
|
+
summary: readInlineQuoted('summary', text),
|
|
48
|
+
sourceSpan: authoredLine.sourceSpan,
|
|
49
|
+
authoredSourceSpan: authoredLine.sourceSpan,
|
|
50
|
+
metadata: { authoredConversionBlockId: plan.id, autoMergeClaim: false, semanticEquivalenceClaim: false }
|
|
51
|
+
})];
|
|
52
|
+
}
|
|
53
|
+
|
|
29
54
|
function addRuntimeRequirement(plan, name, text) {
|
|
30
55
|
plan.runtimeRequirements = [...(plan.runtimeRequirements ?? []), cleanRecord({
|
|
31
56
|
id: idFrom(text, `runtime_requirement_${name}`),
|
package/dist/index.d.ts
CHANGED
|
@@ -22,11 +22,14 @@ export interface FrontierSourceSyntaxDiagnostic {
|
|
|
22
22
|
readonly location: FrontierSourcePosition;
|
|
23
23
|
}
|
|
24
24
|
export interface FrontierSourceChildSyntaxRecord {
|
|
25
|
-
readonly kind: 'conversionConstraint';
|
|
25
|
+
readonly kind: 'conversionConstraint' | 'conversionEvidence' | 'conversionRuntimeRequirement' | 'conversionDialect' | 'conversionExtern' | 'conversionUnknownRow' | string;
|
|
26
|
+
readonly rowKind?: string;
|
|
27
|
+
readonly normalizedRowKind?: string;
|
|
26
28
|
readonly name: string;
|
|
27
29
|
readonly id?: string;
|
|
28
30
|
readonly family?: string;
|
|
29
31
|
readonly role?: string;
|
|
32
|
+
readonly reason?: string;
|
|
30
33
|
readonly header: string;
|
|
31
34
|
readonly startOffset: number;
|
|
32
35
|
readonly endOffset: number;
|
|
@@ -60,6 +63,10 @@ export interface FrontierUnknownSourceBlockSyntaxRecord extends FrontierSourceBl
|
|
|
60
63
|
readonly recognized: false;
|
|
61
64
|
readonly reason: 'unsupported-top-level-block';
|
|
62
65
|
}
|
|
66
|
+
export interface FrontierUnknownSourceChildSyntaxRecord extends FrontierSourceChildSyntaxRecord {
|
|
67
|
+
readonly recognized: false;
|
|
68
|
+
readonly reason: string;
|
|
69
|
+
}
|
|
63
70
|
export interface FrontierSourceSyntaxReport {
|
|
64
71
|
readonly kind: 'frontier.lang.sourceSyntaxReport';
|
|
65
72
|
readonly version: 1;
|
|
@@ -68,10 +75,12 @@ export interface FrontierSourceSyntaxReport {
|
|
|
68
75
|
readonly blocks: readonly FrontierSourceBlockSyntaxRecord[];
|
|
69
76
|
readonly recognizedBlocks: readonly FrontierSourceBlockSyntaxRecord[];
|
|
70
77
|
readonly unknownBlocks: readonly FrontierUnknownSourceBlockSyntaxRecord[];
|
|
78
|
+
readonly unknownChildren: readonly FrontierUnknownSourceChildSyntaxRecord[];
|
|
71
79
|
readonly summary: {
|
|
72
80
|
readonly blockCount: number;
|
|
73
81
|
readonly recognizedBlockCount: number;
|
|
74
82
|
readonly unknownBlockCount: number;
|
|
83
|
+
readonly unknownChildCount: number;
|
|
75
84
|
readonly malformedBlockCount: number;
|
|
76
85
|
readonly childCount: number;
|
|
77
86
|
readonly recognizedChildCount: number;
|
|
@@ -79,6 +88,7 @@ export interface FrontierSourceSyntaxReport {
|
|
|
79
88
|
readonly recognizedKinds: readonly string[];
|
|
80
89
|
readonly recognizedChildKinds: readonly string[];
|
|
81
90
|
readonly unknownKinds: readonly string[];
|
|
91
|
+
readonly unknownChildKinds: readonly string[];
|
|
82
92
|
readonly failClosed: boolean;
|
|
83
93
|
readonly unsupportedSyntax: boolean;
|
|
84
94
|
};
|
package/dist/metadata.js
CHANGED
|
@@ -2,6 +2,7 @@ import { mergeDialectRegistryBlocks } from './dialect-registry.js';
|
|
|
2
2
|
import { mergeApplicationSurfaceBlocks } from './application-surface.js';
|
|
3
3
|
import { mergeRuntimeCapabilityBlocks } from './runtime-capability.js';
|
|
4
4
|
import { mergeTargetProjectionTargets } from './target-projection-aggregate.js';
|
|
5
|
+
import { mergeConversionBlocks } from './conversion-metadata.js';
|
|
5
6
|
|
|
6
7
|
const PROOF_GROUPS = ['contracts', 'refinements', 'invariants', 'termination', 'temporal', 'obligations', 'artifacts', 'assumptions'];
|
|
7
8
|
const PARADIGM_GROUPS = [
|
|
@@ -61,24 +62,6 @@ function mergeOperationBlocks(blocks) {
|
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
function mergeConversionBlocks(blocks) {
|
|
65
|
-
const plan = {
|
|
66
|
-
id: blocks.length === 1 ? blocks[0].id : 'universalConversionPlan:source',
|
|
67
|
-
targets: [...new Set(blocks.flatMap((block) => block.targets ?? []))],
|
|
68
|
-
metadata: { authoredConversionBlockIds: blocks.map((block) => block.id) }
|
|
69
|
-
};
|
|
70
|
-
for (const block of blocks) {
|
|
71
|
-
if (block.sourceLanguage && !plan.sourceLanguage) plan.sourceLanguage = block.sourceLanguage;
|
|
72
|
-
for (const [key, value] of Object.entries(block)) {
|
|
73
|
-
if (Array.isArray(value) && key !== 'targets') plan[key] = [...(plan[key] ?? []), ...value];
|
|
74
|
-
else if ((key === 'sourceRuntimes' || key === 'targetRuntimes') && value && typeof value === 'object') {
|
|
75
|
-
plan[key] = { ...(plan[key] ?? {}), ...value };
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return plan;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
65
|
function mergeConstraintSpaceBlocks(blocks) {
|
|
83
66
|
return {
|
|
84
67
|
id: blocks.length === 1 ? blocks[0].id : 'constraintSpaces:source',
|
|
@@ -16,31 +16,88 @@ function readConversionSyntaxChildren(source, block, options) {
|
|
|
16
16
|
const children = [];
|
|
17
17
|
for (const line of readBodyLines(source, block)) {
|
|
18
18
|
if (!line.text || line.text.startsWith('#')) continue;
|
|
19
|
+
const planField = /^(?:sourceLanguage|source|target|sourceRuntime|targetRuntime)\s+/.exec(line.text);
|
|
20
|
+
if (planField) continue;
|
|
21
|
+
const runtimeRequirement = /^(runtimeRequirement|requiredRuntime|requiresRuntime)\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line.text);
|
|
22
|
+
if (runtimeRequirement) {
|
|
23
|
+
const [, rowKind, name, rest] = runtimeRequirement;
|
|
24
|
+
children.push(conversionChild(source, block, options, line, {
|
|
25
|
+
kind: 'conversionRuntimeRequirement',
|
|
26
|
+
rowKind,
|
|
27
|
+
normalizedRowKind: 'runtimeRequirement',
|
|
28
|
+
name,
|
|
29
|
+
id: idFrom(rest, `runtime_requirement_${name}`)
|
|
30
|
+
}));
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const dialect = /^(dialect|extern)\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line.text);
|
|
34
|
+
if (dialect) {
|
|
35
|
+
const [, rowKind, name, rest] = dialect;
|
|
36
|
+
children.push(conversionChild(source, block, options, line, {
|
|
37
|
+
kind: rowKind === 'extern' ? 'conversionExtern' : 'conversionDialect',
|
|
38
|
+
rowKind,
|
|
39
|
+
normalizedRowKind: rowKind,
|
|
40
|
+
name,
|
|
41
|
+
id: idFrom(rest, `${rowKind}_${name}`)
|
|
42
|
+
}));
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const evidence = /^(evidence|proofEvidence)\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line.text);
|
|
46
|
+
if (evidence) {
|
|
47
|
+
const [, rowKind, name, rest] = evidence;
|
|
48
|
+
children.push(conversionChild(source, block, options, line, {
|
|
49
|
+
kind: 'conversionEvidence',
|
|
50
|
+
rowKind,
|
|
51
|
+
normalizedRowKind: 'evidence',
|
|
52
|
+
name,
|
|
53
|
+
id: idFrom(rest, `conversion_evidence_${name}`)
|
|
54
|
+
}));
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
19
57
|
const constraint = /^constraint\s+([A-Za-z_$][\w$-]*)\s+([A-Za-z_$][\w$-]*)(.*)$/.exec(line.text);
|
|
20
|
-
if (!constraint)
|
|
58
|
+
if (!constraint) {
|
|
59
|
+
const row = /^([A-Za-z_$][\w$-]*)\b/.exec(line.text);
|
|
60
|
+
children.push(conversionChild(source, block, options, line, {
|
|
61
|
+
kind: 'conversionUnknownRow',
|
|
62
|
+
rowKind: row?.[1],
|
|
63
|
+
normalizedRowKind: 'unknown',
|
|
64
|
+
name: row?.[1] ?? 'unknown',
|
|
65
|
+
id: `conversion_unknown_${safeId(row?.[1] ?? 'row')}_${line.startOffset}`,
|
|
66
|
+
reason: 'unsupported-conversion-row',
|
|
67
|
+
recognized: false
|
|
68
|
+
}));
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
21
71
|
const [, family, name, rest] = constraint;
|
|
22
|
-
children.push(
|
|
72
|
+
children.push(conversionChild(source, block, options, line, {
|
|
23
73
|
kind: 'conversionConstraint',
|
|
24
74
|
name,
|
|
25
75
|
id: idFrom(rest, `conversion_constraint_${family}_${name}`),
|
|
26
76
|
family,
|
|
27
77
|
role: readInlineWord('role', rest) ?? 'source',
|
|
28
|
-
header: line.text,
|
|
29
|
-
startOffset: line.startOffset,
|
|
30
|
-
endOffset: line.endOffset,
|
|
31
|
-
location: sourcePosition(source, line.startOffset),
|
|
32
|
-
parentKind: block.kind,
|
|
33
|
-
parentId: block.id,
|
|
34
|
-
parentName: block.name,
|
|
35
|
-
moduleId: block.moduleId,
|
|
36
|
-
moduleName: block.moduleName,
|
|
37
|
-
sourceSpan: sourceSpan(source, block, line.startOffset, line.endOffset, options),
|
|
38
78
|
recognized: true
|
|
39
79
|
}));
|
|
40
80
|
}
|
|
41
81
|
return children;
|
|
42
82
|
}
|
|
43
83
|
|
|
84
|
+
function conversionChild(source, block, options, line, child) {
|
|
85
|
+
return cleanRecord({
|
|
86
|
+
header: line.text,
|
|
87
|
+
startOffset: line.startOffset,
|
|
88
|
+
endOffset: line.endOffset,
|
|
89
|
+
location: sourcePosition(source, line.startOffset),
|
|
90
|
+
parentKind: block.kind,
|
|
91
|
+
parentId: block.id,
|
|
92
|
+
parentName: block.name,
|
|
93
|
+
moduleId: block.moduleId,
|
|
94
|
+
moduleName: block.moduleName,
|
|
95
|
+
sourceSpan: sourceSpan(source, block, line.startOffset, line.endOffset, options),
|
|
96
|
+
recognized: true,
|
|
97
|
+
...child
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
44
101
|
function readGenericRowSyntaxChildren(source, block, options, config) {
|
|
45
102
|
const children = [];
|
|
46
103
|
const rowPattern = new RegExp('^([A-Za-z_$][\\w$-]*)\\s+' + ROW_NAME_PATTERN + '(.*)$');
|
|
@@ -23,6 +23,10 @@ export function inspectFrontierSourceSyntax(source, options = {}) {
|
|
|
23
23
|
reason: 'unsupported-top-level-block'
|
|
24
24
|
}));
|
|
25
25
|
const childRecords = blocks.flatMap((block) => block.children ?? []);
|
|
26
|
+
const unknownChildren = childRecords.filter((child) => !child.recognized).map((child) => ({
|
|
27
|
+
...child,
|
|
28
|
+
reason: child.reason ?? 'unsupported-child-syntax'
|
|
29
|
+
}));
|
|
26
30
|
const malformedBlockOpenOffsets = new Set(blocks.filter((block) => block.malformed).map((block) => block.bodyStartOffset - 1));
|
|
27
31
|
const diagnostics = [
|
|
28
32
|
...blocks.flatMap((block) => block.diagnostics ?? []),
|
|
@@ -38,7 +42,7 @@ export function inspectFrontierSourceSyntax(source, options = {}) {
|
|
|
38
42
|
}))
|
|
39
43
|
];
|
|
40
44
|
const malformedBlocks = blocks.filter((block) => block.malformed);
|
|
41
|
-
const failClosed = unknownBlocks.length > 0 || diagnostics.length > 0;
|
|
45
|
+
const failClosed = unknownBlocks.length > 0 || unknownChildren.length > 0 || diagnostics.length > 0;
|
|
42
46
|
return {
|
|
43
47
|
kind: 'frontier.lang.sourceSyntaxReport',
|
|
44
48
|
version: 1,
|
|
@@ -47,10 +51,12 @@ export function inspectFrontierSourceSyntax(source, options = {}) {
|
|
|
47
51
|
blocks,
|
|
48
52
|
recognizedBlocks,
|
|
49
53
|
unknownBlocks,
|
|
54
|
+
unknownChildren,
|
|
50
55
|
summary: {
|
|
51
56
|
blockCount: blocks.length,
|
|
52
57
|
recognizedBlockCount: recognizedBlocks.length,
|
|
53
58
|
unknownBlockCount: unknownBlocks.length,
|
|
59
|
+
unknownChildCount: unknownChildren.length,
|
|
54
60
|
malformedBlockCount: malformedBlocks.length,
|
|
55
61
|
childCount: childRecords.length,
|
|
56
62
|
recognizedChildCount: childRecords.filter((child) => child.recognized).length,
|
|
@@ -58,8 +64,9 @@ export function inspectFrontierSourceSyntax(source, options = {}) {
|
|
|
58
64
|
recognizedKinds: unique(recognizedBlocks.map((block) => block.kind)),
|
|
59
65
|
recognizedChildKinds: unique(childRecords.filter((child) => child.recognized).map((child) => child.kind)),
|
|
60
66
|
unknownKinds: unique(unknownBlocks.map((block) => block.kind)),
|
|
67
|
+
unknownChildKinds: unique(unknownChildren.map((child) => child.rowKind ?? child.kind)),
|
|
61
68
|
failClosed,
|
|
62
|
-
unsupportedSyntax: unknownBlocks.length > 0
|
|
69
|
+
unsupportedSyntax: unknownBlocks.length > 0 || unknownChildren.length > 0
|
|
63
70
|
},
|
|
64
71
|
diagnostics,
|
|
65
72
|
metadata: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshift-labs/frontier-lang-parser",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.40",
|
|
4
4
|
"description": "Parser for the first Frontier Lang .frontier syntax slice.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "node scripts/build.mjs",
|
|
25
|
-
"test": "npm run build && node test/smoke.mjs && node test/target-projection-aggregate-smoke.mjs && node test/conversion-constraint-fields-smoke.mjs && node test/package-canvas-surface-smoke.mjs && node test/view-render-graph-smoke.mjs && node test/resource-graph-smoke.mjs && node test/interlingua-smoke.mjs && node test/dialect-registry-smoke.mjs",
|
|
25
|
+
"test": "npm run build && node test/smoke.mjs && node test/target-projection-aggregate-smoke.mjs && node test/conversion-constraint-fields-smoke.mjs && node test/conversion-evidence-smoke.mjs && node test/package-canvas-surface-smoke.mjs && node test/view-render-graph-smoke.mjs && node test/resource-graph-smoke.mjs && node test/interlingua-smoke.mjs && node test/dialect-registry-smoke.mjs",
|
|
26
26
|
"typecheck": "node ./node_modules/typescript/bin/tsc --noEmit -p test/tsconfig.json",
|
|
27
27
|
"fuzz": "npm run build && node fuzz/smoke.mjs",
|
|
28
28
|
"bench": "npm run build && node bench/smoke.mjs",
|