diff options
author | chriseth <chris@ethereum.org> | 2018-08-13 19:37:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 19:37:04 +0800 |
commit | a2c754b3fed422b3d8027a5298624bcfed3744a5 (patch) | |
tree | 9306c07b3445117a318f14dcde5efd1bd7dcaf9d /libsolidity/interface/CompilerStack.h | |
parent | 43db88b8363d73ee2f5ffa094ff506414261bd11 (diff) | |
parent | a7885e0b0a8808e9daa7cc3b86781997c614b8d3 (diff) | |
download | dexon-solidity-a2c754b3fed422b3d8027a5298624bcfed3744a5.tar dexon-solidity-a2c754b3fed422b3d8027a5298624bcfed3744a5.tar.gz dexon-solidity-a2c754b3fed422b3d8027a5298624bcfed3744a5.tar.bz2 dexon-solidity-a2c754b3fed422b3d8027a5298624bcfed3744a5.tar.lz dexon-solidity-a2c754b3fed422b3d8027a5298624bcfed3744a5.tar.xz dexon-solidity-a2c754b3fed422b3d8027a5298624bcfed3744a5.tar.zst dexon-solidity-a2c754b3fed422b3d8027a5298624bcfed3744a5.zip |
Merge pull request #4793 from ethereum/emptyRemappings
Disallow remappings with empty prefix.
Diffstat (limited to 'libsolidity/interface/CompilerStack.h')
-rw-r--r-- | libsolidity/interface/CompilerStack.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libsolidity/interface/CompilerStack.h b/libsolidity/interface/CompilerStack.h index 2234a8c9..9a15fbf0 100644 --- a/libsolidity/interface/CompilerStack.h +++ b/libsolidity/interface/CompilerStack.h @@ -84,6 +84,13 @@ public: CompilationSuccessful }; + struct Remapping + { + std::string context; + std::string prefix; + std::string target; + }; + /// Creates a new compiler stack. /// @param _readFile callback to used to read files for import statements. Must return /// and must not emit exceptions. @@ -103,8 +110,11 @@ public: /// All settings, with the exception of remappings, are reset. void reset(bool _keepSources = false); - /// Sets path remappings in the format "context:prefix=target" - void setRemappings(std::vector<std::string> const& _remappings); + // Parses a remapping of the format "context:prefix=target". + static boost::optional<Remapping> parseRemapping(std::string const& _remapping); + + /// Sets path remappings. + void setRemappings(std::vector<Remapping> const& _remappings); /// Sets library addresses. Addresses are cleared iff @a _libraries is missing. /// Will not take effect before running compile. @@ -319,13 +329,6 @@ private: FunctionDefinition const& _function ) const; - struct Remapping - { - std::string context; - std::string prefix; - std::string target; - }; - ReadCallback::Callback m_readFile; ReadCallback::Callback m_smtQuery; bool m_optimize = false; |