1
1
mirror of https://github.com/github/semantic.git synced 2025-01-01 11:46:14 +03:00

Comma-separate.

This commit is contained in:
Rob Rix 2015-10-01 14:01:19 -04:00
parent 12663f1158
commit 533e4578ea
2 changed files with 3 additions and 3 deletions

View File

@ -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("{+", "+}")
}
}

View File

@ -79,7 +79,7 @@ public enum Syntax<Recur, A>: 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("{", "}")
}
}
}