From 12b39c5b3ff6d7b1e63ce935424e757174ec6252 Mon Sep 17 00:00:00 2001 From: mlokr Date: Fri, 19 Jul 2024 14:05:13 +0200 Subject: [PATCH] q --- hblang/src/parser.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index bc00bf9..40b0267 100644 --- a/hblang/src/parser.rs +++ b/hblang/src/parser.rs @@ -966,7 +966,9 @@ impl<'a> std::fmt::Display for Expr<'a> { write!(f, "{stmt}")?; if let Some(expr) = stmts.get(i + 1) && let Some(rest) = source.get(expr.pos() as usize..) - && lexer::Lexer::new(rest).next().kind.precedence().is_some() + && let kind = lexer::Lexer::new(rest).next().kind + && (kind.precedence().is_some() + || matches!(kind, TokenKind::Struct | TokenKind::Tupl)) { write!(f, ";")?; }