diff options
author | chriseth <c@ethdev.com> | 2015-12-15 18:43:59 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-12-15 18:43:59 +0800 |
commit | 591a4f1ff44af20fce9bafebf0fa0607e2bdfcc0 (patch) | |
tree | 282c36887814420e2fa86e132587ec9f192f30ad /libsolidity/analysis/DeclarationContainer.h | |
parent | 98684cca9035c754adcdc99fd196716cb7802efd (diff) | |
parent | 53da78e6091d9bb0229b4a54a0042e23487550db (diff) | |
download | dexon-solidity-591a4f1ff44af20fce9bafebf0fa0607e2bdfcc0.tar.gz dexon-solidity-591a4f1ff44af20fce9bafebf0fa0607e2bdfcc0.tar.zst dexon-solidity-591a4f1ff44af20fce9bafebf0fa0607e2bdfcc0.zip |
Merge pull request #288 from chriseth/import_contexts
Do not clutter importee when importing.
Diffstat (limited to 'libsolidity/analysis/DeclarationContainer.h')
-rw-r--r-- | libsolidity/analysis/DeclarationContainer.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libsolidity/analysis/DeclarationContainer.h b/libsolidity/analysis/DeclarationContainer.h index 064724d1..5862f7a5 100644 --- a/libsolidity/analysis/DeclarationContainer.h +++ b/libsolidity/analysis/DeclarationContainer.h @@ -41,23 +41,24 @@ class DeclarationContainer { public: explicit DeclarationContainer( - Declaration const* _enclosingDeclaration = nullptr, + ASTNode const* _enclosingNode = nullptr, DeclarationContainer const* _enclosingContainer = nullptr ): - m_enclosingDeclaration(_enclosingDeclaration), m_enclosingContainer(_enclosingContainer) {} + m_enclosingNode(_enclosingNode), m_enclosingContainer(_enclosingContainer) {} /// Registers the declaration in the scope unless its name is already declared or the name is empty. + /// @param _name the name to register, if nullptr the intrinsic name of @a _declaration is used. /// @param _invisible if true, registers the declaration, reports name clashes but does not return it in @a resolveName /// @param _update if true, replaces a potential declaration that is already present /// @returns false if the name was already declared. - bool registerDeclaration(Declaration const& _declaration, bool _invisible = false, bool _update = false); + bool registerDeclaration(Declaration const& _declaration, ASTString const* _name = nullptr, bool _invisible = false, bool _update = false); std::vector<Declaration const*> resolveName(ASTString const& _name, bool _recursive = false) const; - Declaration const* enclosingDeclaration() const { return m_enclosingDeclaration; } + ASTNode const* enclosingNode() const { return m_enclosingNode; } std::map<ASTString, std::vector<Declaration const*>> const& declarations() const { return m_declarations; } /// @returns whether declaration is valid, and if not also returns previous declaration. - Declaration const* conflictingDeclaration(Declaration const& _declaration) const; + Declaration const* conflictingDeclaration(Declaration const& _declaration, ASTString const* _name = nullptr) const; private: - Declaration const* m_enclosingDeclaration; + ASTNode const* m_enclosingNode; DeclarationContainer const* m_enclosingContainer; std::map<ASTString, std::vector<Declaration const*>> m_declarations; std::map<ASTString, std::vector<Declaration const*>> m_invisibleDeclarations; |