If the entire expression was a function call, it didn't get inlined
because VariableDeclaration wasn't being handled separately.
inline_result = 0;
}
+void ProgramCompiler::FunctionInliner::visit(VariableDeclaration &var)
+{
+ if(var.init_expression)
+ visit_and_inline(var.init_expression);
+ inline_result = 0;
+}
+
void ProgramCompiler::FunctionInliner::visit(Return &ret)
{
TraversingVisitor::visit(ret);
virtual void visit(ProgramSyntax::BinaryExpression &);
virtual void visit(ProgramSyntax::MemberAccess &);
virtual void visit(ProgramSyntax::FunctionCall &);
+ virtual void visit(ProgramSyntax::VariableDeclaration &);
virtual void visit(ProgramSyntax::Return &);
};