mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 00:41:04 +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
|
### Changed
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Solidity: Add the solc `--libraries` files to sources.
|
||||||
|
|
||||||
## v0.1.0-dev.9
|
## v0.1.0-dev.9
|
||||||
|
|
||||||
|
|||||||
@@ -64,11 +64,17 @@ impl Input {
|
|||||||
via_ir: bool,
|
via_ir: bool,
|
||||||
suppressed_warnings: Option<Vec<Warning>>,
|
suppressed_warnings: Option<Vec<Warning>>,
|
||||||
) -> anyhow::Result<Self> {
|
) -> 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")]
|
#[cfg(feature = "parallel")]
|
||||||
let iter = paths.into_par_iter(); // Parallel iterator
|
let iter = paths.into_par_iter(); // Parallel iterator
|
||||||
|
|
||||||
#[cfg(not(feature = "parallel"))]
|
#[cfg(not(feature = "parallel"))]
|
||||||
let iter = paths.iter(); // Sequential iterator
|
let iter = paths.iter(); // Sequential iterator
|
||||||
|
|
||||||
let sources = iter
|
let sources = iter
|
||||||
.map(|path| {
|
.map(|path| {
|
||||||
let source = Source::try_from(path.as_path()).unwrap_or_else(|error| {
|
let source = Source::try_from(path.as_path()).unwrap_or_else(|error| {
|
||||||
@@ -78,8 +84,6 @@ impl Input {
|
|||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let libraries = Settings::parse_libraries(library_map)?;
|
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
language,
|
language,
|
||||||
sources,
|
sources,
|
||||||
|
|||||||
Reference in New Issue
Block a user