(list: SyntaxNode, own: ReadonlySet<string>, source: string, names: CTypeName[])
| 134 | } |
| 135 | |
| 136 | function collectMemberTypeNames(list: SyntaxNode, own: ReadonlySet<string>, source: string, names: CTypeName[]): void { |
| 137 | for (const child of list.namedChildren) { |
| 138 | if (MEMBER_CONDITIONALS.has(child.type)) { |
| 139 | collectMemberTypeNames(child, own, source, names); |
| 140 | continue; |
| 141 | } |
| 142 | if (child.type !== 'field_declaration') continue; |
| 143 | const type = getChildByField(child, 'type'); |
| 144 | if (!type) continue; |
| 145 | const declarators = child.childrenForFieldName('declarator').filter((d: SyntaxNode | null): d is SyntaxNode => !!d); |
| 146 | const unnamedBody = CLASS_LIKE_SPECIFIERS.has(type.type) && !getChildByField(type, 'name') |
| 147 | ? getChildByField(type, 'body') |
| 148 | : null; |
| 149 | if (unnamedBody) collectMemberTypeNames(unnamedBody, own, source, names); |
| 150 | else if (declarators.length > 0) collectCTypeNames(type, own, source, names); |
| 151 | for (const declarator of declarators) { |
| 152 | if (!declaresMemberFunction(declarator)) collectDeclaratorTypeNames(declarator, own, source, names); |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /** The types a declarator names, past the type written before it: a function pointer's parameters. */ |
| 158 | function collectDeclaratorTypeNames(declarator: SyntaxNode, own: ReadonlySet<string>, source: string, names: CTypeName[]): void { |
no test coverage detected