mirror of
https://github.com/github/semantic.git
synced 2024-12-20 21:31:48 +03:00
14 lines
278 B
Swift
14 lines
278 B
Swift
func unified(diff: Interpreter<Term>.Diff, before: String, after: String) -> String {
|
|
switch diff {
|
|
case let .Pure(patch):
|
|
return (patch.state.before.map { "{-\($0)-}" } ?? "")
|
|
+ (patch.state.after.map { "{+\($0)+}" } ?? "")
|
|
|
|
case .Roll:
|
|
return ""
|
|
}
|
|
}
|
|
|
|
|
|
import Doubt
|