From 7225aac2a403fd5b7b908e1cfa3470e17f751cf8 Mon Sep 17 00:00:00 2001 From: GreasySlug <9619abgoni@gmail.com> Date: Wed, 5 Oct 2022 09:10:54 +0900 Subject: [PATCH] Update: structurally displayed --- compiler/erg_parser/ast.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/erg_parser/ast.rs b/compiler/erg_parser/ast.rs index 2b0d12b1..af1a3e14 100644 --- a/compiler/erg_parser/ast.rs +++ b/compiler/erg_parser/ast.rs @@ -775,8 +775,10 @@ pub struct NormalSet { } impl NestedDisplay for NormalSet { - fn fmt_nest(&self, f: &mut fmt::Formatter<'_>, _level: usize) -> fmt::Result { - write!(f, "{{{}}}", self.elems) + fn fmt_nest(&self, f: &mut fmt::Formatter<'_>, level: usize) -> fmt::Result { + writeln!(f, "{{")?; + self.elems.fmt_nest(f, level + 1)?; + write!(f, "{}}}", " ".repeat(level)) } }