diff options
author | Christian <c@ethdev.com> | 2014-12-01 22:22:45 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-02 00:33:21 +0800 |
commit | 9e91596c8d5683e79314fcd53a18e0e3df7b3390 (patch) | |
tree | 403740e7f56b4f6fc9d7b49b1c7383f5cdb99a5f /NameAndTypeResolver.h | |
parent | 3fc2708d657525162567b663a07cf8cb5b1c59aa (diff) | |
download | dexon-solidity-9e91596c8d5683e79314fcd53a18e0e3df7b3390.tar.gz dexon-solidity-9e91596c8d5683e79314fcd53a18e0e3df7b3390.tar.zst dexon-solidity-9e91596c8d5683e79314fcd53a18e0e3df7b3390.zip |
Save the scope for every declaration.
Diffstat (limited to 'NameAndTypeResolver.h')
-rw-r--r-- | NameAndTypeResolver.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/NameAndTypeResolver.h b/NameAndTypeResolver.h index 64f3c89d..797eca60 100644 --- a/NameAndTypeResolver.h +++ b/NameAndTypeResolver.h @@ -25,7 +25,7 @@ #include <map> #include <boost/noncopyable.hpp> -#include <libsolidity/Scope.h> +#include <libsolidity/DeclarationContainer.h> #include <libsolidity/ASTVisitor.h> namespace dev @@ -61,9 +61,9 @@ private: /// Maps nodes declaring a scope to scopes, i.e. ContractDefinition and FunctionDeclaration, /// where nullptr denotes the global scope. Note that structs are not scope since they do /// not contain code. - std::map<ASTNode const*, Scope> m_scopes; + std::map<ASTNode const*, DeclarationContainer> m_scopes; - Scope* m_currentScope; + DeclarationContainer* m_currentScope; }; /** @@ -73,7 +73,7 @@ private: class DeclarationRegistrationHelper: private ASTVisitor { public: - DeclarationRegistrationHelper(std::map<ASTNode const*, Scope>& _scopes, ASTNode& _astRoot); + DeclarationRegistrationHelper(std::map<ASTNode const*, DeclarationContainer>& _scopes, ASTNode& _astRoot); private: bool visit(ContractDefinition& _contract); @@ -85,12 +85,12 @@ private: void endVisit(VariableDefinition& _variableDefinition); bool visit(VariableDeclaration& _declaration); - void enterNewSubScope(ASTNode& _node); + void enterNewSubScope(Declaration& _declaration); void closeCurrentScope(); void registerDeclaration(Declaration& _declaration, bool _opensScope); - std::map<ASTNode const*, Scope>& m_scopes; - Scope* m_currentScope; + std::map<ASTNode const*, DeclarationContainer>& m_scopes; + Declaration* m_currentScope; FunctionDefinition* m_currentFunction; }; |