tweak pretty output

This commit is contained in:
mehbark 2026-01-02 21:37:59 -05:00
parent f4dbadced9
commit 3e772d74c1
2 changed files with 2 additions and 2 deletions

View file

@ -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();

View file

@ -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};");
}
}