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

Function needsArguments

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

Whether a routine has a parameter without a default value, which a call must pass.

(routine: Node)

Source from the content-addressed store, hash-verified

2772
2773/** Whether a routine has a parameter without a default value, which a call must pass. */
2774function needsArguments(routine: Node): boolean {
2775 const signature = routine.signature?.trim();
2776 if (!signature?.startsWith('(')) return false;
2777 let depth = 0;
2778 let end = signature.length;
2779 for (let i = 0; i < signature.length; i++) {
2780 if (signature[i] === '(') depth++;
2781 else if (signature[i] === ')' && --depth === 0) {
2782 end = i;
2783 break;
2784 }
2785 }
2786 return signature.slice(1, end).split(';').some((param) => param.trim() !== '' && !param.includes('='));
2787}
2788
2789/** Whether a routine gives a value — a function or a constructor — rather than a procedure. */
2790function yieldsValue(routine: Node, context: ResolutionContext): boolean {

Callers 5

matchPascalParenlessRefFunction · 0.85
matchPascalInheritedCallFunction · 0.85
ownMemberFunction · 0.85
memberInHierarchyFunction · 0.85
unitDeclarationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected