mirror of
https://github.com/github/semantic.git
synced 2025-01-01 11:46:14 +03:00
Comma-separate.
This commit is contained in:
parent
12663f1158
commit
533e4578ea
@ -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("{+", "+}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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("{", "}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user