The files of the units a file uses, in the order its `uses` clauses name them.
(fromFile: string, context: ResolutionContext)
| 2344 | |
| 2345 | /** The files of the units a file uses, in the order its `uses` clauses name them. */ |
| 2346 | function usedUnitFiles(fromFile: string, context: ResolutionContext): string[] { |
| 2347 | const memo = memos(context).usedFiles; |
| 2348 | const hit = memo.get(fromFile); |
| 2349 | if (hit) return hit; |
| 2350 | // The unit's `uses` clauses, then those of the files it includes: mORMot's |
| 2351 | // `.inc` files open the unit's implementation with one. |
| 2352 | const unit = unitFilesOf(fromFile, context); |
| 2353 | const files: string[] = []; |
| 2354 | const add = (name: string, own: string): void => { |
| 2355 | const file = unitFileNamed(name.toLowerCase(), own, context); |
| 2356 | if (file && !unit.includes(file) && !files.includes(file)) files.push(file); |
| 2357 | }; |
| 2358 | for (const own of unit) { |
| 2359 | // What an include file in a clause lists comes first: `uses {$I mormot.uses.inc} mormot.core.base, …`. |
| 2360 | for (const name of unitsIncludedInUses(own, context)) add(name, own); |
| 2361 | for (const imp of outlineOf(own, context).imports) add(imp.name, own); |
| 2362 | } |
| 2363 | memo.set(fromFile, files); |
| 2364 | return files; |
| 2365 | } |
| 2366 | |
| 2367 | /** |
| 2368 | * The units an include file in one of a file's `uses` clauses lists |
no test coverage detected