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

Function needsArguments

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

1236
1237/** Whether a routine has a parameter without a default value, which a call must pass. */
1238function needsArguments(routine: Node): boolean {
1239 const signature = routine.signature?.trim();
1240 if (!signature?.startsWith('(')) return false;
1241 let depth = 0;
1242 let end = signature.length;
1243 for (let i = 0; i < signature.length; i++) {
1244 if (signature[i] === '(') depth++;
1245 else if (signature[i] === ')' && --depth === 0) {
1246 end = i;
1247 break;
1248 }
1249 }
1250 return signature.slice(1, end).split(';').some((param) => param.trim() !== '' && !param.includes('='));
1251}
1252
1253/** Whether a routine gives a value — a function or a constructor — rather than a procedure. */
1254function yieldsValue(routine: Node, context: ResolutionContext): boolean {

Callers 3

matchPascalParenlessRefFunction · 0.85
memberInHierarchyFunction · 0.85
unitDeclarationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected