1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00
semantic/prototype/doubt-difftool/Unified.swift
2015-11-02 14:14:19 -05:00

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