|
@ -58,6 +58,8 @@ void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract) |
|
|
|
|
|
|
|
|
for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs()) |
|
|
for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs()) |
|
|
ReferencesResolver resolver(*structDef, *this, &_contract, nullptr); |
|
|
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()) |
|
|
for (ASTPointer<VariableDeclaration> const& variable: _contract.getStateVariables()) |
|
|
ReferencesResolver resolver(*variable, *this, &_contract, nullptr); |
|
|
ReferencesResolver resolver(*variable, *this, &_contract, nullptr); |
|
|
for (ASTPointer<EventDefinition> const& event: _contract.getEvents()) |
|
|
for (ASTPointer<EventDefinition> const& event: _contract.getEvents()) |
|
@ -79,6 +81,8 @@ void NameAndTypeResolver::checkTypeRequirements(ContractDefinition& _contract) |
|
|
{ |
|
|
{ |
|
|
for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs()) |
|
|
for (ASTPointer<StructDefinition> const& structDef: _contract.getDefinedStructs()) |
|
|
structDef->checkValidityOfMembers(); |
|
|
structDef->checkValidityOfMembers(); |
|
|
|
|
|
for (ASTPointer<EnumDefinition> const& enumDef: _contract.getDefinedEnums()) |
|
|
|
|
|
enumDef->checkValidityOfMembers(); |
|
|
_contract.checkTypeRequirements(); |
|
|
_contract.checkTypeRequirements(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -221,6 +225,17 @@ void DeclarationRegistrationHelper::endVisit(StructDefinition&) |
|
|
closeCurrentScope(); |
|
|
closeCurrentScope(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool DeclarationRegistrationHelper::visit(EnumDefinition& _enum) |
|
|
|
|
|
{ |
|
|
|
|
|
registerDeclaration(_enum, true); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void DeclarationRegistrationHelper::endVisit(EnumDefinition&) |
|
|
|
|
|
{ |
|
|
|
|
|
closeCurrentScope(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bool DeclarationRegistrationHelper::visit(FunctionDefinition& _function) |
|
|
bool DeclarationRegistrationHelper::visit(FunctionDefinition& _function) |
|
|
{ |
|
|
{ |
|
|
registerDeclaration(_function, true); |
|
|
registerDeclaration(_function, true); |
|
|