From 75302d566879fa339a7c5c8a29e021e106b00f37 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 4 Dec 2023 17:15:02 -0500 Subject: [PATCH] Fix pretty-printing for static invokes (#1795) (#1800) * 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 --- calyx-ir/src/printer.rs | 6 +++--- tests/passes/static-promotion/invoke.expect | 3 +-- tests/passes/static-promotion/multi-static.expect | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/calyx-ir/src/printer.rs b/calyx-ir/src/printer.rs index 88c488f7b9..7133eebf74 100644 --- a/calyx-ir/src/printer.rs +++ b/calyx-ir/src/printer.rs @@ -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, ";") } } diff --git a/tests/passes/static-promotion/invoke.expect b/tests/passes/static-promotion/invoke.expect index ccbd7e55ad..e437c4e43c 100644 --- a/tests/passes/static-promotion/invoke.expect +++ b/tests/passes/static-promotion/invoke.expect @@ -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 - )() - ); + )(); } } } diff --git a/tests/passes/static-promotion/multi-static.expect b/tests/passes/static-promotion/multi-static.expect index ee0ef2e7d2..af49b1d0cf 100644 --- a/tests/passes/static-promotion/multi-static.expect +++ b/tests/passes/static-promotion/multi-static.expect @@ -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 - )() - ); + )(); } } }