mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +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