* A Pascal call another strategy resolved to a routine nested in some other * routine, which nothing outside that routine can call: a bare name is then * what the call's scope declares, a routine or data holding one (mORMot's * `StrLen` variable), and any other call links nothing.
(result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext)
| 468 | * `StrLen` variable), and any other call links nothing. |
| 469 | */ |
| 470 | function gatePascalNestedTarget(result: ResolvedRef, ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 471 | if (!isBareCall(ref, context)) return null; |
| 472 | const lower = ref.referenceName.toLowerCase(); |
| 473 | const decl = declarationInScope(lower, classOfCall(ref, context), ref, context); |
| 474 | if (!decl || (!isRoutine(decl.node) && !(DATA_KINDS.has(decl.node.kind) && isProceduralData(decl.node, context)))) return null; |
| 475 | if (decl.node.id === result.targetNodeId) return result; |
| 476 | context.rememberNode?.(decl.node); |
| 477 | return { ...result, targetNodeId: decl.node.id, confidence: decl.confidence, resolvedBy: decl.resolvedBy }; |
| 478 | } |
| 479 | |
| 480 | /** |
| 481 | * The first declaration a bare name reaches from a routine of class `cls` |
no test coverage detected