From 03aedb5d3f57c2d05a510f91ae980dba7366db93 Mon Sep 17 00:00:00 2001 From: mlokr Date: Fri, 19 Jul 2024 13:02:00 +0200 Subject: [PATCH] g --- hblang/src/parser.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index 8ecb665a..42caaf78 100644 --- a/hblang/src/parser.rs +++ b/hblang/src/parser.rs @@ -991,7 +991,10 @@ impl<'a> std::fmt::Display for Expr<'a> { write!(f, " {op} ")?; display_branch(f, right)?; - if matches!(op, TokenKind::Decl | TokenKind::Assign) { + if matches!(op, TokenKind::Decl | TokenKind::Assign) + && INDENT.with(|idnf| !idnf.get()) == 0 + && !matches!(right, Self::Closure { .. }) + { write!(f, ";")?; }