From 757c7894d985233065d03fdedb825f75aeb60e9f Mon Sep 17 00:00:00 2001 From: mlokr Date: Fri, 19 Jul 2024 14:39:30 +0200 Subject: [PATCH] u --- hblang/src/parser.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hblang/src/parser.rs b/hblang/src/parser.rs index 0bb3371..04aa772 100644 --- a/hblang/src/parser.rs +++ b/hblang/src/parser.rs @@ -980,6 +980,13 @@ impl<'a> std::fmt::Display for Expr<'a> { } Self::Number { value, .. } => write!(f, "{value}"), Self::Bool { value, .. } => write!(f, "{value}"), + Self::BinOp { + left: left @ Self::Ident { id, .. }, + op: TokenKind::Assign, + right: Self::BinOp { left: Self::Ident { id: oid, .. }, op, right }, + } if id == oid => { + write!(f, "{left} {op}= {right}") + } Self::BinOp { left, right, op } => { let display_branch = |f: &mut std::fmt::Formatter, expr: &Self| { if let Self::BinOp { op: lop, .. } = expr