mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
Construct diffs from terms.
This commit is contained in:
parent
8a4a205055
commit
6e3d6a2209
@ -11,6 +11,15 @@ public enum Diff: Comparable, CustomDebugStringConvertible, CustomDocConvertible
|
||||
return .Patch(term, .Empty)
|
||||
}
|
||||
|
||||
public init(_ term: Fix) {
|
||||
switch term {
|
||||
case .Empty:
|
||||
self = .Empty
|
||||
case let .Roll(s):
|
||||
self = .Copy(s.map(Diff.init))
|
||||
}
|
||||
}
|
||||
|
||||
public var doc: Doc {
|
||||
switch self {
|
||||
case .Empty:
|
||||
|
Loading…
Reference in New Issue
Block a user