See gatePascalCall: a call resolved to data.
(target: Node, result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext)
| 679 | |
| 680 | /** See gatePascalCall: a call resolved to data. */ |
| 681 | function gatePascalDataCall(target: Node, result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 682 | if (!isBareCall(ref, context)) return target.language === 'pascal' && isProceduralData(target, context) ? result : null; |
| 683 | const lower = ref.referenceName.toLowerCase(); |
| 684 | if (declaredInRoutine(lower, ref, context)) return null; |
| 685 | const decl = declarationInScope(lower, classOfCall(ref, context), ref, context); |
| 686 | if (!decl) { |
| 687 | const only = target.language === 'pascal' && pascalNamed(lower, context).every((n) => n.id === target.id || n.kind === 'import'); |
| 688 | return only && isProceduralData(target, context) ? result : null; |
| 689 | } |
| 690 | if (!isRoutine(decl.node) && !(DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context))) return null; |
| 691 | if (decl.node.id === target.id) return result; |
| 692 | context.rememberNode?.(decl.node); |
| 693 | return { ...result, targetNodeId: decl.node.id, confidence: decl.confidence, resolvedBy: decl.resolvedBy }; |
| 694 | } |
| 695 | |
| 696 | /** |
| 697 | * Whether the routine making a call declares the called name itself, as a |
no test coverage detected