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

Function unitRoutineInScope

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

Whether a unit's routine is one a file sees: its own unit's, or one a unit it uses declares in its interface.

(routine: Node, fromFile: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

391
392/** Whether a unit's routine is one a file sees: its own unit's, or one a unit it uses declares in its interface. */
393function unitRoutineInScope(routine: Node, fromFile: string, context: ResolutionContext): boolean {
394 const unit = unitFilesOf(routine.filePath, context)[0]!;
395 if (ownUnitFiles(fromFile, context).includes(unit) || ownUnitFiles(fromFile, context).includes(routine.filePath)) return true;
396 return usedUnitFiles(fromFile, context).includes(unit) && exportedRoutine(routine, context);
397}
398
399/** Whether a call's argument count fits a routine's parameters; true when either can't be read. */
400function fitsArguments(routine: Node, ref: UnresolvedRef, context: ResolutionContext): boolean {

Callers 1

gatePascalCallFunction · 0.85

Calls 4

unitFilesOfFunction · 0.85
ownUnitFilesFunction · 0.85
usedUnitFilesFunction · 0.85
exportedRoutineFunction · 0.85

Tested by

no test coverage detected