Skip to content

Commit

Permalink
Display: SubmachineDeclaration args are not beign printed (#2204)
Browse files Browse the repository at this point in the history
Small PR to fix the fact that SubmachineDeclaration arguments were being
omitted during display.
  • Loading branch information
gzanitti authored Dec 6, 2024
1 parent b1bdec5 commit 58a5c03
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ast/src/asm_analysis/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
}
}

Expand Down

0 comments on commit 58a5c03

Please sign in to comment.