* 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)
| 9946 | * constants. A bare name among them reads that data. |
| 9947 | */ |
| 9948 | private pascalDataNames(classQn: string | null): Set<string> { |
| 9949 | const key = classQn ?? ''; |
| 9950 | let names = this.pascalDataNameSets.get(key); |
| 9951 | if (names) return names; |
| 9952 | names = new Set(); |
| 9953 | const prefix = classQn ? `${classQn.toLowerCase()}::` : null; |
| 9954 | for (const n of this.nodes) { |
| 9955 | if (n.kind === 'enum_member') { |
| 9956 | names.add(n.name.toLowerCase()); // enum values are visible unqualified |
| 9957 | continue; |
| 9958 | } |
| 9959 | if (n.kind !== 'field' && n.kind !== 'property' && n.kind !== 'constant' && n.kind !== 'variable') continue; |
| 9960 | const qn = n.qualifiedName.replace(/<[^>]*>/g, '').toLowerCase(); |
| 9961 | const own = prefix !== null && qn.startsWith(prefix) && qn.indexOf('::', prefix.length) < 0; |
| 9962 | if (own || !qn.includes('::')) names.add(n.name.toLowerCase()); |
| 9963 | } |
| 9964 | this.pascalDataNameSets.set(key, names); |
| 9965 | return names; |
| 9966 | } |
| 9967 | } |
| 9968 | |
| 9969 |
no test coverage detected