* The names data takes for a routine of class `classQn`, lowercased: the * class's fields, properties and constants, and the unit's variables and * constants. A bare name among them reads that data.
(classQn: string | null)
| 10252 | * constants. A bare name among them reads that data. |
| 10253 | */ |
| 10254 | private pascalDataNames(classQn: string | null): Set<string> { |
| 10255 | const key = classQn ?? ''; |
| 10256 | let names = this.pascalDataNameSets.get(key); |
| 10257 | if (names) return names; |
| 10258 | names = new Set(); |
| 10259 | const prefix = classQn ? `${classQn.toLowerCase()}::` : null; |
| 10260 | for (const n of this.nodes) { |
| 10261 | if (n.kind === 'enum_member') { |
| 10262 | names.add(n.name.toLowerCase()); // enum values are visible unqualified |
| 10263 | continue; |
| 10264 | } |
| 10265 | if (n.kind !== 'field' && n.kind !== 'property' && n.kind !== 'constant' && n.kind !== 'variable') continue; |
| 10266 | const qn = n.qualifiedName.replace(/<[^>]*>/g, '').toLowerCase(); |
| 10267 | const own = prefix !== null && qn.startsWith(prefix) && qn.indexOf('::', prefix.length) < 0; |
| 10268 | if (own || !qn.includes('::')) names.add(n.name.toLowerCase()); |
| 10269 | } |
| 10270 | this.pascalDataNameSets.set(key, names); |
| 10271 | return names; |
| 10272 | } |
| 10273 | } |
| 10274 | |
| 10275 |
no test coverage detected