MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / matchPascalNestedCall

Function matchPascalNestedCall

src/resolution/pascal-scope.ts:449–462  ·  view source on GitHub ↗
(ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

447 * for the other strategies to resolve.
448 */
449export function matchPascalNestedCall(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | undefined {
450 if (ref.language !== 'pascal' || ref.referenceKind !== 'calls' || !isBareCall(ref, context)) return undefined;
451 const lower = ref.referenceName.toLowerCase();
452 let found = nestedRoutineInScope(lower, ref, context);
453 if (!found) {
454 const caller = routineNode(ref.fromNodeId, context);
455 if (!caller || !isNestedRoutine(caller, context)) return undefined;
456 const decl = declarationInScope(lower, classOfCall(ref, context), ref, context);
457 if (!decl || !(isRoutine(decl.node) || (DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context)))) return undefined;
458 found = decl;
459 }
460 context.rememberNode?.(found.node);
461 return { original: ref, targetNodeId: found.node.id, confidence: found.confidence, resolvedBy: found.resolvedBy };
462}
463
464/**
465 * A Pascal call another strategy resolved to a routine nested in some other

Callers 1

resolveOneInnerMethod · 0.90

Calls 10

isBareCallFunction · 0.85
nestedRoutineInScopeFunction · 0.85
routineNodeFunction · 0.85
isNestedRoutineFunction · 0.85
declarationInScopeFunction · 0.85
classOfCallFunction · 0.85
isRoutineFunction · 0.85
isProceduralDataFunction · 0.85
hasMethod · 0.80
rememberNodeMethod · 0.80

Tested by

no test coverage detected