MCPcopy Create free account
hub / github.com/argotorg/solidity / detectSourceUnitNameCollisions

Method detectSourceUnitNameCollisions

libsolidity/interface/FileReader.cpp:190–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190std::map<std::string, FileReader::FileSystemPathSet> FileReader::detectSourceUnitNameCollisions(FileSystemPathSet const& _cliPaths) const
191{
192 std::map<std::string, FileReader::FileSystemPathSet> nameToPaths;
193 for (boost::filesystem::path const& cliPath: _cliPaths)
194 {
195 std::string sourceUnitName = cliPathToSourceUnitName(cliPath);
196 boost::filesystem::path normalizedPath = normalizeCLIPathForVFS(cliPath);
197 nameToPaths[sourceUnitName].insert(normalizedPath);
198 }
199
200 std::map<std::string, FileReader::FileSystemPathSet> collisions;
201 for (auto&& [sourceUnitName, cliPaths]: nameToPaths)
202 if (cliPaths.size() >= 2)
203 collisions[sourceUnitName] = std::move(cliPaths);
204
205 return collisions;
206}
207
208boost::filesystem::path FileReader::normalizeCLIPathForVFS(
209 boost::filesystem::path const& _path,

Callers 1

readInputFilesMethod · 0.80

Calls 2

insertMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected