mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 19:11:04 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3184397c43 | |||
| 9c44eeac06 |
@@ -52,7 +52,7 @@ pub use self::warning::Warning;
|
|||||||
pub mod test_utils;
|
pub mod test_utils;
|
||||||
pub mod tests;
|
pub mod tests;
|
||||||
|
|
||||||
use std::collections::BTreeSet;
|
use std::collections::{BTreeMap, BTreeSet};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
/// Runs the Yul mode.
|
/// Runs the Yul mode.
|
||||||
@@ -149,7 +149,7 @@ pub fn standard_output<T: Compiler>(
|
|||||||
suppressed_warnings,
|
suppressed_warnings,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let source_code_files = solc_input
|
let mut source_code_files: BTreeMap<String, String> = solc_input
|
||||||
.sources
|
.sources
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(path, source)| (path.to_owned(), source.content.to_owned()))
|
.map(|(path, source)| (path.to_owned(), source.content.to_owned()))
|
||||||
@@ -180,6 +180,18 @@ pub fn standard_output<T: Compiler>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// load import callbacks unspecified in input
|
||||||
|
if let Some(sources) = &solc_output.sources {
|
||||||
|
for source_path in sources.keys() {
|
||||||
|
if !source_code_files.contains_key(source_path) {
|
||||||
|
let source = std::fs::read_to_string(source_path).map_err(|e| {
|
||||||
|
anyhow::anyhow!("Can't read source file at `{}`: {}", source_path, e)
|
||||||
|
})?;
|
||||||
|
let _ = source_code_files.insert(source_path.clone(), source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let project = solc_output.try_to_project(
|
let project = solc_output.try_to_project(
|
||||||
source_code_files,
|
source_code_files,
|
||||||
libraries,
|
libraries,
|
||||||
|
|||||||
Reference in New Issue
Block a user