From 3e772d74c1c1d199e94277b3a51b5786f4554647 Mon Sep 17 00:00:00 2001 From: mehbark Date: Fri, 2 Jan 2026 21:37:59 -0500 Subject: [PATCH] tweak pretty output --- src/ast.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 86f744f..5d300eb 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -98,7 +98,7 @@ impl fmt::Display for Ast { write!(f, "{{{}}}", body.join(" ")) } Ast::App(func, x) => write!(f, "({func} {x})"), - Ast::BinOp(lhs, op, rhs) => write!(f, "({op} {lhs} {rhs})"), + Ast::BinOp(lhs, op, rhs) => write!(f, "({lhs} {op} {rhs})"), Ast::Num(n) => write!(f, "{n}"), Ast::Block(body) => { let body: Vec<_> = body.iter().map(|stmt| format!("{stmt}")).collect(); diff --git a/src/main.rs b/src/main.rs index 7ba0587..f1caf59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,6 @@ fn main() { let src = &env::args().nth(1).expect("give me an argument now"); let res = parse(src); for stmt in res { - println!("{stmt}"); + println!("{stmt};"); } }