From a1179f332093e95dc008cf8364040dbdd3d720d9 Mon Sep 17 00:00:00 2001 From: mlokr Date: Fri, 19 Jul 2024 12:56:40 +0200 Subject: [PATCH] f --- hblang/src/codegen.rs | 6 +++--- hblang/src/parser.rs | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hblang/src/codegen.rs b/hblang/src/codegen.rs index 3843098..96112d2 100644 --- a/hblang/src/codegen.rs +++ b/hblang/src/codegen.rs @@ -3135,9 +3135,9 @@ impl Codegen { ast.pos(), format_args!( "compiler does not (yet) know how to handle ({hint}):\n\ - {ast:}\n\ - info for weak people:\n\ - {ast:#?}" + {ast:}\n\ + info for weak people:\n\ + {ast:#?}" ), ) } diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index 0648393..8ecb665 100644 --- a/hblang/src/parser.rs +++ b/hblang/src/parser.rs @@ -989,7 +989,13 @@ impl<'a> std::fmt::Display for Expr<'a> { display_branch(f, left)?; write!(f, " {op} ")?; - display_branch(f, right) + display_branch(f, right)?; + + if matches!(op, TokenKind::Decl | TokenKind::Assign) { + write!(f, ";")?; + } + + Ok(()) } } }