Merge pull request #8069 from random-internet-cat/set-scope

Move scope of Scopable into new ScopableAnnotation
This commit is contained in:
chriseth
2019-12-20 08:22:36 +01:00
committed by GitHub
4 changed files with 69 additions and 12 deletions
+4 -4
View File
@@ -639,7 +639,7 @@ void DeclarationRegistrationHelper::endVisit(FunctionDefinition&)
bool DeclarationRegistrationHelper::visit(TryCatchClause& _tryCatchClause)
{
_tryCatchClause.setScope(m_currentScope);
_tryCatchClause.annotation().scope = m_currentScope;
enterNewSubScope(_tryCatchClause);
return true;
}
@@ -675,7 +675,7 @@ void DeclarationRegistrationHelper::endVisit(FunctionTypeName&)
bool DeclarationRegistrationHelper::visit(Block& _block)
{
_block.setScope(m_currentScope);
_block.annotation().scope = m_currentScope;
enterNewSubScope(_block);
return true;
}
@@ -687,7 +687,7 @@ void DeclarationRegistrationHelper::endVisit(Block&)
bool DeclarationRegistrationHelper::visit(ForStatement& _for)
{
_for.setScope(m_currentScope);
_for.annotation().scope = m_currentScope;
enterNewSubScope(_for);
return true;
}
@@ -761,7 +761,7 @@ void DeclarationRegistrationHelper::registerDeclaration(Declaration& _declaratio
registerDeclaration(*m_scopes[m_currentScope], _declaration, nullptr, nullptr, warnAboutShadowing, inactive, m_errorReporter);
_declaration.setScope(m_currentScope);
_declaration.annotation().scope = m_currentScope;
if (_opensScope)
enterNewSubScope(_declaration);
}