@shapeshift-labs/frontier-lang-parser 0.3.88 → 0.3.90
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/dist/dialect-registry.js
CHANGED
|
@@ -4,9 +4,10 @@ export function parseDialectRegistryBlock(block) {
|
|
|
4
4
|
kind: 'frontier.lang.universalDialectRegistry',
|
|
5
5
|
version: 1,
|
|
6
6
|
id: idFrom(block.header, `dialect_registry_${name}`),
|
|
7
|
-
language: readWord('language', block.body),
|
|
7
|
+
language: readWord('language', block.body) ?? readWord('sourceLanguage', block.body),
|
|
8
8
|
dialect: readWord('dialect', block.body),
|
|
9
9
|
sourcePath: readWord('sourcePath', block.body) ?? readWord('path', block.body),
|
|
10
|
+
sourceHash: readWord('sourceHash', block.body),
|
|
10
11
|
dialects: [],
|
|
11
12
|
externs: [],
|
|
12
13
|
metadata: {
|
|
@@ -34,6 +35,8 @@ export function mergeDialectRegistryBlocks(blocks = []) {
|
|
|
34
35
|
version: 1,
|
|
35
36
|
id: blocks.length === 1 ? blocks[0].id : 'dialect_registry:source',
|
|
36
37
|
language: first(blocks.map((block) => block.language)),
|
|
38
|
+
sourcePath: first(blocks.map((block) => block.sourcePath)),
|
|
39
|
+
sourceHash: first(blocks.map((block) => block.sourceHash)),
|
|
37
40
|
dialects: uniqueById(blocks.flatMap((block) => block.dialects ?? [])),
|
|
38
41
|
externs: uniqueById(blocks.flatMap((block) => block.externs ?? [])),
|
|
39
42
|
metadata: {
|
|
@@ -55,6 +58,7 @@ function dialectRecord(registry, name, text) {
|
|
|
55
58
|
name: readInlineWord('name', text) ?? name,
|
|
56
59
|
nativeKind: readInlineWord('nativeKind', text),
|
|
57
60
|
sourcePath: readInlineWord('sourcePath', text) ?? readInlineWord('path', text) ?? registry.sourcePath,
|
|
61
|
+
sourceHash: readInlineWord('sourceHash', text) ?? registry.sourceHash,
|
|
58
62
|
nativeSourceId: readInlineWord('nativeSource', text) ?? readInlineWord('nativeSourceId', text),
|
|
59
63
|
nativeAstId: readInlineWord('nativeAst', text) ?? readInlineWord('nativeAstId', text),
|
|
60
64
|
nativeAstNodeId: readInlineWord('nativeAstNode', text) ?? readInlineWord('nativeAstNodeId', text),
|
|
@@ -89,6 +93,7 @@ function externRecord(registry, name, text) {
|
|
|
89
93
|
name: readInlineWord('name', text) ?? name,
|
|
90
94
|
...(Object.keys(binding).length ? { binding } : {}),
|
|
91
95
|
sourcePath: readInlineWord('sourcePath', text) ?? registry.sourcePath,
|
|
96
|
+
sourceHash: readInlineWord('sourceHash', text) ?? registry.sourceHash,
|
|
92
97
|
nativeSourceId: readInlineWord('nativeSource', text) ?? readInlineWord('nativeSourceId', text),
|
|
93
98
|
nativeAstId: readInlineWord('nativeAst', text) ?? readInlineWord('nativeAstId', text),
|
|
94
99
|
nativeAstNodeId: readInlineWord('nativeAstNode', text) ?? readInlineWord('nativeAstNodeId', text),
|
|
@@ -19,9 +19,9 @@ export const ROW_SYNTAX_CONFIG = Object.freeze({
|
|
|
19
19
|
universalInterlingua: rowConfig('interlinguaRow', 'interlingua_row', interlinguaRows, normalizeInterlinguaRow, coreFailClosed('unsupported-interlingua-row')),
|
|
20
20
|
dialectRegistry: rowConfig('dialectRegistryRow', 'dialect_registry_row', dialectRows, normalizeDialectRegistryRow, coreFailClosed('unsupported-dialect-registry-row')),
|
|
21
21
|
universalDialectRegistry: rowConfig('dialectRegistryRow', 'dialect_registry_row', dialectRows, normalizeDialectRegistryRow, coreFailClosed('unsupported-dialect-registry-row')),
|
|
22
|
-
runtimeCapabilities: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
|
|
23
|
-
runtimeCapabilityMatrix: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
|
|
24
|
-
runtimeHosts: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
|
|
22
|
+
runtimeCapabilities: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow, coreFailClosed('unsupported-runtime-capability-row')),
|
|
23
|
+
runtimeCapabilityMatrix: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow, coreFailClosed('unsupported-runtime-capability-row')),
|
|
24
|
+
runtimeHosts: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow, coreFailClosed('unsupported-runtime-capability-row')),
|
|
25
25
|
resourceGraph: rowConfig('resourceGraphRow', 'resource_graph_row', resourceRows, normalizeResourceGraphRow, coreFailClosed('unsupported-resource-graph-row')),
|
|
26
26
|
semanticResourceGraph: rowConfig('resourceGraphRow', 'resource_graph_row', resourceRows, normalizeResourceGraphRow, coreFailClosed('unsupported-resource-graph-row')),
|
|
27
27
|
machineGraph: rowConfig('machineGraphRow', 'machine_graph_row', machineRows, normalizeMachineGraphRow, coreFailClosed('unsupported-machine-graph-row')),
|
|
@@ -82,6 +82,7 @@ function normalizeDialectRegistryRow(rowKind) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
function normalizeRuntimeCapabilityRow(rowKind) {
|
|
85
|
+
if (rowKind === 'host' || rowKind === 'runtimeHost' || rowKind === 'sourceHost' || rowKind === 'targetHost') return 'hostProfile';
|
|
85
86
|
if (rowKind === 'capability') return 'hostCapability';
|
|
86
87
|
if (rowKind === 'binding') return 'hostBinding';
|
|
87
88
|
if (rowKind === 'requirement' || rowKind === 'requiredRuntime') return 'runtimeRequirement';
|