@shapeshift-labs/frontier-lang-parser 0.3.72 → 0.3.73

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/metadata.js CHANGED
@@ -269,6 +269,8 @@ function mergeResourceGraphBlocks(blocks) {
269
269
  pointerEdgeIds: blocks.flatMap((block) => ids(block.graph?.pointerEdges)),
270
270
  memoryAccessIds: blocks.flatMap((block) => ids(block.graph?.memoryAccesses)),
271
271
  abiBoundaryIds: blocks.flatMap((block) => ids(block.graph?.abiBoundaries)),
272
+ trapIds: blocks.flatMap((block) => ids(block.graph?.traps)),
273
+ undefinedBehaviorIds: blocks.flatMap((block) => ids(block.graph?.undefinedBehaviors)),
272
274
  conflictIds: blocks.flatMap((block) => ids(block.graph?.conflicts)),
273
275
  proofObligationIds: blocks.flatMap((block) => ids(block.graph?.proofObligations)),
274
276
  summary: {
@@ -290,9 +292,15 @@ function mergeResourceGraphBlocks(blocks) {
290
292
  pointerEdgeCount: sum(blocks, 'pointerEdges'),
291
293
  memoryAccessCount: sum(blocks, 'memoryAccesses'),
292
294
  abiBoundaryCount: sum(blocks, 'abiBoundaries'),
295
+ trapCount: sum(blocks, 'traps'),
296
+ undefinedBehaviorCount: sum(blocks, 'undefinedBehaviors'),
297
+ lowLevelPrimitiveCount: sum(blocks, 'lowLevelPrimitives'),
293
298
  conflictCount: sum(blocks, 'conflicts'),
294
299
  proofObligationCount: sum(blocks, 'proofObligations'),
295
- unsafeBoundariesWithoutProof: sum(blocks, 'unsafeBoundariesWithoutProof')
300
+ unsafeBoundariesWithoutProof: sum(blocks, 'unsafeBoundariesWithoutProof'),
301
+ failClosedTrapCount: sum(blocks, 'failClosedTraps'),
302
+ trapWithoutProofCount: sum(blocks, 'trapsWithoutProof'),
303
+ undefinedBehaviorWithoutProofCount: sum(blocks, 'undefinedBehaviorsWithoutProof')
296
304
  },
297
305
  metadata: { authoredResourceGraphBlockIds: blocks.map((block) => block.id) }
298
306
  };
@@ -0,0 +1,25 @@
1
+ export function parseLowLevelResourceRecord(kind, common, name, text) {
2
+ if (kind === 'memoryRegion') return cleanRecord({ ...common, resourceId: word('resource', text) ?? word('resourceId', text), memoryKind: word('memoryKind', text) ?? word('kind', text) ?? name, regionKind: word('regionKind', text), addressSpace: word('addressSpace', text) ?? word('space', text), address: word('address', text) ?? word('baseAddress', text), sizeBytes: number('sizeBytes', text) ?? number('size', text), alignmentBytes: number('alignmentBytes', text) ?? number('alignment', text), pointerWidth: number('pointerWidth', text), endian: word('endian', text) ?? word('endianness', text), volatile: flag('volatile', text), atomic: flag('atomic', text), shared: flag('shared', text) });
3
+ if (kind === 'dataLayout') return cleanRecord({ ...common, resourceId: word('resource', text) ?? word('resourceId', text), typeId: word('type', text) ?? word('typeId', text), structId: word('struct', text) ?? word('structId', text), fieldId: word('field', text) ?? word('fieldId', text), bitfieldId: word('bitfield', text) ?? word('bitfieldId', text), layoutKind: word('layoutKind', text) ?? word('kind', text), repr: word('repr', text), abi: word('abi', text), endian: word('endian', text) ?? word('endianness', text), sizeBytes: number('sizeBytes', text) ?? number('size', text), alignmentBytes: number('alignmentBytes', text) ?? number('alignment', text), offsetBytes: number('offsetBytes', text) ?? number('offset', text), bitWidth: number('bitWidth', text) ?? number('width', text), fieldOrder: list(text, 'fieldOrder', 'fields'), constraintKinds: list(text, 'constraint', 'constraints', 'constraintKind', 'constraintKinds') });
4
+ if (kind === 'pointerEdge') return cleanRecord({ ...common, resourceId: word('resource', text) ?? word('resourceId', text), targetResourceId: word('targetResource', text) ?? word('targetResourceId', text) ?? word('target', text), ownerId: word('owner', text) ?? word('ownerId', text), lifetimeRegionId: word('lifetime', text) ?? word('lifetimeRegion', text) ?? word('lifetimeRegionId', text), pointerKind: word('pointerKind', text) ?? word('kind', text) ?? 'pointer', addressSpace: word('addressSpace', text) ?? word('space', text), pointerWidth: number('pointerWidth', text), aliasKind: word('aliasKind', text), mode: word('mode', text), provenance: word('provenance', text), nullable: flag('nullable', text), mutable: flag('mutable', text) });
5
+ if (kind === 'memoryAccess') return cleanRecord({ ...common, resourceId: word('resource', text) ?? word('resourceId', text), accessKind: word('accessKind', text) ?? word('kind', text) ?? name, operationKind: word('operation', text) ?? word('operationKind', text), memoryOrder: word('memoryOrder', text) ?? word('ordering', text), lockId: word('lock', text) ?? word('lockId', text), synchronizationKey: word('sync', text) ?? word('synchronizationKey', text), reads: list(text, 'read', 'reads'), writes: list(text, 'write', 'writes'), volatile: flag('volatile', text), atomic: flag('atomic', text), proofStatus: word('proofStatus', text) ?? word('status', text) ?? 'missing' });
6
+ if (kind === 'abiBoundary') return cleanRecord({ ...common, resourceId: word('resource', text) ?? word('resourceId', text), callableId: word('callable', text) ?? word('callableId', text), functionId: word('function', text) ?? word('functionId', text), boundaryKind: word('boundaryKind', text) ?? word('kind', text) ?? 'abi-boundary', abi: word('abi', text), abiKind: word('abiKind', text), callingConvention: word('callingConvention', text) ?? word('convention', text), pointerWidth: number('pointerWidth', text), endian: word('endian', text) ?? word('endianness', text), ffiBoundary: word('ffiBoundary', text), proofStatus: word('proofStatus', text) ?? word('status', text) ?? 'missing' });
7
+ if (kind === 'trap') return cleanRecord({ ...common, resourceId: word('resource', text) ?? word('resourceId', text), ownerId: word('owner', text) ?? word('ownerId', text), loanId: word('loan', text) ?? word('loanId', text), pointerEdgeId: word('pointer', text) ?? word('pointerEdge', text) ?? word('pointerEdgeId', text), memoryAccessId: word('memoryAccess', text) ?? word('memoryAccessId', text), unsafeBoundaryId: word('unsafeBoundary', text) ?? word('unsafeBoundaryId', text), operationKind: word('operation', text) ?? word('operationKind', text), instructionId: word('instruction', text) ?? word('instructionId', text), callableId: word('callable', text) ?? word('callableId', text), trapKind: word('trapKind', text) ?? word('kind', text) ?? name, trapCode: word('trapCode', text) ?? word('code', text), reasonCode: word('reasonCode', text) ?? word('code', text), condition: quoted('condition', text) ?? word('condition', text), status: word('status', text) ?? 'needs-proof', severity: word('severity', text) ?? 'error', proofStatus: word('proofStatus', text) ?? word('status', text) ?? 'missing', message: quoted('message', text), failClosed: common.failClosed ?? true, semanticEquivalenceClaim: false, runtimeEquivalenceClaim: false });
8
+ if (kind === 'undefinedBehavior') return cleanRecord({ ...common, resourceId: word('resource', text) ?? word('resourceId', text), ownerId: word('owner', text) ?? word('ownerId', text), loanId: word('loan', text) ?? word('loanId', text), pointerEdgeId: word('pointer', text) ?? word('pointerEdge', text) ?? word('pointerEdgeId', text), memoryAccessId: word('memoryAccess', text) ?? word('memoryAccessId', text), unsafeBoundaryId: word('unsafeBoundary', text) ?? word('unsafeBoundaryId', text), operationKind: word('operation', text) ?? word('operationKind', text), undefinedBehaviorKind: word('undefinedBehaviorKind', text) ?? word('behaviorKind', text) ?? word('kind', text) ?? name, language: word('language', text), reasonCode: word('reasonCode', text) ?? word('code', text), condition: quoted('condition', text) ?? word('condition', text), status: word('status', text) ?? 'needs-proof', severity: word('severity', text) ?? 'error', proofStatus: word('proofStatus', text) ?? word('status', text) ?? 'missing', message: quoted('message', text), failClosed: common.failClosed ?? true, semanticEquivalenceClaim: false, runtimeEquivalenceClaim: false });
9
+ return undefined;
10
+ }
11
+
12
+ function word(label, text) { return new RegExp('(?:^|\\s)' + label + '\\s+([^\\s,]+)').exec(text)?.[1]?.trim(); }
13
+ function quoted(label, text) { return new RegExp("(?:^|\\s)" + label + "\\s+[\"']([^\"']+)[\"']").exec(text)?.[1]?.trim(); }
14
+ function flag(label, text) { return new RegExp('(?:^|\\s)' + label + '(?:\\s|$)').test(text) || undefined; }
15
+ function number(label, text) { const value = word(label, text); return value === undefined ? undefined : Number(value); }
16
+ function list(text, ...labels) {
17
+ for (const label of labels) {
18
+ const value = new RegExp('(?:^|\\s)' + label + '\\s+([^\\s]+)').exec(text)?.[1]?.trim();
19
+ if (value) return value.split(/[|,]/).map((item) => item.trim()).filter(Boolean);
20
+ }
21
+ return undefined;
22
+ }
23
+ function cleanRecord(record) {
24
+ return Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined && (!Array.isArray(value) || value.length > 0)));
25
+ }
@@ -1,4 +1,5 @@
1
1
  import { createRowIdentityTracker } from './row-identity.js';
