1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Insert/Delete convenience constructors.

This commit is contained in:
Rob Rix 2015-09-16 13:52:53 -04:00
parent 7e5100c813
commit 8618d7bbca

View File

@ -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: