Skip to content

Commit

Permalink
Fix pretty-printing for static invokes (#1795) (#1800)
Browse files Browse the repository at this point in the history
* Pretty printer: fix a closing parentheses

Fixes #1795, which identified a problem with the closing parentheses in
`static invoke` invocations.

* Pretty printer: fix a stray semicolon

A bonus fix, not directly discovered in #1795 but still obviously a
problem.

* Save expect files affected by #1795
  • Loading branch information
sampsyo authored Dec 4, 2023
1 parent 3e9f6ee commit 75302d5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions calyx-ir/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,12 @@ impl Printer {
}
if outputs.is_empty() {
write!(f, ")")?;
}
if let Some(group) = comb_group {
writeln!(f, " with {};", group.borrow().name)?;
} else {
write!(f, "\n{})", " ".repeat(indent_level))?;
}
if let Some(group) = comb_group {
write!(f, " with {}", group.borrow().name)?;
}
writeln!(f, ";")
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/passes/static-promotion/invoke.expect
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) {
static<2> invoke exp0(
base = r.out,
exp = r.out
)()
);
)();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/passes/static-promotion/multi-static.expect
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (@done done: 1) {
static<2> invoke exp0(
base = r.out,
exp = r.out
)()
);
)();
}
}
}
Expand Down

0 comments on commit 75302d5

Please sign in to comment.