func scanAndMapDecls()

in Sources/SwiftCodeSanKit/FileParsers/DeclParser.swift [25:46]


    func scanAndMapDecls(fileToModuleMap: [String: String],
                         topDeclsOnly: Bool,
                         whitelist: Whitelist?) -> DeclMap {
        var allDeclMap = DeclMap()

        scanDecls(fileToModuleMap: fileToModuleMap, topDeclsOnly: topDeclsOnly, whitelist: whitelist) { (filepath, subResults) in
            for (k, decls) in subResults {
                if allDeclMap[k] == nil {
                    allDeclMap[k] = []
                }

                for decl in decls {
                    if allDeclMap[k]?.contains(decl) ?? false {
                        // Already added, so do nothing
                    } else {
                        allDeclMap[k]?.append(decl)
                    }
                }
            }
        }
        return allDeclMap
    }