2
+ import { parseLowLevelResourceRecord } from './resource-graph-low-level.js';
2
3
 
3
4
  const GROUPS = {
4
5
  resource: 'resources',
@@ -17,6 +18,8 @@ const GROUPS = {
17
18
  pointerEdge: 'pointerEdges',
18
19
  memoryAccess: 'memoryAccesses',
19
20
  abiBoundary: 'abiBoundaries',
21
+ trap: 'traps',
22
+ undefinedBehavior: 'undefinedBehaviors',
20
23
  conflict: 'conflicts',
21
24
  proofObligation: 'proofObligations'
22
25
  };
@@ -51,6 +54,8 @@ export function parseResourceGraphBlock(block) {
51
54
  pointerEdges: [],
52
55
  memoryAccesses: [],
53
56
  abiBoundaries: [],
57
+ traps: [],
58
+ undefinedBehaviors: [],
54
59
  conflicts: [],
55
60
  proofObligations: [],
56
61
  parser: { status: 'authored', errors: rowIdentity.errors },
@@ -83,10 +88,13 @@ export function parseResourceGraphBlock(block) {
83
88
  resourceIds: ids(graph.resources),
84
89
  ownerIds: ids(graph.owners),
85
90
  lifetimeRegionIds: ids(graph.lifetimeRegions),
86
- lowLevelPrimitiveIds: ids([...graph.memoryRegions, ...graph.dataLayouts, ...graph.pointerEdges, ...graph.memoryAccesses, ...graph.abiBoundaries]),
91
+ trapIds: ids(graph.traps),
92
+ undefinedBehaviorIds: ids(graph.undefinedBehaviors),
93
+ failClosedTrapIds: ids(graph.traps.filter((record) => record.failClosed)),
94
+ lowLevelPrimitiveIds: ids([...graph.memoryRegions, ...graph.dataLayouts, ...graph.pointerEdges, ...graph.memoryAccesses, ...graph.abiBoundaries, ...graph.traps, ...graph.undefinedBehaviors]),
87
95
  sourcePaths: unique(allRecords(graph).map((record) => record.sourcePath)),
88
96
  evidenceIds: unique([...graph.evidenceIds, ...allRecords(graph).flatMap((record) => record.evidenceIds ?? [])]),
89
- blockerReasonCodes: unique(graph.conflicts.map((record) => record.reasonCode))
97
+ blockerReasonCodes: unique([...graph.conflicts, ...graph.traps, ...graph.undefinedBehaviors].map((record) => record.reasonCode))
90
98
  };
91
99
 
92
100
  return {
@@ -114,11 +122,8 @@ function parseResourceRecord(kind, name, text, graph, authoredLine = {}) {
114
122
  if (kind === 'lifetimeRelation') return cleanRecord({ ...common, relationKind: readInlineWord('relationKind', text) ?? readInlineWord('kind', text) ?? 'outlives', fromLifetimeId: readInlineWord('fromLifetime', text) ?? readInlineWord('fromLifetimeId', text) ?? readInlineWord('from', text), toLifetimeId: readInlineWord('toLifetime', text) ?? readInlineWord('toLifetimeId', text) ?? readInlineWord('to', text), from: readInlineWord('from', text), to: readInlineWord('to', text) });
115
123
  if (kind === 'borrowScope') return cleanRecord({ ...common, scopeKind: readInlineWord('scopeKind', text) ?? readInlineWord('kind', text) ?? 'borrow-scope', constraintKind: readInlineWord('constraintKind', text), constraintKinds: readInlineList(text, 'constraint', 'constraints', 'constraintKind', 'constraintKinds') ?? [], ownershipKind: readInlineWord('ownershipKind', text), lifetimeKind: readInlineWord('lifetimeKind', text), controlFlowKind: readInlineWord('controlFlowKind', text), sourceControlFlowId: readInlineWord('sourceControlFlow', text) ?? readInlineWord('sourceControlFlowId', text), lifetimeRegionId: readInlineWord('lifetime', text) ?? readInlineWord('lifetimeRegion', text) ?? readInlineWord('lifetimeRegionId', text), resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text) });
116
124
  if (kind === 'unsafeBoundary') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), unsafeBoundary: true, proofStatus: readInlineWord('proofStatus', text) ?? readInlineWord('status', text) ?? 'missing', kind: readInlineWord('kind', text) });
