diff options
author | djuju <julfaber@gmail.com> | 2017-04-27 18:56:56 +0800 |
---|---|---|
committer | djuju <julfaber@gmail.com> | 2017-04-27 18:56:56 +0800 |
commit | 5fd7942173a71f1cf7ca1cae0dcde1905482f004 (patch) | |
tree | af41cbfee47ebaf9648b0c614367bbf26f45b3ca /libsolidity | |
parent | 99a7aefb752f6b97475fb48da9c1c01d87af3056 (diff) | |
download | dexon-solidity-5fd7942173a71f1cf7ca1cae0dcde1905482f004.tar.gz dexon-solidity-5fd7942173a71f1cf7ca1cae0dcde1905482f004.tar.zst dexon-solidity-5fd7942173a71f1cf7ca1cae0dcde1905482f004.zip |
documentation, checks and renaming
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 23 | ||||
-rw-r--r-- | libsolidity/interface/CompilerStack.h | 4 |
2 files changed, 13 insertions, 14 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 6276c3c4..56f7b064 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -57,7 +57,7 @@ using namespace dev; using namespace dev::solidity; CompilerStack::CompilerStack(ReadFile::Callback const& _readFile): - m_readFile(_readFile), m_parseSuccessful(false) {} + m_readFile(_readFile), m_success(false) {} void CompilerStack::setRemappings(vector<string> const& _remappings) { @@ -79,7 +79,7 @@ void CompilerStack::setRemappings(vector<string> const& _remappings) void CompilerStack::reset(bool _keepSources) { - m_parseSuccessful = false; + m_success = false; if (_keepSources) for (auto sourcePair: m_sources) sourcePair.second.reset(); @@ -116,7 +116,7 @@ bool CompilerStack::parse() //reset m_errors.clear(); ASTNode::resetID(); - m_parseSuccessful = false; + m_success = false; if (SemVerVersion{string(VersionString)}.isPrerelease()) { @@ -148,8 +148,7 @@ bool CompilerStack::parse() } } } - m_parseSuccessful = Error::containsOnlyWarnings(m_errors); - return m_parseSuccessful; + return Error::containsOnlyWarnings(m_errors); } bool CompilerStack::analyze() @@ -241,8 +240,8 @@ bool CompilerStack::analyze() noErrors = false; } - m_parseSuccessful = noErrors; - return m_parseSuccessful; + m_success = noErrors; + return m_success; } bool CompilerStack::parse(string const& _sourceCode) @@ -264,7 +263,7 @@ bool CompilerStack::parseAndAnalyze(std::string const& _sourceCode) vector<string> CompilerStack::contractNames() const { - if (!m_parseSuccessful) + if (!m_success) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful.")); vector<string> contractNames; for (auto const& contract: m_contracts) @@ -275,7 +274,7 @@ vector<string> CompilerStack::contractNames() const bool CompilerStack::compile(bool _optimize, unsigned _runs, map<string, h160> const& _libraries) { - if (!m_parseSuccessful) + if (!m_success) if (!parseAndAnalyze()) return false; @@ -436,7 +435,7 @@ Json::Value const& CompilerStack::interface(string const& _contractName) const Json::Value const& CompilerStack::metadata(string const& _contractName, DocumentationType _type) const { - if (!m_parseSuccessful) + if (!m_success) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful.")); return metadata(contract(_contractName), _type); @@ -444,7 +443,7 @@ Json::Value const& CompilerStack::metadata(string const& _contractName, Document Json::Value const& CompilerStack::metadata(Contract const& _contract, DocumentationType _type) const { - if (!m_parseSuccessful) + if (!m_success) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful.")); solAssert(_contract.contract, ""); @@ -475,7 +474,7 @@ Json::Value const& CompilerStack::metadata(Contract const& _contract, Documentat string const& CompilerStack::onChainMetadata(string const& _contractName) const { - if (!m_parseSuccessful) + if (!m_success) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful.")); return contract(_contractName).onChainMetadata; diff --git a/libsolidity/interface/CompilerStack.h b/libsolidity/interface/CompilerStack.h index 4c7b0018..9a3221e5 100644 --- a/libsolidity/interface/CompilerStack.h +++ b/libsolidity/interface/CompilerStack.h @@ -104,7 +104,7 @@ public: /// @returns false on error. bool parse(std::string const& _sourceCode); /// performs the analyisis steps (imports, scopesetting, syntaxCheck, referenceResolving, - /// typechecking, staticAnalysis) on the set sources + /// typechecking, staticAnalysis) on previously set sources /// @returns false on error. bool analyze(); /// Parses and analyzes all source units that were added @@ -276,7 +276,7 @@ private: /// list of path prefix remappings, e.g. mylibrary: github.com/ethereum = /usr/local/ethereum /// "context:prefix=target" std::vector<Remapping> m_remappings; - bool m_parseSuccessful; + bool m_success; std::map<std::string const, Source> m_sources; std::shared_ptr<GlobalContext> m_globalContext; std::map<ASTNode const*, std::shared_ptr<DeclarationContainer>> m_scopes; |