@shapeshift-labs/frontier-lang-parser 0.3.81 → 0.3.83

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.
@@ -9,6 +9,8 @@ const packageRows = words('sourcePath path sourceHash packageManager metadata de
9
9
  const runtimeRows = words('host runtimeHost hostProfile sourceHost targetHost capability hostCapability hostBinding binding requirement runtimeRequirement requiredRuntime evidence proofEvidence gap proofGap');
10
10
  const semanticEditRows = words('script semanticEditScript projection semanticEditProjection replay semanticEditReplay');
11
11
  const gateAdmissionRows = words('gate evidence proofEvidence admission admissionDecision proofObligation obligation gap proofGap');
12
+ const resourceRows = words('sourceLanguage language sourcePath path sourceHash status evidence evidenceIds resource owner loan alias move drop escape lifetime lifetimeRegion life outlives lifetimeRelation lifeRelation borrow borrowScope borrowRegion unsafe unsafeBoundary memory memoryRegion region layout dataLayout pointer ptr address access memoryAccess atomic volatile abi abiBoundary callBoundary sync synchronization synchronisation synchronizationEdge synchronisationEdge happensBefore happens-before hb fence fenceEdge barrier barrierEdge trap traps undefined undefinedBehavior undefinedBehaviour ub conflict proof proofObligation obligation proofEvidence sourceMap sourcemap mapping sourceMapMapping missingEvidence');
13
+ const targetRows = words('language targetLanguage sourceLanguage package packageName emitPath targetPath sourcePath path sourceHash targetHash runtime runtimeHost moduleFormat projection lowering lower layer adapter adapterId readiness disposition status evidence proofEvidence proof loss missingEvidence gap proofGap sourceMap sourcemap mapping sourceMapMapping');
12
14
  const coreFailClosed = (reason) => ({ failClosedUnknownRows: true, unknownRowReason: reason });
13
15
 
14
16
  export const ROW_SYNTAX_CONFIG = Object.freeze({
@@ -19,8 +21,8 @@ export const ROW_SYNTAX_CONFIG = Object.freeze({
19
21
  runtimeCapabilities: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
20
22
  runtimeCapabilityMatrix: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
21
23
  runtimeHosts: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
22
- resourceGraph: rowConfig('resourceGraphRow', 'resource_graph_row', words('resource owner loan alias move drop escape lifetime lifetimeRegion life outlives lifetimeRelation lifeRelation borrow borrowScope borrowRegion unsafe unsafeBoundary memory memoryRegion region layout dataLayout pointer ptr address access memoryAccess atomic volatile abi abiBoundary callBoundary sync synchronization synchronisation synchronizationEdge synchronisationEdge happensBefore hb fence fenceEdge barrier barrierEdge trap traps undefined undefinedBehavior undefinedBehaviour ub conflict proof proofObligation obligation'), normalizeResourceGraphRow),
23
- semanticResourceGraph: rowConfig('resourceGraphRow', 'resource_graph_row', words('resource owner loan alias move drop escape lifetime lifetimeRegion life outlives lifetimeRelation lifeRelation borrow borrowScope borrowRegion unsafe unsafeBoundary memory memoryRegion region layout dataLayout pointer ptr address access memoryAccess atomic volatile abi abiBoundary callBoundary sync synchronization synchronisation synchronizationEdge synchronisationEdge happensBefore hb fence fenceEdge barrier barrierEdge trap traps undefined undefinedBehavior undefinedBehaviour ub conflict proof proofObligation obligation'), normalizeResourceGraphRow),
24
+ resourceGraph: rowConfig('resourceGraphRow', 'resource_graph_row', resourceRows, normalizeResourceGraphRow, coreFailClosed('unsupported-resource-graph-row')),
25
+ semanticResourceGraph: rowConfig('resourceGraphRow', 'resource_graph_row', resourceRows, normalizeResourceGraphRow, coreFailClosed('unsupported-resource-graph-row')),
24
26
  machineGraph: rowConfig('machineGraphRow', 'machine_graph_row', machineRows, normalizeMachineGraphRow, coreFailClosed('unsupported-machine-graph-row')),
25
27
  executionGraph: rowConfig('machineGraphRow', 'machine_graph_row', machineRows, normalizeMachineGraphRow, coreFailClosed('unsupported-machine-graph-row')),
26
28
  lowLevelGraph: rowConfig('machineGraphRow', 'machine_graph_row', machineRows, normalizeMachineGraphRow, coreFailClosed('unsupported-machine-graph-row')),
@@ -34,7 +36,7 @@ export const ROW_SYNTAX_CONFIG = Object.freeze({
34
36
  plugin: rowConfig('applicationSurfaceRow', 'application_surface_row', appRows, normalizeApplicationSurfaceRow, coreFailClosed('unsupported-application-surface-row')),
35
37
  pluginSurface: rowConfig('applicationSurfaceRow', 'application_surface_row', appRows, normalizeApplicationSurfaceRow, coreFailClosed('unsupported-application-surface-row')),
36
38
  pluginContract: rowConfig('applicationSurfaceRow', 'application_surface_row', appRows, normalizeApplicationSurfaceRow, coreFailClosed('unsupported-application-surface-row')),
37
- target: rowConfig('targetProjectionRow', 'target_projection_row', words('projection lowering layer')),
39
+ target: rowConfig('targetProjectionRow', 'target_projection_row', targetRows, normalizeTargetProjectionRow, coreFailClosed('unsupported-target-projection-row')),
38
40
  packageManifest: rowConfig('packageManifestRow', 'package_manifest_row', packageRows, normalizePackageManifestRow, coreFailClosed('unsupported-package-manifest-row')),
39
41
  packageGraph: rowConfig('packageManifestRow', 'package_manifest_row', packageRows, normalizePackageManifestRow, coreFailClosed('unsupported-package-manifest-row')),
40
42
  packageSurface: rowConfig('packageManifestRow', 'package_manifest_row', packageRows, normalizePackageManifestRow, coreFailClosed('unsupported-package-manifest-row')),
@@ -85,20 +87,37 @@ function normalizeRuntimeCapabilityRow(rowKind) {
85
87
  return rowKind;
86
88
  }
87
89
 
90
+ function normalizeTargetProjectionRow(rowKind) {
91
+ if (rowKind === 'targetLanguage') return 'language';
92
+ if (rowKind === 'package') return 'packageName';
93
+ if (rowKind === 'path') return 'sourcePath';
94
+ if (rowKind === 'targetPath') return 'emitPath';
95
+ if (rowKind === 'lower') return 'lowering';
96
+ if (rowKind === 'adapter') return 'adapterId';
97
+ if (rowKind === 'proof' || rowKind === 'proofEvidence') return 'evidence';
98
+ if (rowKind === 'gap') return 'proofGap';
99
+ if (rowKind === 'sourcemap' || rowKind === 'mapping' || rowKind === 'sourceMapMapping') return 'sourceMap';
100
+ return rowKind;
101
+ }
102
+
88
103
  function normalizeResourceGraphRow(rowKind) {
89
- if (rowKind === 'life' || rowKind === 'lifetimeRegion') return 'lifetime';
90
- if (rowKind === 'lifeRelation') return 'lifetimeRelation';
91
- if (rowKind === 'borrowRegion') return 'borrowScope';
104
+ if (rowKind === 'language') return 'sourceLanguage';
105
+ if (rowKind === 'path') return 'sourcePath';
106
+ if (rowKind === 'lifetime' || rowKind === 'life') return 'lifetimeRegion';
107
+ if (rowKind === 'outlives' || rowKind === 'lifeRelation') return 'lifetimeRelation';
108
+ if (rowKind === 'borrow' || rowKind === 'borrowRegion') return 'borrowScope';
92
109
  if (rowKind === 'unsafe') return 'unsafeBoundary';
93
110
  if (rowKind === 'memory' || rowKind === 'region') return 'memoryRegion';
94
111
  if (rowKind === 'layout') return 'dataLayout';
95
112
  if (rowKind === 'pointer' || rowKind === 'ptr' || rowKind === 'address') return 'pointerEdge';
96
113
  if (rowKind === 'access' || rowKind === 'atomic' || rowKind === 'volatile') return 'memoryAccess';
97
114
  if (rowKind === 'abi' || rowKind === 'callBoundary') return 'abiBoundary';
98
- if (rowKind === 'sync' || rowKind === 'synchronization' || rowKind === 'synchronisation' || rowKind === 'synchronisationEdge' || rowKind === 'happensBefore' || rowKind === 'hb' || rowKind === 'fence' || rowKind === 'fenceEdge' || rowKind === 'barrier' || rowKind === 'barrierEdge') return 'synchronizationEdge';
115
+ if (rowKind === 'sync' || rowKind === 'synchronization' || rowKind === 'synchronisation' || rowKind === 'synchronisationEdge' || rowKind === 'happensBefore' || rowKind === 'happens-before' || rowKind === 'hb' || rowKind === 'fence' || rowKind === 'fenceEdge' || rowKind === 'barrier' || rowKind === 'barrierEdge') return 'synchronizationEdge';
99
116
  if (rowKind === 'traps') return 'trap';
100
117
  if (rowKind === 'undefined' || rowKind === 'undefinedBehaviour' || rowKind === 'ub') return 'undefinedBehavior';
101
- if (rowKind === 'proof' || rowKind === 'proofObligation') return 'obligation';
118
+ if (rowKind === 'proof' || rowKind === 'obligation') return 'proofObligation';
119
+ if (rowKind === 'evidenceIds' || rowKind === 'proofEvidence') return 'evidence';
120
+ if (rowKind === 'sourcemap' || rowKind === 'mapping' || rowKind === 'sourceMapMapping') return 'sourceMap';
102
121
  return rowKind;
103
122
  }
104
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshift-labs/frontier-lang-parser",
3
- "version": "0.3.81",
3
+ "version": "0.3.83",
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/source-syntax-family-summary-smoke.mjs && node test/member-identity-smoke.mjs && node test/generic-row-parse-identity-smoke.mjs && node test/type-variant-payload-smoke.mjs && node test/type-generic-ref-smoke.mjs && node test/type-parameter-constraints-smoke.mjs && node test/type-structural-expression-smoke.mjs && node test/action-body-smoke.mjs && node test/action-structured-literals-smoke.mjs && node test/action-return-smoke.mjs && node test/action-else-smoke.mjs && node test/action-match-smoke.mjs && node test/action-for-in-smoke.mjs && node test/action-repeat-smoke.mjs && node test/action-call-smoke.mjs && node test/semantic-operation-edit-smoke.mjs && node test/target-projection-aggregate-smoke.mjs && node test/conversion-constraint-fields-smoke.mjs && node test/conversion-evidence-smoke.mjs && node test/gate-admission-evidence-smoke.mjs && node test/package-canvas-surface-smoke.mjs && node test/view-render-graph-smoke.mjs && node test/view-source-syntax-smoke.mjs && node test/resource-graph-smoke.mjs && node test/machine-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/source-syntax-family-summary-smoke.mjs && node test/resource-graph-source-syntax-smoke.mjs && node test/tgt-source-smoke.mjs && node test/member-identity-smoke.mjs && node test/generic-row-parse-identity-smoke.mjs && node test/type-variant-payload-smoke.mjs && node test/type-generic-ref-smoke.mjs && node test/type-parameter-constraints-smoke.mjs && node test/type-structural-expression-smoke.mjs && node test/action-body-smoke.mjs && node test/action-structured-literals-smoke.mjs && node test/action-return-smoke.mjs && node test/action-else-smoke.mjs && node test/action-match-smoke.mjs && node test/action-for-in-smoke.mjs && node test/action-repeat-smoke.mjs && node test/action-call-smoke.mjs && node test/semantic-operation-edit-smoke.mjs && node test/target-projection-aggregate-smoke.mjs && node test/conversion-constraint-fields-smoke.mjs && node test/conversion-evidence-smoke.mjs && node test/gate-admission-evidence-smoke.mjs && node test/package-canvas-surface-smoke.mjs && node test/view-render-graph-smoke.mjs && node test/view-source-syntax-smoke.mjs && node test/resource-graph-smoke.mjs && node test/machine-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",