//! The Solidity compiler. #[cfg(not(target_os = "emscripten"))] pub mod solc_compiler; #[cfg(target_os = "emscripten")] pub mod soljson_compiler; pub mod version; use std::path::Path; use std::path::PathBuf; use revive_solc_json_interface::combined_json::CombinedJson; use revive_solc_json_interface::SolcStandardJsonInput; use revive_solc_json_interface::SolcStandardJsonOutput; use self::version::Version; /// The first version of `solc` with the support of standard JSON interface. pub const FIRST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 0); /// The last supported version of `solc`. pub const LAST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 29); /// `--include-path` was introduced in solc `0.8.8` pub const FIRST_INCLUDE_PATH_VERSION: semver::Version = semver::Version::new(0, 8, 8); /// The Solidity compiler. pub trait Compiler { /// Compiles the Solidity `--standard-json` input into Yul IR. fn standard_json( &mut self, input: SolcStandardJsonInput, base_path: Option, include_paths: Vec, allow_paths: Option, ) -> anyhow::Result; /// The `solc --combined-json abi,hashes...` mirror. fn combined_json( &self, paths: &[PathBuf], combined_json_argument: &str, ) -> anyhow::Result; /// The `solc` Yul validator. fn validate_yul(&self, path: &Path) -> anyhow::Result<()>; /// The `solc --version` mini-parser. fn version(&mut self) -> anyhow::Result; }