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

Function matchPascalNestedCall

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

Source from the content-addressed store, hash-verified

956 * for the other strategies to resolve.
957 */
958export function matchPascalNestedCall(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | undefined {
959 if (ref.language !== 'pascal' || ref.referenceKind !== 'calls' || !isBareCall(ref, context)) return undefined;
960 const lower = ref.referenceName.toLowerCase();
961 let found = nestedRoutineInScope(lower, ref, context);
962 if (!found) {
963 const caller = routineNode(ref.fromNodeId, context);
964 if (!caller || !isNestedRoutine(caller, context)) return undefined;
965 const decl = declarationInScope(lower, classOfCall(ref, context), ref, context);
966 if (!decl || !(isRoutine(decl.node) || (DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context)))) return undefined;
967 found = decl;
968 }
969 context.rememberNode?.(found.node);
970 return { original: ref, targetNodeId: found.node.id, confidence: found.confidence, resolvedBy: found.resolvedBy };
971}
972
973/**
974 * 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