From e37d3b91500994df3de4fe47bd3d3e75d3104b46 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 25 May 2019 01:32:17 +0300 Subject: [PATCH] Process MemberAccess nodes in FunctionInliner --- source/programcompiler.cpp | 6 ++++++ source/programcompiler.h | 1 + 2 files changed, 7 insertions(+) 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 &); }; -- 2.45.2