diff options
author | Nadrieril | 2020-06-25 16:47:59 +0100 |
---|---|---|
committer | GitHub | 2020-06-25 16:47:59 +0100 |
commit | b63e00cebff4a8b53c23faac2881fae640da7db2 (patch) | |
tree | 36a8786cb158c676ebb32bbb8255a93297d07091 /dhall/src/syntax/text/printer.rs | |
parent | 4c80de149200a86f7fc13c725160dafb35d0ac08 (diff) | |
parent | b9c7bf6744fcbf30b988a50fd0b8c28e23f22d29 (diff) |
Merge pull request #171 from Nadrieril/catchup-spec
Diffstat (limited to '')
-rw-r--r-- | dhall/src/syntax/text/printer.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dhall/src/syntax/text/printer.rs b/dhall/src/syntax/text/printer.rs index ccba385..8815d69 100644 --- a/dhall/src/syntax/text/printer.rs +++ b/dhall/src/syntax/text/printer.rs @@ -154,7 +154,9 @@ fn fmt_label(label: &Label, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { | "True" | "False" | "Some" => true, _ => Builtin::parse(&s).is_some(), }; - if !is_reserved && s.chars().all(|c| c.is_ascii_alphanumeric()) { + if s.is_empty() { + write!(f, "``") + } else if !is_reserved && s.chars().all(|c| c.is_ascii_alphanumeric()) { write!(f, "{}", s) } else { write!(f, "`{}`", s) |