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

Function pascalParameterRange

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

* The fewest and most arguments a Pascal routine takes, from its signature * (`(const A, B: Integer; C: string = ''): Boolean`): a parameter with a * default may be left out. [0, 0] for a routine with no parameter list.

(signature: string | undefined)

Source from the content-addressed store, hash-verified

603 * default may be left out. [0, 0] for a routine with no parameter list.
604 */
605function pascalParameterRange(signature: string | undefined): [number, number] | null {
606 const groups = pascalParameterGroups(signature);
607 if (!groups) return null;
608 let min = 0;
609 let max = 0;
610 for (const group of groups) {
611 const names = groupNames(group).length;
612 max += names;
613 const colon = group.indexOf(':');
614 if (colon < 0 || !group.slice(colon).includes('=')) min += names;
615 }
616 return [min, max];
617}
618
619/**
620 * The type of each of a Pascal routine's parameters, with how it is passed

Callers 6

matchPascalInheritedCallFunction · 0.85
exactFunction · 0.85
fitsArgumentsFunction · 0.85
takesExactlyFunction · 0.85
overloadByArityFunction · 0.85
rangeFunction · 0.85

Calls 2

pascalParameterGroupsFunction · 0.85
groupNamesFunction · 0.85

Tested by

no test coverage detected