From 533e4578eac00684abf26c8dd11df0d242ec80b2 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 1 Oct 2015 14:01:19 -0400 Subject: [PATCH] Comma-separate. --- prototype/Doubt/Diff.swift | 4 ++-- prototype/Doubt/Syntax.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prototype/Doubt/Diff.swift b/prototype/Doubt/Diff.swift index b47eccdcd..bb6d348da 100644 --- a/prototype/Doubt/Diff.swift +++ b/prototype/Doubt/Diff.swift @@ -31,8 +31,8 @@ public enum Diff: Comparable, CustomDebugStringConvertible, CustomDocConvertible case let .Copy(a): return a.doc case let .ByKey(a, b): - return a.keys.sort().map { Doc($0) <> Doc(":") <+> Doc(a[$0]!) }.stack().bracket("{-", "-}") - <> b.keys.sort().map { Doc($0) <> Doc(":") <+> Doc(b[$0]!) }.stack().bracket("{+", "+}") + return a.keys.sort().map { Doc($0) <> Doc(":") <+> Doc(a[$0]!) }.joinWithSeparator(",").bracket("{-", "-}") + <> b.keys.sort().map { Doc($0) <> Doc(":") <+> Doc(b[$0]!) }.joinWithSeparator(",").bracket("{+", "+}") } } diff --git a/prototype/Doubt/Syntax.swift b/prototype/Doubt/Syntax.swift index c140b0bcd..fa2fe1ccf 100644 --- a/prototype/Doubt/Syntax.swift +++ b/prototype/Doubt/Syntax.swift @@ -79,7 +79,7 @@ public enum Syntax: CustomDebugStringConvertible, CustomDocConvertible case let .Leaf(n): return Doc(n) case let .Branch(vs): - return vs.map(Doc.init).stack().bracket("{", "}") + return vs.map(Doc.init).joinWithSeparator(",").bracket("{", "}") } } }