mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 06:48:03 +00:00
Solidity: add --libraries to sources (#187)
* bugfix: add libraries to sources Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ This is a development pre-release.
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
- Solidity: Add the solc `--libraries` files to sources.
|
||||
|
||||
## v0.1.0-dev.9
|
||||
|
||||
|
||||
@@ -64,11 +64,17 @@ impl Input {
|
||||
via_ir: bool,
|
||||
suppressed_warnings: Option<Vec<Warning>>,
|
||||
) -> anyhow::Result<Self> {
|
||||
let mut paths: BTreeSet<PathBuf> = paths.iter().cloned().collect();
|
||||
let libraries = Settings::parse_libraries(library_map)?;
|
||||
for library_file in libraries.keys() {
|
||||
paths.insert(PathBuf::from(library_file));
|
||||
}
|
||||
|
||||
#[cfg(feature = "parallel")]
|
||||
let iter = paths.into_par_iter(); // Parallel iterator
|
||||
|
||||
#[cfg(not(feature = "parallel"))]
|
||||
let iter = paths.iter(); // Sequential iterator
|
||||
|
||||
let sources = iter
|
||||
.map(|path| {
|
||||
let source = Source::try_from(path.as_path()).unwrap_or_else(|error| {
|
||||
@@ -78,8 +84,6 @@ impl Input {
|
||||
})
|
||||
.collect();
|
||||
|
||||
let libraries = Settings::parse_libraries(library_map)?;
|
||||
|
||||
Ok(Self {
|
||||
language,
|
||||
sources,
|
||||
|
||||
Reference in New Issue
Block a user