Visit case bodies in scope filler

This commit is contained in:
Alex Beregszaszi 2017-05-23 20:51:33 +01:00
parent 0c5c1ca911
commit d745dd6542
2 changed files with 10 additions and 1 deletions

View File

@ -97,6 +97,15 @@ bool ScopeFiller::operator()(assembly::FunctionDefinition const& _funDef)
return success;
}
bool ScopeFiller::operator()(Switch const& _switch)
{
bool success = true;
for (auto const& _case: _switch.cases)
if (!(*this)(_case.body))
success = false;
return success;
}
bool ScopeFiller::operator()(Block const& _block)
{
bool success = true;

View File

@ -70,7 +70,7 @@ public:
bool operator()(assembly::VariableDeclaration const& _variableDeclaration);
bool operator()(assembly::FunctionDefinition const& _functionDefinition);
bool operator()(assembly::FunctionCall const&) { return true; }
bool operator()(assembly::Switch const&) { return true; };
bool operator()(assembly::Switch const& _switch);
bool operator()(assembly::Block const& _block);
private: