Collects the type names under `node` onto `names`, in source order.
(node: SyntaxNode, own: ReadonlySet<string>, source: string, names: CTypeName[])
| 167 | |
| 168 | /** Collects the type names under `node` onto `names`, in source order. */ |
| 169 | function collectCTypeNames(node: SyntaxNode, own: ReadonlySet<string>, source: string, names: CTypeName[]): void { |
| 170 | if (COMPUTED_TYPE_SPECIFIERS.has(node.type)) return; |
| 171 | if (node.type === 'type_identifier' || node.type === 'qualified_identifier' || node.type === 'template_type') { |
| 172 | const name = stripCppTemplateArgs(getNodeText(node, source)).trim(); |
| 173 | if (name && !own.has(name) && !C_STANDARD_TYPE_NAME.test(name)) names.push({ name, node }); |
| 174 | collectTemplateArguments(node, own, source, names); |
| 175 | return; |
| 176 | } |
| 177 | const tag = CLASS_LIKE_SPECIFIERS.has(node.type) ? getChildByField(node, 'name') : null; |
| 178 | for (const c of tag ? [tag] : node.namedChildren) collectCTypeNames(c, own, source, names); |
| 179 | } |
| 180 | |
| 181 | /** The types the template arguments of a written name name, wherever in the name they are. */ |
| 182 | function collectTemplateArguments(node: SyntaxNode, own: ReadonlySet<string>, source: string, names: CTypeName[]): void { |
no test coverage detected