diff --git a/hblang/src/codegen.rs b/hblang/src/codegen.rs index 38430986..96112d28 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 06483934..8ecb665a 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(()) } } }