Best-effort name of the first variable declared in `node`.
(node, src: bytes)
| 2560 | |
| 2561 | |
| 2562 | def _decl_first_name(node, src: bytes) -> str: |
| 2563 | """Best-effort name of the first variable declared in `node`.""" |
| 2564 | for c in node.children: |
| 2565 | if c.type == "init_declarator": |
| 2566 | target = c.child_by_field_name("declarator") or c |
| 2567 | for sub in _walk(target): |
| 2568 | if sub.type == "identifier": |
| 2569 | return _node_text(sub, src) |
| 2570 | for sub in _walk(node): |
| 2571 | if sub.type == "identifier": |
| 2572 | return _node_text(sub, src) |
| 2573 | return "<constant>" |
| 2574 | |
| 2575 | |
| 2576 | def _in_signals_section(node, src: bytes) -> bool: |
no test coverage detected