diff options
author | Christian <c@ethdev.com> | 2015-01-22 08:02:38 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-26 17:23:39 +0800 |
commit | 941c77c8fadd6195809cd2d572feb64478c4fb20 (patch) | |
tree | a4de3710aff5f3f2d9423565fd0e9ecc8708b5bf /NameAndTypeResolver.cpp | |
parent | 19793dab093ae36b5f2b4d1cabfbf54bed3125b1 (diff) | |
download | dexon-solidity-941c77c8fadd6195809cd2d572feb64478c4fb20.tar.gz dexon-solidity-941c77c8fadd6195809cd2d572feb64478c4fb20.tar.zst dexon-solidity-941c77c8fadd6195809cd2d572feb64478c4fb20.zip |
Type resolution for function modifiers.
Diffstat (limited to 'NameAndTypeResolver.cpp')
-rw-r--r-- | NameAndTypeResolver.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/NameAndTypeResolver.cpp b/NameAndTypeResolver.cpp index ba5ca134..ea3b43c2 100644 --- a/NameAndTypeResolver.cpp +++ b/NameAndTypeResolver.cpp @@ -60,6 +60,11 @@ void NameAndTypeResolver::resolveNamesAndTypes(ContractDefinition& _contract) ReferencesResolver resolver(*structDef, *this, &_contract, nullptr); for (ASTPointer<VariableDeclaration> const& variable: _contract.getStateVariables()) ReferencesResolver resolver(*variable, *this, &_contract, nullptr); + for (ASTPointer<ModifierDefinition> const& modifier: _contract.getFunctionModifiers()) + { + m_currentScope = &m_scopes[modifier.get()]; + ReferencesResolver resolver(*modifier, *this, &_contract, nullptr); + } for (ASTPointer<FunctionDefinition> const& function: _contract.getDefinedFunctions()) { m_currentScope = &m_scopes[function.get()]; @@ -226,6 +231,19 @@ void DeclarationRegistrationHelper::endVisit(FunctionDefinition&) closeCurrentScope(); } +bool DeclarationRegistrationHelper::visit(ModifierDefinition& _modifier) +{ + registerDeclaration(_modifier, true); + m_currentFunction = &_modifier; + return true; +} + +void DeclarationRegistrationHelper::endVisit(ModifierDefinition&) +{ + m_currentFunction = nullptr; + closeCurrentScope(); +} + void DeclarationRegistrationHelper::endVisit(VariableDefinition& _variableDefinition) { // Register the local variables with the function |