117
- if (kind === 'memoryRegion') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), memoryKind: readInlineWord('memoryKind', text) ?? readInlineWord('kind', text) ?? name, regionKind: readInlineWord('regionKind', text), addressSpace: readInlineWord('addressSpace', text) ?? readInlineWord('space', text), address: readInlineWord('address', text) ?? readInlineWord('baseAddress', text), sizeBytes: readInlineNumber('sizeBytes', text) ?? readInlineNumber('size', text), alignmentBytes: readInlineNumber('alignmentBytes', text) ?? readInlineNumber('alignment', text), pointerWidth: readInlineNumber('pointerWidth', text), endian: readInlineWord('endian', text) ?? readInlineWord('endianness', text), volatile: readInlineFlag('volatile', text), atomic: readInlineFlag('atomic', text), shared: readInlineFlag('shared', text) });
118
- if (kind === 'dataLayout') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), typeId: readInlineWord('type', text) ?? readInlineWord('typeId', text), structId: readInlineWord('struct', text) ?? readInlineWord('structId', text), fieldId: readInlineWord('field', text) ?? readInlineWord('fieldId', text), bitfieldId: readInlineWord('bitfield', text) ?? readInlineWord('bitfieldId', text), layoutKind: readInlineWord('layoutKind', text) ?? readInlineWord('kind', text), repr: readInlineWord('repr', text), abi: readInlineWord('abi', text), endian: readInlineWord('endian', text) ?? readInlineWord('endianness', text), sizeBytes: readInlineNumber('sizeBytes', text) ?? readInlineNumber('size', text), alignmentBytes: readInlineNumber('alignmentBytes', text) ?? readInlineNumber('alignment', text), offsetBytes: readInlineNumber('offsetBytes', text) ?? readInlineNumber('offset', text), bitWidth: readInlineNumber('bitWidth', text) ?? readInlineNumber('width', text), fieldOrder: readInlineList(text, 'fieldOrder', 'fields'), constraintKinds: readInlineList(text, 'constraint', 'constraints', 'constraintKind', 'constraintKinds') });
119
- if (kind === 'pointerEdge') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), targetResourceId: readInlineWord('targetResource', text) ?? readInlineWord('targetResourceId', text) ?? readInlineWord('target', text), ownerId: readInlineWord('owner', text) ?? readInlineWord('ownerId', text), lifetimeRegionId: readInlineWord('lifetime', text) ?? readInlineWord('lifetimeRegion', text) ?? readInlineWord('lifetimeRegionId', text), pointerKind: readInlineWord('pointerKind', text) ?? readInlineWord('kind', text) ?? 'pointer', addressSpace: readInlineWord('addressSpace', text) ?? readInlineWord('space', text), pointerWidth: readInlineNumber('pointerWidth', text), aliasKind: readInlineWord('aliasKind', text), mode: readInlineWord('mode', text), provenance: readInlineWord('provenance', text), nullable: readInlineFlag('nullable', text), mutable: readInlineFlag('mutable', text) });
120
- if (kind === 'memoryAccess') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), accessKind: readInlineWord('accessKind', text) ?? readInlineWord('kind', text) ?? name, operationKind: readInlineWord('operation', text) ?? readInlineWord('operationKind', text), memoryOrder: readInlineWord('memoryOrder', text) ?? readInlineWord('ordering', text), lockId: readInlineWord('lock', text) ?? readInlineWord('lockId', text), synchronizationKey: readInlineWord('sync', text) ?? readInlineWord('synchronizationKey', text), reads: readInlineList(text, 'read', 'reads'), writes: readInlineList(text, 'write', 'writes'), volatile: readInlineFlag('volatile', text), atomic: readInlineFlag('atomic', text), proofStatus: readInlineWord('proofStatus', text) ?? readInlineWord('status', text) ?? 'missing' });
121
- if (kind === 'abiBoundary') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), callableId: readInlineWord('callable', text) ?? readInlineWord('callableId', text), functionId: readInlineWord('function', text) ?? readInlineWord('functionId', text), boundaryKind: readInlineWord('boundaryKind', text) ?? readInlineWord('kind', text) ?? 'abi-boundary', abi: readInlineWord('abi', text), abiKind: readInlineWord('abiKind', text), callingConvention: readInlineWord('callingConvention', text) ?? readInlineWord('convention', text), pointerWidth: readInlineNumber('pointerWidth', text), endian: readInlineWord('endian', text) ?? readInlineWord('endianness', text), ffiBoundary: readInlineWord('ffiBoundary', text), proofStatus: readInlineWord('proofStatus', text) ?? readInlineWord('status', text) ?? 'missing' });
125
+ const lowLevelRecord = parseLowLevelResourceRecord(kind, common, name, text);
126
+ if (lowLevelRecord) return lowLevelRecord;
122
127
  if (kind === 'conflict') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), ownerId: readInlineWord('owner', text) ?? readInlineWord('ownerId', text), loanId: readInlineWord('loan', text) ?? readInlineWord('loanId', text), aliasId: readInlineWord('alias', text) ?? readInlineWord('aliasId', text), unsafeBoundaryId: readInlineWord('unsafeBoundary', text) ?? readInlineWord('unsafeBoundaryId', text), reasonCode: readInlineWord('reasonCode', text), message: readInlineQuoted('message', text), status: readInlineWord('status', text) ?? 'open', severity: readInlineWord('severity', text) ?? 'error' });
