See gatePascalCall: a call resolved to data.
(target: Node, result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext)
| 197 | |
| 198 | /** See gatePascalCall: a call resolved to data. */ |
| 199 | function gatePascalDataCall(target: Node, result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 200 | if (!isBareCall(ref, context)) return target.language === 'pascal' && isProceduralData(target, context) ? result : null; |
| 201 | const lower = ref.referenceName.toLowerCase(); |
| 202 | if (declaredInRoutine(lower, ref, context)) return null; |
| 203 | const decl = declarationInScope(lower, classOfCall(ref, context), ref, context); |
| 204 | if (!decl) { |
| 205 | const only = target.language === 'pascal' && pascalNamed(lower, context).every((n) => n.id === target.id || n.kind === 'import'); |
| 206 | return only && isProceduralData(target, context) ? result : null; |
| 207 | } |
| 208 | if (!isRoutine(decl.node) && !(DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context))) return null; |
| 209 | if (decl.node.id === target.id) return result; |
| 210 | context.rememberNode?.(decl.node); |
| 211 | return { ...result, targetNodeId: decl.node.id, confidence: decl.confidence, resolvedBy: decl.resolvedBy }; |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Whether the routine making a call declares the called name itself, as a |
no test coverage detected