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