aboutsummaryrefslogtreecommitdiffstats
path: root/NameAndTypeResolver.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-02-12 04:40:47 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-02-14 06:16:14 +0800
commita989f6f97a9fd5615500e561f51b5c160df08183 (patch)
tree5e0b016b71aa9cbbefd9e89aa8436e0fb3f7675c /NameAndTypeResolver.cpp
parent931e96838a433b3634ae7ab3347f7650cd78003d (diff)
downloaddexon-solidity-a989f6f97a9fd5615500e561f51b5c160df08183.tar
dexon-solidity-a989f6f97a9fd5615500e561f51b5c160df08183.tar.gz
dexon-solidity-a989f6f97a9fd5615500e561f51b5c160df08183.tar.bz2
dexon-solidity-a989f6f97a9fd5615500e561f51b5c160df08183.tar.lz
dexon-solidity-a989f6f97a9fd5615500e561f51b5c160df08183.tar.xz
dexon-solidity-a989f6f97a9fd5615500e561f51b5c160df08183.tar.zst
dexon-solidity-a989f6f97a9fd5615500e561f51b5c160df08183.zip
Enums NameAndTypeResolution - WIP
- Also adding an EndToEnd enum test
Diffstat (limited to 'NameAndTypeResolver.cpp')
-rw-r--r--NameAndTypeResolver.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/NameAndTypeResolver.cpp b/NameAndTypeResolver.cpp
index 7dc42bc6..859d0097 100644
--- a/NameAndTypeResolver.cpp
+++ b/NameAndTypeResolver.cpp
@@ -58,6 +58,8 @@ void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract)
for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs())
ReferencesResolver resolver(*structDef, *this, &_contract, nullptr);
+ for (ASTPointer<EnumDefinition> const& enumDef: _contract.getDefinedEnums())
+ ReferencesResolver resolver(*enumDef, *this, &_contract, nullptr);
for (ASTPointer<VariableDeclaration> const& variable: _contract.getStateVariables())
ReferencesResolver resolver(*variable, *this, &_contract, nullptr);
for (ASTPointer<EventDefinition> const& event: _contract.getEvents())
@@ -79,6 +81,8 @@ void NameAndTypeResolver::checkTypeRequirements(ContractDefinition& _contract)
{
for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs())
structDef->checkValidityOfMembers();
+ for (ASTPointer<EnumDefinition> const& enumDef: _contract.getDefinedEnums())
+ enumDef->checkValidityOfMembers();
_contract.checkTypeRequirements();
}
@@ -221,6 +225,17 @@ void DeclarationRegistrationHelper::endVisit(StructDefinition&)
closeCurrentScope();
}
+bool DeclarationRegistrationHelper::visit(EnumDefinition& _enum)
+{
+ registerDeclaration(_enum, true);
+ return true;
+}
+
+void DeclarationRegistrationHelper::endVisit(EnumDefinition&)
+{
+ closeCurrentScope();
+}
+
bool DeclarationRegistrationHelper::visit(FunctionDefinition& _function)
{
registerDeclaration(_function, true);