From: Mikko Rasa Date: Fri, 24 May 2019 22:32:17 +0000 (+0300) Subject: Process MemberAccess nodes in FunctionInliner X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e37d3b91500994df3de4fe47bd3d3e75d3104b46;p=libs%2Fgl.git Process MemberAccess nodes in FunctionInliner --- diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index c2ebb4b9..a1be91ca 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -1175,6 +1175,12 @@ void ProgramCompiler::FunctionInliner::visit(BinaryExpression &binary) inline_result = 0; } +void ProgramCompiler::FunctionInliner::visit(MemberAccess &memacc) +{ + visit_and_inline(memacc.left); + inline_result = 0; +} + void ProgramCompiler::FunctionInliner::visit(FunctionCall &call) { for(vector >::iterator i=call.arguments.begin(); i!=call.arguments.end(); ++i) diff --git a/source/programcompiler.h b/source/programcompiler.h index d8b2608a..2c8b33b6 100644 --- a/source/programcompiler.h +++ b/source/programcompiler.h @@ -216,6 +216,7 @@ private: virtual void visit(ProgramSyntax::Block &); virtual void visit(ProgramSyntax::UnaryExpression &); virtual void visit(ProgramSyntax::BinaryExpression &); + virtual void visit(ProgramSyntax::MemberAccess &); virtual void visit(ProgramSyntax::FunctionCall &); virtual void visit(ProgramSyntax::Return &); };