123
128
  if (kind === 'proofObligation') return cleanRecord({ ...common, resourceId: readInlineWord('resource', text) ?? readInlineWord('resourceId', text), conflictId: readInlineWord('conflict', text) ?? readInlineWord('conflictId', text), kind: readInlineWord('kind', text), status: readInlineWord('status', text) ?? 'open', statement: readInlineQuoted('statement', text) });
124
129
  return undefined;
@@ -163,11 +168,17 @@ function summarize(graph) {
163
168
  pointerEdges: graph.pointerEdges.length,
164
169
  memoryAccesses: graph.memoryAccesses.length,
165
170
  abiBoundaries: graph.abiBoundaries.length,
171
+ traps: graph.traps.length,
172
+ undefinedBehaviors: graph.undefinedBehaviors.length,
173
+ lowLevelPrimitives: graph.memoryRegions.length + graph.dataLayouts.length + graph.pointerEdges.length + graph.memoryAccesses.length + graph.abiBoundaries.length + graph.traps.length + graph.undefinedBehaviors.length,
166
174
  conflicts: graph.conflicts.length,
167
175
  proofObligations: graph.proofObligations.length,
168
176
  unsafeBoundariesWithoutProof: graph.unsafeBoundaries.filter((record) => record.proofStatus !== 'passed').length,
177
+ failClosedTraps: graph.traps.filter((record) => record.failClosed).length,
178
+ trapsWithoutProof: graph.traps.filter((record) => record.proofStatus !== 'passed').length,
179
+ undefinedBehaviorsWithoutProof: graph.undefinedBehaviors.filter((record) => record.proofStatus !== 'passed').length,
169
180
  parseErrors: graph.parser?.errors?.length ?? 0,
170
- reasonCodes: unique(graph.conflicts.map((record) => record.reasonCode))
181
+ reasonCodes: unique([...graph.conflicts, ...graph.traps, ...graph.undefinedBehaviors].map((record) => record.reasonCode))
171
182
  };
