From 7806077e59668037de7bb2610150fbbd8a088303 Mon Sep 17 00:00:00 2001 From: tohrnii <100405913+tohrnii@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:56:14 +0000 Subject: [PATCH] feat: add support for functions --- parser/src/transforms/inlining.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/parser/src/transforms/inlining.rs b/parser/src/transforms/inlining.rs index fa4a7b71..44ba9ce1 100644 --- a/parser/src/transforms/inlining.rs +++ b/parser/src/transforms/inlining.rs @@ -307,17 +307,13 @@ impl<'a> Inlining<'a> { Ok(vec![Statement::Expr(expr)]) } - Statement::Return(mut expr) => { - match expr { - Expr::Call(call) => { - self.expand_call(call) - } - _ => { - self.rewrite_expr(&mut expr)?; - Ok(vec![Statement::Return(expr)]) - } - } - } + Statement::Return(mut expr) => match expr { + Expr::Call(call) => self.expand_call(call), + _ => { + self.rewrite_expr(&mut expr)?; + Ok(vec![Statement::Return(expr)]) + } + }, } }