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

Function gatePascalNestedTarget

src/resolution/pascal-scope.ts:979–987  ·  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

977 * `StrLen` variable), and any other call links nothing.
978 */
979function gatePascalNestedTarget(result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null {
980 if (!isBareCall(ref, context)) return null;
981 const lower = ref.referenceName.toLowerCase();
982 const decl = declarationInScope(lower, classOfCall(ref, context), ref, context);
983 if (!decl || (!isRoutine(decl.node) && !(DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context)))) return null;
984 if (decl.node.id === result.targetNodeId) return result;
985 context.rememberNode?.(decl.node);
986 return { ...result, targetNodeId: decl.node.id, confidence: decl.confidence, resolvedBy: decl.resolvedBy };
987}
988
989/**
990 * 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