diff options
author | chriseth <c@ethdev.com> | 2017-02-01 05:59:56 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-02-14 20:23:44 +0800 |
commit | e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1 (patch) | |
tree | d25d2cd8ecf784824406397130559a407dc2f0db /libsolidity/interface | |
parent | c87bafd2ede044361ff7ca849a14298e97bd8318 (diff) | |
download | dexon-solidity-e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1.tar dexon-solidity-e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1.tar.gz dexon-solidity-e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1.tar.bz2 dexon-solidity-e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1.tar.lz dexon-solidity-e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1.tar.xz dexon-solidity-e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1.tar.zst dexon-solidity-e67faa9839ebd0dadef2adf3ed1ef69fac6f65e1.zip |
Extract scopes into compiler stack.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 3 | ||||
-rw-r--r-- | libsolidity/interface/CompilerStack.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 3335c40e..9d8d872f 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -88,6 +88,7 @@ void CompilerStack::reset(bool _keepSources) m_optimize = false; m_optimizeRuns = 200; m_globalContext.reset(); + m_scopes.clear(); m_sourceOrder.clear(); m_contracts.clear(); m_errors.clear(); @@ -165,7 +166,7 @@ bool CompilerStack::parse() noErrors = false; m_globalContext = make_shared<GlobalContext>(); - NameAndTypeResolver resolver(m_globalContext->declarations(), m_errors); + NameAndTypeResolver resolver(m_globalContext->declarations(), m_scopes, m_errors); for (Source const* source: m_sourceOrder) if (!resolver.registerDeclarations(*source->ast)) return false; diff --git a/libsolidity/interface/CompilerStack.h b/libsolidity/interface/CompilerStack.h index 9ee70215..eddfea68 100644 --- a/libsolidity/interface/CompilerStack.h +++ b/libsolidity/interface/CompilerStack.h @@ -52,6 +52,7 @@ namespace solidity // forward declarations class Scanner; +class ASTNode; class ContractDefinition; class FunctionDefinition; class SourceUnit; @@ -59,6 +60,7 @@ class Compiler; class GlobalContext; class InterfaceHandler; class Error; +class DeclarationContainer; enum class DocumentationType: uint8_t { @@ -271,6 +273,7 @@ private: bool m_parseSuccessful; std::map<std::string const, Source> m_sources; std::shared_ptr<GlobalContext> m_globalContext; + std::map<ASTNode const*, std::shared_ptr<DeclarationContainer>> m_scopes; std::vector<Source const*> m_sourceOrder; std::map<std::string const, Contract> m_contracts; std::string m_formalTranslation; |