* 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)
| 10521 | * constants. A bare name among them reads that data. |
| 10522 | */ |
| 10523 | private pascalDataNames(classQn: string | null): Set<string> { |
| 10524 | const key = classQn ?? ''; |
| 10525 | let names = this.pascalDataNameSets.get(key); |
| 10526 | if (names) return names; |
| 10527 | names = new Set(); |
| 10528 | const prefix = classQn ? `${classQn.toLowerCase()}::` : null; |
| 10529 | for (const n of this.nodes) { |
| 10530 | if (n.kind === 'enum_member') { |
| 10531 | names.add(n.name.toLowerCase()); // enum values are visible unqualified |
| 10532 | continue; |
| 10533 | } |
| 10534 | if (n.kind !== 'field' && n.kind !== 'property' && n.kind !== 'constant' && n.kind !== 'variable') continue; |
| 10535 | const qn = n.qualifiedName.replace(/<[^>]*>/g, '').toLowerCase(); |
| 10536 | const own = prefix !== null && qn.startsWith(prefix) && qn.indexOf('::', prefix.length) < 0; |
| 10537 | if (own || !qn.includes('::')) names.add(n.name.toLowerCase()); |
| 10538 | } |
| 10539 | this.pascalDataNameSets.set(key, names); |
| 10540 | return names; |
| 10541 | } |
| 10542 | } |
| 10543 | |
| 10544 |
no test coverage detected