From 58a5c03d49d501e9d48437e40b930d1e0abec3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Zanitti?= Date: Fri, 6 Dec 2024 13:50:24 -0300 Subject: [PATCH] Display: SubmachineDeclaration args are not beign printed (#2204) Small PR to fix the fact that SubmachineDeclaration arguments were being omitted during display. --- ast/src/asm_analysis/display.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ast/src/asm_analysis/display.rs b/ast/src/asm_analysis/display.rs index ecf4e133f9..94be80048c 100644 --- a/ast/src/asm_analysis/display.rs +++ b/ast/src/asm_analysis/display.rs @@ -133,7 +133,15 @@ impl Display for LinkDefinition { impl Display for SubmachineDeclaration { fn fmt(&self, f: &mut Formatter<'_>) -> Result { - write!(f, "{} {}", self.ty, self.name) + write!( + f, + "{} {}{}", + self.ty, + self.name, + (!self.args.is_empty()) + .then(|| format!("({})", self.args.iter().format(", "))) + .unwrap_or_default() + ) } }