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

Function gatePascalNestedTarget

src/resolution/pascal-scope.ts:470–478  ·  view source on GitHub ↗

* A Pascal call another strategy resolved to a routine nested in some other * routine, which nothing outside that routine can call: a bare name is then * what the call's scope declares, a routine or data holding one (mORMot's * `StrLen` variable), and any other call links nothing.

(result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

468 * `StrLen` variable), and any other call links nothing.
469 */
470function gatePascalNestedTarget(result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null {
471 if (!isBareCall(ref, context)) return null;
472 const lower = ref.referenceName.toLowerCase();
473 const decl = declarationInScope(lower, classOfCall(ref, context), ref, context);
474 if (!decl || (!isRoutine(decl.node) && !(DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context)))) return null;
475 if (decl.node.id === result.targetNodeId) return result;
476 context.rememberNode?.(decl.node);
477 return { ...result, targetNodeId: decl.node.id, confidence: decl.confidence, resolvedBy: decl.resolvedBy };
478}
479
480/**
481 * The first declaration a bare name reaches from a routine of class `cls`

Callers 1

gatePascalCallFunction · 0.85

Calls 7

isBareCallFunction · 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