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

Function routineAlternative

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

* A routine of a unit's declaration's name that its unit declares too: two * declarations of one name in one unit are `{$ifdef}` alternatives, and the * routine is the one with a body to read — mORMot's `MoveFast`, a variable * holding `Move` or the asm procedure `mormot.core.base.asmx64.inc` *

(decl: Node, context: ResolutionContext)

Source from the content-addressed store, hash-verified

431 * implements, and `ToByte`, a type or an inline function.
432 */
433function routineAlternative(decl: Node, context: ResolutionContext): Node | null {
434 if (decl.qualifiedName.includes('::')) return null;
435 const unit = unitFilesOf(decl.filePath, context)[0];
436 return pascalNamed(decl.name.toLowerCase(), context).find((n) => n.kind === 'function' &&
437 n.qualifiedName.toLowerCase() === decl.qualifiedName.toLowerCase() && unitFilesOf(n.filePath, context)[0] === unit) ?? null;
438}
439
440/** Whether a member is a helper's (`TFooHelper = class helper for TFoo`). */
441function helperOwned(member: Node, context: ResolutionContext): boolean {

Callers 1

gatePascalCallFunction · 0.85

Calls 2

unitFilesOfFunction · 0.85
pascalNamedFunction · 0.85

Tested by

no test coverage detected