172
183
  }
173
184
 
@@ -189,6 +200,8 @@ function allRecords(graph) {
189
200
  ...graph.pointerEdges,
190
201
  ...graph.memoryAccesses,
191
202
  ...graph.abiBoundaries,
203
+ ...graph.traps,
204
+ ...graph.undefinedBehaviors,
192
205
  ...graph.conflicts,
193
206
  ...graph.proofObligations
194
207
  ];
@@ -204,6 +217,8 @@ function normalizeRowKind(kind) {
204
217
  if (kind === 'pointer' || kind === 'ptr' || kind === 'address') return 'pointerEdge';
205
218
  if (kind === 'access' || kind === 'memoryAccess' || kind === 'atomic' || kind === 'volatile') return 'memoryAccess';
206
219
  if (kind === 'abi' || kind === 'abiBoundary' || kind === 'callBoundary') return 'abiBoundary';
220
+ if (kind === 'traps') return 'trap';
221
+ if (kind === 'undefined' || kind === 'ub' || kind === 'undefinedBehavior' || kind === 'undefinedBehaviour') return 'undefinedBehavior';
207
222
  if (kind === 'proof' || kind === 'obligation' || kind === 'proofObligation') return 'proofObligation';
208
223
  return kind;
209
224
  }
@@ -218,6 +233,7 @@ function recordKind(kind) {
218
233
  if (kind === 'pointerEdge') return 'pointer-edge';
219
234
  if (kind === 'memoryAccess') return 'memory-access';
220
235
  if (kind === 'abiBoundary') return 'abi-boundary';
236
+ if (kind === 'undefinedBehavior') return 'undefined-behavior';
221
237
  if (kind === 'proofObligation') return 'proof-obligation';
222
238
  return kind;
223
239
  }
