(node: any)
| 545 | } |
| 546 | |
| 547 | function getPythonDocstring(node: any): string | null { |
| 548 | // Python docstring is the first expression statement if it's a string |
| 549 | const body = node.childForFieldName('body'); |
| 550 | if (!body || body.childCount === 0) return null; |
| 551 | const first = body.child(0); |
| 552 | if (first?.type === 'expression_statement') { |
| 553 | const strNode = first.child(0); |
| 554 | if (strNode?.type === 'string') { |
| 555 | return strNode.text.replace(/['"]+/g, '').trim(); |
| 556 | } |
| 557 | } |
| 558 | return null; |
| 559 | } |
| 560 | |
| 561 | function valForLabel(label: string): number { |
| 562 | switch (label) { |
no test coverage detected