The routine a reference comes from, or null when it comes from a file or anything else.
(id: string, context: ResolutionContext)
| 430 | |
| 431 | /** The routine a reference comes from, or null when it comes from a file or anything else. */ |
| 432 | function routineNode(id: string, context: ResolutionContext): Node | null { |
| 433 | const memo = memos(context).routineNodes; |
| 434 | if (memo.has(id)) return memo.get(id)!; |
| 435 | const node = context.getNodeById?.(id) ?? null; |
| 436 | const routine = node && isRoutine(node) ? node : null; |
| 437 | memo.set(id, routine); |
| 438 | return routine; |
| 439 | } |
| 440 | |
| 441 | /** |
| 442 | * A bare Pascal call (`Inner(1)`) to a routine nested where the call is (see |