mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Insert/Delete convenience constructors.
This commit is contained in:
parent
7e5100c813
commit
8618d7bbca
@ -3,6 +3,14 @@ public enum Diff: CustomDebugStringConvertible, CustomDocConvertible, Equatable
|
||||
case Patch(Fix, Fix)
|
||||
indirect case Copy(Syntax<Diff>)
|
||||
|
||||
public static func Insert(term: Fix) -> Diff {
|
||||
return .Patch(.Empty, term)
|
||||
}
|
||||
|
||||
public static func Delete(term: Fix) -> Diff {
|
||||
return .Patch(term, .Empty)
|
||||
}
|
||||
|
||||
public var doc: Doc {
|
||||
switch self {
|
||||
case .Empty:
|
||||
|
Loading…
Reference in New Issue
Block a user