void VariableResolver::visit(Block &block)
{
+ if(!blocks.empty() && blocks.back()==&block)
+ return TraversingVisitor::visit(block);
+
blocks.push_back(&block);
block.variables.clear();
TraversingVisitor::visit(block);
TraversingVisitor::visit(iface);
}
+void VariableResolver::visit(FunctionDeclaration &func)
+{
+ blocks.push_back(&func.body);
+ func.body.variables.clear();
+ TraversingVisitor::visit(func);
+ blocks.pop_back();
+}
+
+void VariableResolver::visit(Iteration &iter)
+{
+ blocks.push_back(&iter.body);
+ iter.body.variables.clear();
+ TraversingVisitor::visit(iter);
+ blocks.pop_back();
+}
+
void FunctionResolver::visit(FunctionCall &call)
{
virtual void visit(StructDeclaration &);
virtual void visit(VariableDeclaration &);
virtual void visit(InterfaceBlock &);
+ virtual void visit(FunctionDeclaration &);
+ virtual void visit(Iteration &);
using TraversingVisitor::visit;
};