diff options
author | chriseth <c@ethdev.com> | 2015-10-16 00:30:32 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-10-16 00:30:32 +0800 |
commit | 030c868f58bd5156f8c657865ed60b15d81ab7a0 (patch) | |
tree | e11c26ce9e159d93726629b6fdfdff5d08ac6ca8 | |
parent | 7ba42f470753f9af25531017f319cf94eb26d3f2 (diff) | |
parent | ec5b9c2e92959b28d4f7f74245fac0c42ae82314 (diff) | |
download | dexon-solidity-030c868f58bd5156f8c657865ed60b15d81ab7a0.tar.gz dexon-solidity-030c868f58bd5156f8c657865ed60b15d81ab7a0.tar.zst dexon-solidity-030c868f58bd5156f8c657865ed60b15d81ab7a0.zip |
Merge pull request #136 from LianaHus/sol_error_types_refuctoring
changed the way of reporting error during contract checking
-rw-r--r-- | libsolidity/CompilerStack.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libsolidity/CompilerStack.cpp b/libsolidity/CompilerStack.cpp index 1165d6f6..12e49b58 100644 --- a/libsolidity/CompilerStack.cpp +++ b/libsolidity/CompilerStack.cpp @@ -113,7 +113,6 @@ bool CompilerStack::parse() resolveImports(); m_globalContext = make_shared<GlobalContext>(); - bool success = true; NameAndTypeResolver resolver(m_globalContext->declarations(), m_errors); for (Source const* source: m_sourceOrder) if (!resolver.registerDeclarations(*source->ast)) @@ -124,17 +123,12 @@ bool CompilerStack::parse() if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get())) { m_globalContext->setCurrentContract(*contract); - success = success && resolver.updateDeclaration(*m_globalContext->currentThis()); - success = success && resolver.updateDeclaration(*m_globalContext->currentSuper()); - success = success && resolver.resolveNamesAndTypes(*contract); + if (!resolver.updateDeclaration(*m_globalContext->currentThis())) return false; + if (!resolver.updateDeclaration(*m_globalContext->currentSuper())) return false; + if (!resolver.resolveNamesAndTypes(*contract)) return false; m_contracts[contract->name()].contract = contract; } - if (!success) - { - m_parseSuccessful = false; - return m_parseSuccessful; - } InterfaceHandler interfaceHandler; bool typesFine = true; for (Source const* source: m_sourceOrder) |