From 63d3356f40ef48a7735a2151a14ad9952fc245db Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 17 Apr 2019 01:22:28 +0200 Subject: Normalize union constructors --- dhall_core/src/printer.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'dhall_core/src/printer.rs') diff --git a/dhall_core/src/printer.rs b/dhall_core/src/printer.rs index bb3c427..4d1ae2d 100644 --- a/dhall_core/src/printer.rs +++ b/dhall_core/src/printer.rs @@ -92,9 +92,9 @@ impl Display for ExprF { write!(f, "{} = {}", k, v) })?, UnionType(a) => fmt_list("< ", " | ", " >", a, f, |(k, v), f| { - write!(f, "{} : ", k)?; + write!(f, "{}", k)?; if let Some(v) = v { - v.fmt(f)? + write!(f, ": {}", v)?; } Ok(()) })?, @@ -108,6 +108,16 @@ impl Display for ExprF { } f.write_str(" >")? } + UnionConstructor(x, map) => { + fmt_list("< ", " | ", " >", map, f, |(k, v), f| { + write!(f, "{}", k)?; + if let Some(v) = v { + write!(f, ": {}", v)?; + } + Ok(()) + })?; + write!(f, ".{}", x)? + } Embed(a) => a.fmt(f)?, Note(_, b) => b.fmt(f)?, } -- cgit v1.2.3