aboutsummaryrefslogtreecommitdiffstats
path: root/DeclarationContainer.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-02-14 07:43:02 +0800
committerChristian <c@ethdev.com>2015-02-17 02:24:07 +0800
commit3e29ec2cb2075fc6734a0f350503c393fbeeb3d6 (patch)
tree21012d2ea633c1473d057daea4f3b4ff7e60a574 /DeclarationContainer.cpp
parent500cb69f12a1e048258b1ebb9fa5ea858433ffff (diff)
downloaddexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.gz
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.bz2
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.lz
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.xz
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.zst
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.zip
"external" visibility specifier.
Diffstat (limited to 'DeclarationContainer.cpp')
-rw-r--r--DeclarationContainer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/DeclarationContainer.cpp b/DeclarationContainer.cpp
index 2e810a4c..2594d428 100644
--- a/DeclarationContainer.cpp
+++ b/DeclarationContainer.cpp
@@ -28,14 +28,19 @@ namespace dev
namespace solidity
{
-bool DeclarationContainer::registerDeclaration(Declaration const& _declaration, bool _update)
+bool DeclarationContainer::registerDeclaration(Declaration const& _declaration, bool _invisible, bool _update)
{
- if (_declaration.getName().empty())
+ ASTString const& name(_declaration.getName());
+ if (name.empty())
return true;
- if (!_update && m_declarations.find(_declaration.getName()) != m_declarations.end())
+ if (!_update && (m_declarations.count(name) || m_invisibleDeclarations.count(name)))
return false;
- m_declarations[_declaration.getName()] = &_declaration;
+
+ if (_invisible)
+ m_invisibleDeclarations.insert(name);
+ else
+ m_declarations[name] = &_declaration;
return true;
}