From 061a726481e5100b0f2fa87fb93914cdcd8782c0 Mon Sep 17 00:00:00 2001 From: Marcel Garus Date: Thu, 17 Aug 2023 14:22:43 +0200 Subject: [PATCH] Don't have a responsible parameter in the LIR --- compiler/frontend/src/lir/body.rs | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/compiler/frontend/src/lir/body.rs b/compiler/frontend/src/lir/body.rs index 7edf71d0c..24a41200c 100644 --- a/compiler/frontend/src/lir/body.rs +++ b/compiler/frontend/src/lir/body.rs @@ -73,24 +73,7 @@ impl ToRichIr for Bodies { builder.push_definition(parameter_id, range); } - let responsible_parameter_id = body.responsible_parameter_id(); - builder.push( - if body.parameter_count == 0 { - " (responsible " - } else { - " (+ responsible " - }, - None, - EnumSet::empty(), - ); - let range = builder.push( - responsible_parameter_id.to_string(), - TokenType::Parameter, - EnumSet::empty(), - ); - builder.push_definition(responsible_parameter_id, range); - - builder.push(") =", None, EnumSet::empty()); + builder.push(" =", None, EnumSet::empty()); builder.indent(); builder.push_newline(); @@ -106,7 +89,6 @@ impl ToRichIr for Bodies { /// /// - captured variables /// - parameters -/// - responsible parameter /// - locals #[derive(Clone, Debug, Eq, PartialEq)] pub struct Body { @@ -152,16 +134,12 @@ impl Body { (self.captured_count..self.captured_count + self.parameter_count).map(Id::from_usize) } - fn responsible_parameter_id(&self) -> Id { - Id::from_usize(self.captured_count + self.parameter_count) - } - #[must_use] pub fn expressions(&self) -> &[Expression] { &self.expressions } pub fn ids_and_expressions(&self) -> impl Iterator { - let offset = self.captured_count + self.parameter_count + 1; + let offset = self.captured_count + self.parameter_count; self.expressions .iter() .enumerate()