* 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)
| 603 | * default may be left out. [0, 0] for a routine with no parameter list. |
| 604 | */ |
| 605 | function 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 |
no test coverage detected