(ref: UnresolvedRef, context: ResolutionContext)
| 447 | * for the other strategies to resolve. |
| 448 | */ |
| 449 | export function matchPascalNestedCall(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | undefined { |
| 450 | if (ref.language !== 'pascal' || ref.referenceKind !== 'calls' || !isBareCall(ref, context)) return undefined; |
| 451 | const lower = ref.referenceName.toLowerCase(); |
| 452 | let found = nestedRoutineInScope(lower, ref, context); |
| 453 | if (!found) { |
| 454 | const caller = routineNode(ref.fromNodeId, context); |
| 455 | if (!caller || !isNestedRoutine(caller, context)) return undefined; |
| 456 | const decl = declarationInScope(lower, classOfCall(ref, context), ref, context); |
| 457 | if (!decl || !(isRoutine(decl.node) || (DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context)))) return undefined; |
| 458 | found = decl; |
| 459 | } |
| 460 | context.rememberNode?.(found.node); |
| 461 | return { original: ref, targetNodeId: found.node.id, confidence: found.confidence, resolvedBy: found.resolvedBy }; |
| 462 | } |
| 463 | |
| 464 | /** |
| 465 | * A Pascal call another strategy resolved to a routine nested in some other |
no test coverage detected