@@ -16,8 +16,8 @@ export const ROW_SYNTAX_CONFIG = Object.freeze({
16
16
  runtimeCapabilities: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
17
17
  runtimeCapabilityMatrix: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
18
18
  runtimeHosts: rowConfig('runtimeCapabilityRow', 'runtime_capability_row', runtimeRows, normalizeRuntimeCapabilityRow),
19
- 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 conflict proof proofObligation obligation'), normalizeResourceGraphRow),
20
- 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 conflict proof proofObligation obligation'), normalizeResourceGraphRow),
19
+ 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 trap traps undefined undefinedBehavior undefinedBehaviour ub conflict proof proofObligation obligation'), normalizeResourceGraphRow),
20
+ 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 trap traps undefined undefinedBehavior undefinedBehaviour ub conflict proof proofObligation obligation'), normalizeResourceGraphRow),
21
21
  applicationSurface: rowConfig('applicationSurfaceRow', 'application_surface_row', appRows, normalizeApplicationSurfaceRow),
22
22
  appHost: rowConfig('applicationSurfaceRow', 'application_surface_row', appRows, normalizeApplicationSurfaceRow),
23
23
  plugin: rowConfig('applicationSurfaceRow', 'application_surface_row', appRows, normalizeApplicationSurfaceRow),
@@ -84,6 +84,8 @@ function normalizeResourceGraphRow(rowKind) {
84
84
  if (rowKind === 'pointer' || rowKind === 'ptr' || rowKind === 'address') return 'pointerEdge';
85
85
  if (rowKind === 'access' || rowKind === 'atomic' || rowKind === 'volatile') return 'memoryAccess';
86
86
  if (rowKind === 'abi' || rowKind === 'callBoundary') return 'abiBoundary';
87
+ if (rowKind === 'traps') return 'trap';
88
+ if (rowKind === 'undefined' || rowKind === 'undefinedBehaviour' || rowKind === 'ub') return 'undefinedBehavior';
87
89
  if (rowKind === 'proof' || rowKind === 'proofObligation') return 'obligation';
88
90
  return rowKind;
89
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshift-labs/frontier-lang-parser",
3
- "version": "0.3.72",
3
+ "version": "0.3.73",
4
4
  "description": "Parser for the first Frontier Lang .frontier syntax slice.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",