diff --git a/src/twopass.rs b/src/twopass.rs index ce3aeb6..8c5a6c8 100644 --- a/src/twopass.rs +++ b/src/twopass.rs @@ -149,7 +149,20 @@ fn build_in_scope(parent: &BuildContext<'_>, code: &ast::Function) -> Function { source: Box::new(build_expression(&scope, source)), }); } - ast::Statement::Call { callee, args } => todo!(), + ast::Statement::Call { callee, args } => { + body.push(Statement::Call(Call { + callee: Box::new(build_expression( + &scope, + &ast::Expression::Variable(ast::Location::Variable { + name: callee.clone(), + }), + )), + args: args + .iter() + .map(|arg| build_expression(&scope, arg)) + .collect(), + })); + } ast::Statement::Local { name, init } => { let init = init.as_ref().map(|init| build_expression(&scope, &init)); let id = scope.scope.borrow_mut().add_local(&name);